| name | clang-tidy |
| description | Run clang-tidy on C++ files changed relative to main and report violations |
clang-tidy
Run clang-tidy on every C++ file that differs from main and report violations with
file:line context.
Steps:
-
Check that .vscode/build/compile_commands.json exists. If not, tell the user to run
cmake -B .vscode/build first and stop.
-
Find changed C++ files:
git diff --name-only main...HEAD -- '*.cpp' '*.h' '*.hpp'
Also include any untracked files in src/, lib/, or include/ that are not in
.pio/, build/, or _deps/.
If no C++ files are changed, report "No C++ files changed relative to main." and stop.
-
For each file, run:
clang-tidy -p .vscode/build <file>
-
Collect all output. Report:
- A summary line per file: OK or the number of warnings/errors
- Full violation details (file:line:col: warning/error: message [check-name]) for
any file with findings
- An overall count: N files checked, M violations found
If clang-tidy is not installed, report the error and stop.
Do not auto-fix — report only.