lint/configured/cpp
A linter is configured
Implements lint/configured for cpp.
| Severity | warning |
| Tiers | 1, 2 |
| Stacks | cpp |
| Scope | each |
| Kind | outcome |
| Source | library v0.5.0 |
| Selected by | fleetlint-recommended@v0.5.0 |
Requirement
A static analyzer runs on the code: clang-tidy with a committed .clang-tidy, run by the build (CMAKE_CXX_CLANG_TIDY), a hook, the task runner or CI; or cppcheck run the same way. Another analyzer is added with accept:.
Why
Without a committed configuration every developer’s editor runs different checks and the build runs none.
Fix
Add .clang-tidy (fleetlint fix --apply writes it) and run clang-tidy over compile_commands.json in the lint target, or set CMAKE_CXX_CLANG_TIDY.
Agent instruction: Add .clang-tidy from the template and a lint target that runs clang-tidy (run-clang-tidy -p build) over compile_commands.json; fix findings rather than disabling checks.
fleetlint fix can apply this rule’s fix automatically (1 action(s)).
A finding of this rule points at .clang-tidy.
Sources
- https://csrc.nist.gov/pubs/sp/800/218/final (standard, PW.7.2: Perform the code review and/or code analysis based on the organization’s secure coding standards)
- https://fleetlint.org/baseline/#static-analysis (convention)
- https://clang.llvm.org/extra/clang-tidy/ (spec)
- https://fleetlint.org/stacks/#cc
Generated by fleetlint docs from catalog v0.5.0.