From 6f0707e83cd18f4d944f10a4e074e5a26edfeae4 Mon Sep 17 00:00:00 2001 From: Justin Mitchell Date: Mon, 6 Jul 2026 08:55:24 -0400 Subject: [PATCH] Suppress cppcheck warnings for CI compatibility Add missingInclude suppression to prevent false positives on fresh CI checkouts where include paths are unresolved. Add inline suppression for constVariableReference warning where cppcheck cannot detect mutations without full include path resolution. --- platformio.ini | 5 ++++- src/activities/settings/BleButtonMapActivity.cpp | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index a17bea75..4fd0811b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -13,7 +13,10 @@ framework = arduino monitor_speed = 115200 upload_speed = 921600 check_tool = cppcheck -check_flags = --enable=all --suppress=missingIncludeSystem --suppress=unusedFunction --suppress=unmatchedSuppression --suppress=*:*/.pio/* --inline-suppr +; missingInclude (project headers) is suppressed alongside missingIncludeSystem: on a +; fresh CI checkout cppcheck has no resolved include paths, so it reports every +; project header as missing (~470 information-level lines) and fails the job. +check_flags = --enable=all --suppress=missingIncludeSystem --suppress=missingInclude --suppress=unusedFunction --suppress=unmatchedSuppression --suppress=*:*/.pio/* --inline-suppr check_skip_packages = yes board_upload.flash_size = 16MB diff --git a/src/activities/settings/BleButtonMapActivity.cpp b/src/activities/settings/BleButtonMapActivity.cpp index 5f34bdee..61618d8b 100644 --- a/src/activities/settings/BleButtonMapActivity.cpp +++ b/src/activities/settings/BleButtonMapActivity.cpp @@ -46,6 +46,9 @@ void BleButtonMapActivity::onExit() { bool BleButtonMapActivity::assignCapturedKey(MappedInputManager::Button button) { const uint8_t btn = static_cast(button); + // Mutated via std::replace_if below and through `slot`; cppcheck's CI parse + // (no include paths) can't see the writes and suggests const. + // cppcheck-suppress constVariableReference auto& map = SETTINGS.bleKeyMap; using Entry = CrossPointSettings::BleKeyMapEntry; const uint8_t kind = capturedKind;