From 8e8c39aefb412431e28f7818ff7b9da1dd5194cc Mon Sep 17 00:00:00 2001 From: joseph calderon Date: Sun, 2 Feb 2025 08:59:52 -0800 Subject: [PATCH 1/4] update ref to ESPAsyncWebServer --- platformio.ini | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/platformio.ini b/platformio.ini index a4b9a1c..f440128 100644 --- a/platformio.ini +++ b/platformio.ini @@ -66,7 +66,7 @@ framework = arduino extends = common lib_deps = ${common.lib_deps} - me-no-dev/ESP Async WebServer@1.2.3 + ESP32Async/ESPAsyncWebServer @ 3.6.0 ; ; Build settings shared across all ESP32 targets. These are appended to or overridden by the target-specific settings. @@ -83,9 +83,7 @@ build_flags = -D CORE_DEBUG_LEVEL=0 lib_deps = ${common.lib_deps} - ; latest master required for ESP32 because released version causes linker failures - ; https://github.com/me-no-dev/ESPAsyncWebServer/pull/999 - https://github.com/me-no-dev/ESPAsyncWebServer.git + ESP32Async/ESPAsyncWebServer @ 3.6.0 ; ; ESP8266 targets From 7267cf858536e8df71abc439cfe4d080b0921ffa Mon Sep 17 00:00:00 2001 From: Brian Sharon Date: Mon, 3 Feb 2025 06:40:19 -0700 Subject: [PATCH 2/4] Update check config --- platformio.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platformio.ini b/platformio.ini index f440128..b05d3e4 100644 --- a/platformio.ini +++ b/platformio.ini @@ -20,8 +20,8 @@ extra_scripts = check_tool = clangtidy, cppcheck check_flags = clangtidy: --checks '-*,bugprone-*,clang-analyzer-*,misc-*,performance-*,portability-*,readability-*,-readability-magic-numbers,-readability-static-accessed-through-instance,-readability-misplaced-array-index,google-*' - cppcheck: --enable=all --disable=unusedFunction --inline-suppr --std=c++20 --suppress=*:*/.pio/* --suppress=unmatchedSuppression:*/.pio/* -check_skip_packages = no + cppcheck: --enable=all --disable=unusedFunction --inline-suppr --std=c++20 --suppress=*:*/.pio/* --suppress=unmatchedSuppression:*/.pio/* --suppress=*:*/packages/* --suppress=unmatchedSuppression:*/packages/* +check_skip_packages = yes check_src_filters = + + platform_packages = platformio/tool-clangtidy@1.150005.0 From bcd80ce952c8366802de809a1a1f3e9eddcd2655 Mon Sep 17 00:00:00 2001 From: Brian Sharon Date: Mon, 3 Feb 2025 06:45:07 -0700 Subject: [PATCH 3/4] Fix some new warnings popping up --- lib/moment/moment.hpp | 2 +- lib/temperature/include/temperature.hpp | 2 ++ src/main.cpp | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/moment/moment.hpp b/lib/moment/moment.hpp index 873e72d..dc4765b 100644 --- a/lib/moment/moment.hpp +++ b/lib/moment/moment.hpp @@ -97,7 +97,7 @@ class Moment { } private: - void assign(uint32_t value) { + static void assign(uint32_t value) { if (value < _lastValue) { _rolloverCount++; } diff --git a/lib/temperature/include/temperature.hpp b/lib/temperature/include/temperature.hpp index c8d6dd3..ff5cad3 100644 --- a/lib/temperature/include/temperature.hpp +++ b/lib/temperature/include/temperature.hpp @@ -73,6 +73,7 @@ class Temperature { this->celsius = unit == Unit::C ? value : fahrenheitToCelsius(value); } + // NOLINTBEGIN(bugprone-easily-swappable-parameters) Temperature clamp(const Temperature &min, const Temperature &max) const { return Temperature(std::max(std::min(this->celsius, max.celsius), min.celsius), Unit::C); } @@ -81,6 +82,7 @@ class Temperature { celsius = std::max(std::min(this->celsius, max.celsius), min.celsius); return *this; } + // NOLINTEND(bugprone-easily-swappable-parameters) static float celsiusToFahrenheit(const float celsius) { return celsius * 9.0f / 5.0f + 32.0f; diff --git a/src/main.cpp b/src/main.cpp index b2bc3a6..e518ea0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -583,8 +583,10 @@ bool safeModeActive() { return config.other.safeMode && remoteTempStale(); } +// NOLINTBEGIN(readability-named-parameter) void renderView(const String &view, JsonDocument &data, const std::vector> &partials = {}) { + // NOLINTEND(readability-named-parameter) auto header = data[F("header")].to(); header[F("hostname")] = config.network.hostname; header[F("git_hash")] = F(MITSUQTT_GIT_COMMIT); From 6020e7adb9c12d803621ba01f401ad850c765408 Mon Sep 17 00:00:00 2001 From: Brian Sharon Date: Mon, 3 Feb 2025 06:48:55 -0700 Subject: [PATCH 4/4] clang-tidy lied to me --- lib/moment/moment.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/moment/moment.hpp b/lib/moment/moment.hpp index dc4765b..25c9a41 100644 --- a/lib/moment/moment.hpp +++ b/lib/moment/moment.hpp @@ -97,12 +97,12 @@ class Moment { } private: - static void assign(uint32_t value) { + void assign(uint32_t value) { if (value < _lastValue) { _rolloverCount++; } _lastValue = value; - _milliseconds = + this->_milliseconds = static_cast(value) + static_cast(_rolloverCount) * 0xFFFFFFFFLL; }