Skip to content

A GitHub Action to run a cpplint command when new code is pushed into your repo

License

Notifications You must be signed in to change notification settings

cpplint/GitHub-Action-for-cpplint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Action for running cpplint commands

Each time that new code is pushed into your repo, you can have a cpplint command automatically run.

Example workflow:

  • Put the following text into a file named .github/workflows/cpplint.yml in your repo):
name: cpplint
on: [push, pull_request]
jobs:
  cpplint:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - uses: actions/setup-python@v1
    - run: pip install cpplint
    - run: cpplint --recursive .

Customize the final line to match your requirements.

Syntax: cpplint.py [--verbose=#] [--output=emacs|eclipse|vs7|junit]
                   [--filter=-x,+y,...]
                   [--counting=total|toplevel|detailed] [--repository=path]
                   [--root=subdir] [--linelength=digits] [--recursive]
                   [--exclude=path]
                   [--headers=ext1,ext2]
                   [--extensions=hpp,cpp,...]
        <file> [file] ...

cpplint_modified_files.yml

cpplint_modified_files.yml is an alternative, standalone GitHub Action that enables a repo to achieve gradual compliance with cpplint by linting (and compiling) only those files that have been added or modified (vs. origin/master).

  1. runs cpplint only on those files that have been modified vs. origin/master.
  2. compiles with g++ only those files that have been modified vs. origin/master.
  3. other optional filepath verifications may be commented out at the end of this file.

About

A GitHub Action to run a cpplint command when new code is pushed into your repo

Resources

License

Stars

Watchers

Forks

Packages

No packages published