-
Notifications
You must be signed in to change notification settings - Fork 44
refactor(quality control): Use Clang-Tidy together with CppCheck #160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…evelopment]` configurations
…dards for improved compatibility
…afruit and SparkFun ESP32 environments
… RP2040 Connect and Raspberry Pi Pico environments
…ruit and Arduino SAMD21 environments
…3.1, 3.2, 3.5, 3.6, 4.0, and 4.1 environments
…fic build flags for Adafruit Metro M4
…lures for RP2040 and Teensy targets
…or defect detection
This is disabled while I work on re-factoring the C++ Check side of things.
…from quality_control.ini
…ality_control.ini This is where I should have temporarily disabled them in the first place, instead of my `build.py` script. =</.>=
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the quality control process by integrating Clang-Tidy alongside CppCheck for defect detection, and focuses scanning only on CFA-specific code. The defect detector is split into two separate environments (defect_detector_clangtidy and defect_detector_cppcheck) with distinct configurations for complementary code analysis. Build configurations are standardized across all target files to use common build flags and explicitly set release/debug build types.
Key changes:
- Split defect detection into separate Clang-Tidy and CppCheck environments with targeted suppressions to exclude out-of-scope issues
- Standardized build configurations across all platform targets (ESP32, RP2040, SAMD21, SAMD51, STM32, Teensy) to use common build flags, unflags, and build types
- Updated C/C++ standards configuration and optimization levels with renamed sections and added development-specific flags
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/build/targets/quality_control.ini | Split defect detection into separate Clang-Tidy and CppCheck environments with specific configurations |
| src/build/targets/common.ini | Standardized C++ standards, optimization levels, and build flags with new naming conventions |
| src/build/scripts/build.py | Updated to run both Clang-Tidy and CppCheck defect detection sequentially |
| src/build/scripts/.clang-tidy | Added Clang-Tidy configuration file with comprehensive check categories |
| src/build/targets/unified_*.ini | Added explicit build flags, unflags, and build type to all target environments |
| src/build/scripts/platformio.ini | Reorganized directory configurations and commented out legacy sections |
| src/CFA_Config.hpp | Updated version from 2025.9.2 to 2025.10.24 |
| library.properties | Updated version number |
| library.json | Updated version number |
| .devcontainer/devcontainer.json | Changed uucp group ID from 986 to 985 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Use relative links in suppressions instead of absolute links. Co-authored-by: Copilot <[email protected]> Signed-off-by: Cassandra "ZZ Cat" Robinson <[email protected]>
This introduces the same changes as #160, but with a verified commit. Everything should pass now.
|
I have decided to alias this pull request as #161 due to this Pull Request having unverified commits. Because of that, I am closing this Pull Request and the alias will get merged instead. |

Note
This Pull Request contains 19
Unverifiedcommits from 3144f3e to de24843.This is because the GPG signature I was using when I was working on CFA from 2025-09-03 to 2025-09-07 has expired and I have since revoked it.
All commits from d3ae855 on 2025-10-24 onward are verified, because I am now using a new GPG signature.
This is also the first Pull Request where I am using GitHub CoPilot as my code reviewer in addition to me reviewing my own code off-site.
Key changes
All out-of-scope defects (EG defects in upstream board support packages) are ignored.
Arduino.hheader is commented out for Teensy and RP2040 targetsThis prevents the Defect Detector from picking up out-of-scope defects on Teensy 4 and RP2040 based development boards and (by extension) failing builds on these targets for out-of-scope defects.
clang-tidyas a part of its scanning processclang-tidyscans the entirety of CFA for defects.cppcheckin tandem withclang-tidyOne catches what the other one may miss — IE
clang-tidywill scan CFA for medium and high severity defects, andcppcheckwill only scan for high severity defects. Everything else is ignored.What this does
To help with cutting through the noise when building CFA for various targets, I have refactored my Defect Detector script to only pick up on code and build errors that are relevant to CFA.
All out-of-scope defects (usually more relevant to the various upstream repositories CFA relies on for compatibility with your development boards) are ignored.
This means I can focus more on CFA itself and bringing you high quality code instead of bogging myself down with fixing an upstream's coding mistakes.