The Python command behind cpp-linter-action: it runs clang-format and clang-tidy on C and C++ files, locally or in other CI.
Website · Documentation · Get started · Discussions
With the clang tools installed (see Limitations):
pip install cpp-linter
cpp-linter --version=21 --style=file --tidy-checks=''For usage in a GitHub Actions workflow, see the cpp-linter/cpp-linter-action repository
For the description of supported Command Line Interface options, see the CLI documentation
Passing the --fix option makes cpp-linter apply clang-format fixes in-place to
any files that have formatting problems.
Note
--fix only applies clang-format fixes. clang-tidy fixes are not applied
automatically.
- cpp-linter does not install the clang tools. Install them first, for example with
clang-tools; without them,
--version=21falls back to whateverclang-formatandclang-tidyare on yourPATH. - It exits 0 even when checks fail, so it reports findings but does not fail a build.
- Locally,
--files-changed-onlyand--lines-changed-onlyread the local git diff. In other CI, check the whole repository (the default): most CI systems setCI=true, and with it those options ask the GitHub API for the changed files.
To provide feedback (requesting a feature or reporting a bug) please post to issues. To contribute changes, see CONTRIBUTING.rst.
The scripts and documentation in this project are released under the MIT License.