cpp-linter runs clang-format and clang-tidy on the files each pull
request changes and reports what it finds in the job log and as
annotations on the pull request. Turn on reviews and the fixes arrive
as suggestions you commit in one click. Set the same LLVM version in
the workflow and the pre-commit hooks, and laptops and CI use the
same major release.
Annotates findings on the pull request. Pass GITHUB_TOKEN with pull-requests: write to add a summary comment or review suggestions. Linux, macOS and Windows runners.
pre-commit hooks that pip-install the clang-format and clang-tidy version you pin, on every developer's machine. clang-tidy wheels cover LLVM 13 to 22.
The Python command behind the action. Run it locally, or on the whole repository in other CI, with clang tools you install first. It exits 0 even when checks fail.
Different clang-format releases can format the same file
differently. Set the same LLVM version in the action, the pre-commit
hooks and on your machine, and every step runs the same major
release. The clang-tidy hook covers LLVM 13 to 22; the action and
clang-tools cover 12 to 23.
--version 21
On your laptop
clang-tools
Install clang-format and clang-tidy by LLVM version with pip, Homebrew or asdf, or run them from a Docker image.
--version=21
Before each commit
cpp-linter-hooks
pre-commit runs them on the files you staged.
version: '21'
On the pull request
cpp-linter-action
Checks the files the pull request changes and annotates the findings.
--version=21
In other CI
cpp-linter
The same checks as one Python command. Install LLVM 21 first: without it, --version=21 falls back to whatever clang-format is on PATH.
What reviewers see
Results show up on the pull request
Annotations are on by default. Review suggestions, a summary comment and auto-fix each take one input plus write access for the job.
−int* p=0;
+int *p = nullptr;
Commit suggestion
Suggestions you can commit
Set format-review or tidy-review and fixes for lines in the diff arrive as review suggestions. Needs pull-requests: write, so pull requests from forks get annotations only.
17for (size_t i = 0; i < n; ++i) {
18 if (v[i] == 0) return false;
19}
Line 18 · readability-braces-around-statements
Notes in the diff
clang-tidy findings in the checked file are annotated on their line (GitHub shows up to 10 warnings per step), and clang-format adds one note per file. Annotations need no write access, so they also work on pull requests from forks.
github-actionsbotcommented · edited
Cpp-Linter Report Some files did not pass the configured checks!
clang-tidy (v21.1.0) reports: 2 concern(s)
One summary comment
Set thread-comments: update and one comment lists the results, edited on each push while there are findings. It is posted by github-actions[bot] or your own App, and needs pull-requests: write, so it fails on pull requests from forks.
style: apply clang-format fixes2 files changed · pushed to feature/parser
auto-fix: true plus contents: write
Fixes pushed for you
New in v2.23
Set auto-fix: true and give the job contents: write, and the clang-format fixes are committed to the branch of a same-repository pull request, by default under the name of whoever triggered the run.
Bringing clang-tidy to an old codebase? Set
lines-changed-only: true and only the lines each pull request changes are
checked, so a strict .clang-tidy works from the first pull request.
That is GitHub's dependents count, forks included. 550+ public projects run it on their default branch, with 75,000+ GitHub stars between them. A few of them, with stars as of September 2026:
2Open a pull request that changes C or C++ files, from a branch in this repository and not as a draft.
3Commit the suggestions you agree with.
Runs on Linux, macOS and Windows runners with LLVM 12 to 23, and reads your .clang-format and .clang-tidy files. On pull requests from forks the token is read-only, so findings show up as annotations only.
clang-tidy diagnostics
use nullptr [modernize-use-nullptr]