https://github.com/cpplint/github-action-for-cpplint
A GitHub Action to run a cpplint command when new code is pushed into your repo
https://github.com/cpplint/github-action-for-cpplint
Last synced: 21 days ago
JSON representation
A GitHub Action to run a cpplint command when new code is pushed into your repo
- Host: GitHub
- URL: https://github.com/cpplint/github-action-for-cpplint
- Owner: cpplint
- License: apache-2.0
- Created: 2019-09-16T03:17:09.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-03-22T22:32:19.000Z (about 1 year ago)
- Last Synced: 2025-03-22T23:19:32.815Z (about 1 year ago)
- Homepage:
- Size: 51.8 KB
- Stars: 10
- Watchers: 2
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GitHub Action for running cpplint commands
Each time new code is pushed into your repo, you can have a [cpplint](https://github.com/cpplint/cpplint) command automatically run.
Example workflow:
* Put the following text into a file named `.github/workflows/cpplint.yml` in your repo):
```yaml
name: cpplint
on: [push, pull_request]
jobs:
cpplint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pipx 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] ...
```
### cpplint_modified_files.yml
[cpplint_modified_files.yml](https://github.com/cpplint/GitHub-Action-for-cpplint/blob/master/.github/workflows/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.