OpenShock / Firmware

Espressif Firmware for OpenShock, Controlling shock collars via Reverse engineered proprietary Sub-1 GHz Protocols.
GNU Affero General Public License v3.0
33 stars 13 forks source link

Replace custom StringView with standard library std::string_view #280

Closed hhvrc closed 2 months ago

github-actions[bot] commented 2 months ago

Cpp-Linter Report :warning:

Some files did not pass the configured checks!

clang-format reports: 5 file(s) not formatted - include/Common.h - include/SemVer.h - src/SemVer.cpp - src/http/JsonAPI.cpp - src/util/StringUtils.cpp
clang-tidy reports: 207 concern(s) - **include/CaptivePortal.h:3:10:** error: [clang-diagnostic-error] > 'freertos/portmacro.h' file not found ```h 3 | #include | ^~~~~~~~~~~~~~~~~~~~~~ ``` - **include/CaptivePortal.h:8:11:** warning: [[cppcoreguidelines-avoid-non-const-global-variables](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-non-const-global-variables.html)] > variable 'OpenShock' is non-const and globally accessible, consider making it const ```h 8 | namespace OpenShock::CaptivePortal { | ^ ``` - **include/CaptivePortalInstance.h:15:11:** warning: [[cppcoreguidelines-avoid-non-const-global-variables](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-non-const-global-variables.html)] > variable 'OpenShock' is non-const and globally accessible, consider making it const ```h 15 | namespace OpenShock { | ^ ``` - **include/Common.h:3:10:** error: [clang-diagnostic-error] > 'cstdint' file not found ```h 3 | #include | ^~~~~~~~~ ``` - **include/Common.h:10:12:** warning: [[bugprone-macro-parentheses](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/macro-parentheses.html)] > macro argument should be enclosed in parentheses ```h 10 | TypeName(TypeName&&) = delete; \ | ^ | ( ) ``` - **include/Common.h:11:18:** warning: [[bugprone-macro-parentheses](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/macro-parentheses.html)] > macro argument should be enclosed in parentheses ```h 11 | void operator=(TypeName&&) = delete | ^ | ( ) ``` - **include/Common.h:60:11:** warning: [[cppcoreguidelines-avoid-non-const-global-variables](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-non-const-global-variables.html)] > variable 'OpenShock' is non-const and globally accessible, consider making it const ```h 60 | namespace OpenShock::Constants { | ^ ``` - **include/GatewayClient.h:3:10:** error: [clang-diagnostic-error] > 'WebSocketsClient.h' file not found ```h 3 | #include | ^~~~~~~~~~~~~~~~~~~~ ``` - **include/GatewayClient.h:10:11:** warning: [[cppcoreguidelines-avoid-non-const-global-variables](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-non-const-global-variables.html)] > variable 'OpenShock' is non-const and globally accessible, consider making it const ```h 10 | namespace OpenShock { | ^ ``` - **include/GatewayConnectionManager.h:9:11:** warning: [[cppcoreguidelines-avoid-non-const-global-variables](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-non-const-global-variables.html)] > variable 'OpenShock' is non-const and globally accessible, consider making it const ```h 9 | namespace OpenShock::GatewayConnectionManager { | ^ ``` - **include/SemVer.h:3:10:** error: [clang-diagnostic-error] > 'cstdint' file not found ```h 3 | #include | ^~~~~~~~~ ``` - **include/SemVer.h:7:11:** warning: [[cppcoreguidelines-avoid-non-const-global-variables](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-non-const-global-variables.html)] > variable 'OpenShock' is non-const and globally accessible, consider making it const ```h 7 | namespace OpenShock { | ^ ``` - **include/config/BackendConfig.h:3:10:** error: [clang-diagnostic-error] > 'config/ConfigBase.h' file not found ```h 3 | #include "config/ConfigBase.h" | ^~~~~~~~~~~~~~~~~~~~~ ``` - **include/config/BackendConfig.h:8:11:** warning: [[cppcoreguidelines-avoid-non-const-global-variables](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-non-const-global-variables.html)] > variable 'OpenShock' is non-const and globally accessible, consider making it const ```h 8 | namespace OpenShock::Config { | ^ ``` - **include/config/Config.h:3:10:** error: [clang-diagnostic-error] > 'config/BackendConfig.h' file not found ```h 3 | #include "config/BackendConfig.h" | ^~~~~~~~~~~~~~~~~~~~~~~~ ``` - **include/config/Config.h:15:11:** warning: [[cppcoreguidelines-avoid-non-const-global-variables](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-non-const-global-variables.html)] > variable 'OpenShock' is non-const and globally accessible, consider making it const ```h 15 | namespace OpenShock::Config { | ^ ``` - **include/config/WiFiConfig.h:3:10:** error: [clang-diagnostic-error] > 'config/ConfigBase.h' file not found ```h 3 | #include "config/ConfigBase.h" | ^~~~~~~~~~~~~~~~~~~~~ ``` - **include/config/WiFiConfig.h:10:11:** warning: [[cppcoreguidelines-avoid-non-const-global-variables](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-non-const-global-variables.html)] > variable 'OpenShock' is non-const and globally accessible, consider making it const ```h 10 | namespace OpenShock::Config { | ^ ``` - **include/config/WiFiCredentials.h:3:10:** error: [clang-diagnostic-error] > 'config/ConfigBase.h' file not found ```h 3 | #include "config/ConfigBase.h" | ^~~~~~~~~~~~~~~~~~~~~ ``` - **include/config/WiFiCredentials.h:8:11:** warning: [[cppcoreguidelines-avoid-non-const-global-variables](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-non-const-global-variables.html)] > variable 'OpenShock' is non-const and globally accessible, consider making it const ```h 8 | namespace OpenShock::Config { | ^ ``` - **include/http/HTTPRequestManager.h:3:10:** error: [clang-diagnostic-error] > 'Arduino.h' file not found ```h 3 | #include | ^~~~~~~~~~~ ``` - **include/http/HTTPRequestManager.h:12:11:** warning: [[cppcoreguidelines-avoid-non-const-global-variables](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-non-const-global-variables.html)] > variable 'OpenShock' is non-const and globally accessible, consider making it const ```h 12 | namespace OpenShock::HTTP { | ^ ``` - **include/http/JsonAPI.h:3:10:** error: [clang-diagnostic-error] > 'http/HTTPRequestManager.h' file not found ```h 3 | #include "http/HTTPRequestManager.h" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` - **include/http/JsonAPI.h:8:11:** warning: [[cppcoreguidelines-avoid-non-const-global-variables](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-non-const-global-variables.html)] > variable 'OpenShock' is non-const and globally accessible, consider making it const ```h 8 | namespace OpenShock::HTTP::JsonAPI { | ^ ``` - **include/intconv.h:3:10:** error: [clang-diagnostic-error] > 'cstdint' file not found ```h 3 | #include | ^~~~~~~~~ ``` - **include/intconv.h:6:11:** warning: [[cppcoreguidelines-avoid-non-const-global-variables](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-non-const-global-variables.html)] > variable 'OpenShock' is non-const and globally accessible, consider making it const ```h 6 | namespace OpenShock::IntConv { | ^ ``` - **include/serialization/WSGateway.h:3:10:** error: [clang-diagnostic-error] > 'FirmwareBootType.h' file not found ```h 3 | #include "FirmwareBootType.h" | ^~~~~~~~~~~~~~~~~~~~ ``` - **include/serialization/WSGateway.h:11:11:** warning: [[cppcoreguidelines-avoid-non-const-global-variables](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-non-const-global-variables.html)] > variable 'OpenShock' is non-const and globally accessible, consider making it const ```h 11 | namespace OpenShock::Serialization::Gateway { | ^ ``` - **include/util/IPAddressUtils.h:3:10:** error: [clang-diagnostic-error] > 'IPAddress.h' file not found ```h 3 | #include | ^~~~~~~~~~~~~ ``` - **include/util/IPAddressUtils.h:7:11:** warning: [[cppcoreguidelines-avoid-non-const-global-variables](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-non-const-global-variables.html)] > variable 'OpenShock' is non-const and globally accessible, consider making it const ```h 7 | namespace OpenShock { | ^ ``` - **include/util/PartitionUtils.h:3:10:** error: [clang-diagnostic-error] > 'esp_partition.h' file not found ```h 3 | #include | ^~~~~~~~~~~~~~~~~ ``` - **include/util/PartitionUtils.h:9:11:** warning: [[cppcoreguidelines-avoid-non-const-global-variables](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-non-const-global-variables.html)] > variable 'OpenShock' is non-const and globally accessible, consider making it const ```h 9 | namespace OpenShock { | ^ ``` - **include/util/StringUtils.h:3:10:** error: [clang-diagnostic-error] > 'WString.h' file not found ```h 3 | #include | ^~~~~~~~~~~ ``` - **include/util/StringUtils.h:11:11:** warning: [[cppcoreguidelines-avoid-non-const-global-variables](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-non-const-global-variables.html)] > variable 'OpenShock' is non-const and globally accessible, consider making it const ```h 11 | namespace OpenShock { | ^ ``` - **include/wifi/WiFiManager.h:3:10:** error: [clang-diagnostic-error] > 'wifi/WiFiNetwork.h' file not found ```h 3 | #include "wifi/WiFiNetwork.h" | ^~~~~~~~~~~~~~~~~~~~ ``` - **include/wifi/WiFiManager.h:10:11:** warning: [[cppcoreguidelines-avoid-non-const-global-variables](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-non-const-global-variables.html)] > variable 'OpenShock' is non-const and globally accessible, consider making it const ```h 10 | namespace OpenShock::WiFiManager { | ^ ``` - **src/CaptivePortal.cpp:1:10:** error: [clang-diagnostic-error] > 'freertos/FreeRTOS.h' file not found ```cpp 1 | #include | ^~~~~~~~~~~~~~~~~~~~~ ``` - **src/EStopManager.cpp:1:10:** error: [clang-diagnostic-error] > 'freertos/FreeRTOS.h' file not found ```cpp 1 | #include | ^~~~~~~~~~~~~~~~~~~~~ ``` - **src/GatewayClient.cpp:1:10:** error: [clang-diagnostic-error] > 'GatewayClient.h' file not found ```cpp 1 | #include "GatewayClient.h" | ^~~~~~~~~~~~~~~~~ ``` - **src/GatewayConnectionManager.cpp:1:10:** error: [clang-diagnostic-error] > 'GatewayConnectionManager.h' file not found ```cpp 1 | #include "GatewayConnectionManager.h" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` - **src/GatewayConnectionManager.cpp:151:6:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 151 | bool FetchDeviceInfo(std::string_view authToken) { | ~~~~ ^ | auto -> bool ``` - **src/OtaUpdateManager.cpp:1:10:** error: [clang-diagnostic-error] > 'OtaUpdateManager.h' file not found ```cpp 1 | #include "OtaUpdateManager.h" | ^~~~~~~~~~~~~~~~~~~~ ``` - **src/OtaUpdateManager.cpp:32:9:** warning: [[cppcoreguidelines-macro-usage](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/macro-usage.html)] > function-like macro 'OPENSHOCK_FW_CDN_CHANNEL_URL' used; consider a 'constexpr' template function ```cpp 32 | #define OPENSHOCK_FW_CDN_CHANNEL_URL(ch) OPENSHOCK_FW_CDN_URL("/version-" ch ".txt") | ^ ``` - **src/OtaUpdateManager.cpp:121:6:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_sendFailureMessage', which is reserved in the global namespace ```cpp 121 | bool _sendFailureMessage(std::string_view message, bool fatal = false) { | ^~~~~~~~~~~~~~~~~~~ | sendFailureMessage ``` - **src/OtaUpdateManager.cpp:121:6:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 121 | bool _sendFailureMessage(std::string_view message, bool fatal = false) { | ~~~~ ^ | auto -> bool ``` - **src/OtaUpdateManager.cpp:122:11:** warning: [[cppcoreguidelines-init-variables](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/init-variables.html)] > variable 'updateId' is not initialized ```cpp 122 | int32_t updateId; | ^ | = 0 ``` - **src/OtaUpdateManager.cpp:136:6:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_flashAppPartition', which is reserved in the global namespace ```cpp 136 | bool _flashAppPartition(const esp_partition_t* partition, std::string_view remoteUrl, const uint8_t (&remoteHash)[32]) { | ^~~~~~~~~~~~~~~~~~ | flashAppPartition ``` - **src/OtaUpdateManager.cpp:136:6:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 136 | bool _flashAppPartition(const esp_partition_t* partition, std::string_view remoteUrl, const uint8_t (&remoteHash)[32]) { | ~~~~ ^ | auto -> bool /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:136:93: warning: do not declare C-style arrays, use std::array<> instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays] 136 | bool _flashAppPartition(const esp_partition_t* partition, std::string_view remoteUrl, const uint8_t (&remoteHash)[32]) { | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:136:115: warning: 32 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers] 136 | bool _flashAppPartition(const esp_partition_t* partition, std::string_view remoteUrl, const uint8_t (&remoteHash)[32]) { | ^ ``` - **src/OtaUpdateManager.cpp:171:6:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_flashFilesystemPartition', which is reserved in the global namespace ```cpp 171 | bool _flashFilesystemPartition(const esp_partition_t* parition, std::string_view remoteUrl, const uint8_t (&remoteHash)[32]) { | ^~~~~~~~~~~~~~~~~~~~~~~~~ | flashFilesystemPartition ``` - **src/OtaUpdateManager.cpp:171:6:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 171 | bool _flashFilesystemPartition(const esp_partition_t* parition, std::string_view remoteUrl, const uint8_t (&remoteHash)[32]) { | ~~~~ ^ | auto -> bool /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:171:99: warning: do not declare C-style arrays, use std::array<> instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays] 171 | bool _flashFilesystemPartition(const esp_partition_t* parition, std::string_view remoteUrl, const uint8_t (&remoteHash)[32]) { | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:171:121: warning: 32 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers] 171 | bool _flashFilesystemPartition(const esp_partition_t* parition, std::string_view remoteUrl, const uint8_t (&remoteHash)[32]) { | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:209:37: warning: 10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers] 209 | if (!test.begin(false, "/static", 10, "static0")) { | ^ ``` - **src/OtaUpdateManager.cpp:221:6:** warning: [[readability-function-cognitive-complexity](https://clang.llvm.org/extra/clang-tidy/checks/readability/function-cognitive-complexity.html)] > function '_otaUpdateTask' has cognitive complexity of 51 (threshold 25) ```cpp 221 | void _otaUpdateTask(void* arg) { | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:231:3: note: +1, including nesting penalty of 0, nesting level increased to 1 231 | while (true) { | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:238:5: note: +2, including nesting penalty of 1, nesting level increased to 2 238 | if ((eventBits & OTA_TASK_EVENT_WIFI_DISCONNECTED) != 0) { | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:244:5: note: +2, including nesting penalty of 1, nesting level increased to 2 244 | if ((eventBits & OTA_TASK_EVENT_WIFI_CONNECTED) != 0 && !connected) { | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:244:58: note: +1 244 | if ((eventBits & OTA_TASK_EVENT_WIFI_CONNECTED) != 0 && !connected) { | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:250:5: note: +2, including nesting penalty of 1, nesting level increased to 2 250 | if (!connected) { | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:257:5: note: +2, including nesting penalty of 1, nesting level increased to 2 257 | if (!Config::GetOtaUpdateConfig(config)) { | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:262:5: note: +2, including nesting penalty of 1, nesting level increased to 2 262 | if (!config.isEnabled) { | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:272:36: note: +1 272 | check |= config.checkOnStartup && firstCheck; // On startup | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:273:39: note: +1 273 | check |= config.checkPeriodically && diffMins >= config.checkInterval; // Periodically | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:274:30: note: +1 274 | check |= updateRequested && (firstCheck || diffMins >= 1); // Update requested | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:274:45: note: +1 274 | check |= updateRequested && (firstCheck || diffMins >= 1); // Update requested | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:276:5: note: +2, including nesting penalty of 1, nesting level increased to 2 276 | if (!check) { | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:282:5: note: +2, including nesting penalty of 1, nesting level increased to 2 282 | if (config.requireManualApproval) { | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:289:5: note: +2, including nesting penalty of 1, nesting level increased to 2 289 | if (updateRequested) { | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:292:7: note: +3, including nesting penalty of 2, nesting level increased to 3 292 | if (!_tryGetRequestedVersion(version)) { | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:298:7: note: +1, nesting level increased to 2 298 | } else { | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:302:7: note: +3, including nesting penalty of 2, nesting level increased to 3 302 | if (!OtaUpdateManager::TryGetFirmwareVersion(config.updateChannel, version)) { | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:310:5: note: +2, including nesting penalty of 1, nesting level increased to 2 310 | if (version.toString() == OPENSHOCK_FW_VERSION) { // TODO: This is abusing the SemVer::toString() method causing alot of string copies, fix this | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:317:5: note: +2, including nesting penalty of 1, nesting level increased to 2 317 | if (!Config::SetOtaUpdateId(updateId)) { | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:321:5: note: +2, including nesting penalty of 1, nesting level increased to 2 321 | if (!Config::SetOtaUpdateStep(OpenShock::OtaUpdateStep::Updating)) { | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:326:5: note: +2, including nesting penalty of 1, nesting level increased to 2 326 | if (!Serialization::Gateway::SerializeOtaInstallStartedMessage(updateId, version, GatewayConnectionManager::SendMessageBIN)) { | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:331:5: note: +2, including nesting penalty of 1, nesting level increased to 2 331 | if (!_sendProgressMessage(Serialization::Gateway::OtaInstallProgressTask::FetchingMetadata, 0.0f)) { | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:337:5: note: +2, including nesting penalty of 1, nesting level increased to 2 337 | if (!OtaUpdateManager::TryGetFirmwareRelease(version, release)) { | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:353:5: note: +2, including nesting penalty of 1, nesting level increased to 2 353 | if (appPartition == nullptr) { | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:361:5: note: +2, including nesting penalty of 1, nesting level increased to 2 361 | if (filesystemPartition == nullptr) { | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:372:5: note: +2, including nesting penalty of 1, nesting level increased to 2 372 | if (!_flashFilesystemPartition(filesystemPartition, release.filesystemBinaryUrl, release.filesystemBinaryHash)) continue; | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:373:5: note: +2, including nesting penalty of 1, nesting level increased to 2 373 | if (!_flashAppPartition(appPartition, release.appBinaryUrl, release.appBinaryHash)) continue; | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:376:5: note: +2, including nesting penalty of 1, nesting level increased to 2 376 | if (!Config::SetOtaUpdateStep(OpenShock::OtaUpdateStep::Updated)) { | ^ ``` - **src/OtaUpdateManager.cpp:398:6:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_tryGetStringList', which is reserved in the global namespace ```cpp 398 | bool _tryGetStringList(std::string_view url, std::vector& list) { | ^~~~~~~~~~~~~~~~~ | tryGetStringList ``` - **src/OtaUpdateManager.cpp:398:6:** warning: [[cppcoreguidelines-avoid-non-const-global-variables](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-non-const-global-variables.html)] > variable '_tryGetStringList' is non-const and globally accessible, consider making it const - **src/OtaUpdateManager.cpp:543:6:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_tryParseIntoHash', which is reserved in the global namespace ```cpp 543 | bool _tryParseIntoHash(std::string_view hash, uint8_t (&hashBytes)[32]) { | ^~~~~~~~~~~~~~~~~ | tryParseIntoHash ``` - **src/OtaUpdateManager.cpp:543:6:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 543 | bool _tryParseIntoHash(std::string_view hash, uint8_t (&hashBytes)[32]) { | ~~~~ ^ | auto -> bool /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:543:47: warning: do not declare C-style arrays, use std::array<> instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays] 543 | bool _tryParseIntoHash(std::string_view hash, uint8_t (&hashBytes)[32]) { | ^ /home/runner/work/Firmware/Firmware/src/OtaUpdateManager.cpp:543:68: warning: 32 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers] 543 | bool _tryParseIntoHash(std::string_view hash, uint8_t (&hashBytes)[32]) { | ^ ``` - **src/SemVer.cpp:1:10:** error: [clang-diagnostic-error] > 'SemVer.h' file not found ```cpp 1 | #include "SemVer.h" | ^~~~~~~~~~ ``` - **src/SemVer.cpp:10:16:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_semverIsLetter', which is reserved in the global namespace ```cpp 10 | constexpr bool _semverIsLetter(char c) { | ^~~~~~~~~~~~~~~ | semverIsLetter ``` - **src/SemVer.cpp:10:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 10 | constexpr bool _semverIsLetter(char c) { | ~~~~ ^ | auto -> bool ``` - **src/SemVer.cpp:10:37:** warning: [[readability-identifier-length](https://clang.llvm.org/extra/clang-tidy/checks/readability/identifier-length.html)] > parameter name 'c' is too short, expected at least 3 characters ```cpp 10 | constexpr bool _semverIsLetter(char c) { | ^ ``` - **src/SemVer.cpp:16:16:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_semverIsDigit', which is reserved in the global namespace ```cpp 16 | constexpr bool _semverIsDigit(char c) { | ^~~~~~~~~~~~~~ | semverIsDigit ``` - **src/SemVer.cpp:16:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 16 | constexpr bool _semverIsDigit(char c) { | ~~~~ ^ | auto -> bool ``` - **src/SemVer.cpp:16:36:** warning: [[readability-identifier-length](https://clang.llvm.org/extra/clang-tidy/checks/readability/identifier-length.html)] > parameter name 'c' is too short, expected at least 3 characters ```cpp 16 | constexpr bool _semverIsDigit(char c) { | ^ ``` - **src/SemVer.cpp:19:16:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_semverIsDigits', which is reserved in the global namespace ```cpp 19 | constexpr bool _semverIsDigits(std::string_view str) { | ^~~~~~~~~~~~~~~ | semverIsDigits ``` - **src/SemVer.cpp:19:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 19 | constexpr bool _semverIsDigits(std::string_view str) { | ~~~~ ^ | auto -> bool ``` - **src/SemVer.cpp:21:12:** warning: [[readability-simplify-boolean-expr](https://clang.llvm.org/extra/clang-tidy/checks/readability/simplify-boolean-expr.html)] > redundant boolean literal in conditional return statement ```cpp 20 | if (str.empty()) { | ~~~~~~~~~~~~~~~~~~ | return !static_cast(str.empty()) 21 | return false; | ~~~~~~~^~~~~~ 22 | } | ~ 23 | 24 | for (auto c : str) { | ~~~~~~~~~~~~~~~~~~~~ 25 | if (!_semverIsDigit(c)) { | ~~~~~~~~~~~~~~~~~~~~~~~~~ 26 | return false; | ~~~~~~~~~~~~~ 27 | } | ~ 28 | } | ~ 29 | 30 | return true; | ~~~~~~~~~~~ ``` - **src/SemVer.cpp:35:16:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_semverIsIdentifierChararacter', which is reserved in the global namespace ```cpp 35 | constexpr bool _semverIsIdentifierChararacter(char c) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | semverIsIdentifierChararacter ``` - **src/SemVer.cpp:35:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 35 | constexpr bool _semverIsIdentifierChararacter(char c) { | ~~~~ ^ | auto -> bool ``` - **src/SemVer.cpp:35:52:** warning: [[readability-identifier-length](https://clang.llvm.org/extra/clang-tidy/checks/readability/identifier-length.html)] > parameter name 'c' is too short, expected at least 3 characters ```cpp 35 | constexpr bool _semverIsIdentifierChararacter(char c) { | ^ ``` - **src/SemVer.cpp:38:16:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_semverIsIdentifierChararacters', which is reserved in the global namespace ```cpp 38 | constexpr bool _semverIsIdentifierChararacters(std::string_view str) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | semverIsIdentifierChararacters ``` - **src/SemVer.cpp:38:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 38 | constexpr bool _semverIsIdentifierChararacters(std::string_view str) { | ~~~~ ^ | auto -> bool ``` - **src/SemVer.cpp:40:12:** warning: [[readability-simplify-boolean-expr](https://clang.llvm.org/extra/clang-tidy/checks/readability/simplify-boolean-expr.html)] > redundant boolean literal in conditional return statement ```cpp 39 | if (str.empty()) { | ~~~~~~~~~~~~~~~~~~ | return !static_cast(str.empty()) 40 | return false; | ~~~~~~~^~~~~~ 41 | } | ~ 42 | 43 | for (auto c : str) { | ~~~~~~~~~~~~~~~~~~~~ 44 | if (!_semverIsIdentifierChararacter(c)) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 45 | return false; | ~~~~~~~~~~~~~ 46 | } | ~ 47 | } | ~ 48 | 49 | return true; | ~~~~~~~~~~~ ``` - **src/SemVer.cpp:51:16:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_semverIsNumericIdentifier', which is reserved in the global namespace ```cpp 51 | constexpr bool _semverIsNumericIdentifier(std::string_view str) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | semverIsNumericIdentifier ``` - **src/SemVer.cpp:51:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 51 | constexpr bool _semverIsNumericIdentifier(std::string_view str) { | ~~~~ ^ | auto -> bool ``` - **src/SemVer.cpp:62:16:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_semverIsAlphanumericIdentifier', which is reserved in the global namespace ```cpp 62 | constexpr bool _semverIsAlphanumericIdentifier(std::string_view str) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | semverIsAlphanumericIdentifier ``` - **src/SemVer.cpp:62:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 62 | constexpr bool _semverIsAlphanumericIdentifier(std::string_view str) { | ~~~~ ^ | auto -> bool ``` - **src/SemVer.cpp:97:16:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_semverIsBuildIdentifier', which is reserved in the global namespace ```cpp 97 | constexpr bool _semverIsBuildIdentifier(std::string_view str) { | ^~~~~~~~~~~~~~~~~~~~~~~~ | semverIsBuildIdentifier ``` - **src/SemVer.cpp:97:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 97 | constexpr bool _semverIsBuildIdentifier(std::string_view str) { | ~~~~ ^ | auto -> bool ``` - **src/SemVer.cpp:100:16:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_semverIsPrereleaseIdentifier', which is reserved in the global namespace ```cpp 100 | constexpr bool _semverIsPrereleaseIdentifier(std::string_view str) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | semverIsPrereleaseIdentifier ``` - **src/SemVer.cpp:100:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 100 | constexpr bool _semverIsPrereleaseIdentifier(std::string_view str) { | ~~~~ ^ | auto -> bool ``` - **src/SemVer.cpp:103:16:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_semverIsDotSeperatedBuildIdentifiers', which is reserved in the global namespace ```cpp 103 | constexpr bool _semverIsDotSeperatedBuildIdentifiers(std::string_view str) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | semverIsDotSeperatedBuildIdentifiers ``` - **src/SemVer.cpp:103:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 103 | constexpr bool _semverIsDotSeperatedBuildIdentifiers(std::string_view str) { | ~~~~ ^ | auto -> bool ``` - **src/SemVer.cpp:121:16:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_semverIsDotSeperatedPreleaseIdentifiers', which is reserved in the global namespace ```cpp 121 | constexpr bool _semverIsDotSeperatedPreleaseIdentifiers(std::string_view str) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | semverIsDotSeperatedPreleaseIdentifiers ``` - **src/SemVer.cpp:121:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 121 | constexpr bool _semverIsDotSeperatedPreleaseIdentifiers(std::string_view str) { | ~~~~ ^ | auto -> bool ``` - **src/SemVer.cpp:140:12:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_semverIsMinor', which is reserved in the global namespace ```cpp 140 | const auto _semverIsMinor = _semverIsNumericIdentifier; | ^~~~~~~~~~~~~~ | semverIsMinor ``` - **src/SemVer.cpp:141:12:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_semverIsMajor', which is reserved in the global namespace ```cpp 141 | const auto _semverIsMajor = _semverIsNumericIdentifier; | ^~~~~~~~~~~~~~ | semverIsMajor ``` - **src/SemVer.cpp:142:12:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_semverIsPrerelease', which is reserved in the global namespace ```cpp 142 | const auto _semverIsPrerelease = _semverIsDotSeperatedPreleaseIdentifiers; | ^~~~~~~~~~~~~~~~~~~ | semverIsPrerelease ``` - **src/SemVer.cpp:143:12:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_semverIsBuild', which is reserved in the global namespace ```cpp 143 | const auto _semverIsBuild = _semverIsDotSeperatedBuildIdentifiers; | ^~~~~~~~~~~~~~ | semverIsBuild ``` - **src/SemVer.cpp:144:6:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_semverIsVersionCore', which is reserved in the global namespace ```cpp 144 | bool _semverIsVersionCore(std::string_view str) { | ^~~~~~~~~~~~~~~~~~~~ | semverIsVersionCore ``` - **src/SemVer.cpp:144:6:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 144 | bool _semverIsVersionCore(std::string_view str) { | ~~~~ ^ | auto -> bool /home/runner/work/Firmware/Firmware/src/SemVer.cpp:149:25: warning: do not declare C-style arrays, use std::array<> instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays] 149 | std::string_view parts[3]; | ^ ``` - **src/SemVer.cpp:156:6:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_semverIsSemver', which is reserved in the global namespace ```cpp 156 | bool _semverIsSemver(std::string_view str) { | ^~~~~~~~~~~~~~~ | semverIsSemver ``` - **src/SemVer.cpp:156:6:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 156 | bool _semverIsSemver(std::string_view str) { | ~~~~ ^ | auto -> bool ``` - **src/SemVer.cpp:197:6:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_tryParseU16', which is reserved in the global namespace ```cpp 197 | bool _tryParseU16(std::string_view str, uint16_t& out) { | ^~~~~~~~~~~~ | tryParseU16 ``` - **src/SemVer.cpp:197:6:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 197 | bool _tryParseU16(std::string_view str, uint16_t& out) { | ~~~~ ^ | auto -> bool ``` - **src/config/BackendConfig.cpp:1:10:** error: [clang-diagnostic-error] > 'config/BackendConfig.h' file not found ```cpp 1 | #include "config/BackendConfig.h" | ^~~~~~~~~~~~~~~~~~~~~~~~ ``` - **src/config/Config.cpp:1:10:** error: [clang-diagnostic-error] > 'freertos/FreeRTOS.h' file not found ```cpp 1 | #include | ^~~~~~~~~~~~~~~~~~~~~ ``` - **src/config/WiFiConfig.cpp:1:10:** error: [clang-diagnostic-error] > 'config/WiFiConfig.h' file not found ```cpp 1 | #include "config/WiFiConfig.h" | ^~~~~~~~~~~~~~~~~~~~~ ``` - **src/config/WiFiCredentials.cpp:1:10:** error: [clang-diagnostic-error] > 'config/WiFiCredentials.h' file not found ```cpp 1 | #include "config/WiFiCredentials.h" | ^~~~~~~~~~~~~~~~~~~~~~~~~~ ``` - **src/config/internal/utils.cpp:1:10:** error: [clang-diagnostic-error] > 'config/internal/utils.h' file not found ```cpp 1 | #include "config/internal/utils.h" | ^~~~~~~~~~~~~~~~~~~~~~~~~ ``` - **src/event_handlers/websocket/gateway/OtaInstall.cpp:1:10:** error: [clang-diagnostic-error] > 'event_handlers/impl/WSGateway.h' file not found ```cpp 1 | #include "event_handlers/impl/WSGateway.h" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` - **src/http/HTTPRequestManager.cpp:1:10:** error: [clang-diagnostic-error] > 'http/HTTPRequestManager.h' file not found ```cpp 1 | #include "http/HTTPRequestManager.h" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` - **src/http/HTTPRequestManager.cpp:109:18:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_getDomain', which is reserved in the global namespace ```cpp 109 | std::string_view _getDomain(std::string_view url) { | ^~~~~~~~~~ | getDomain ``` - **src/http/HTTPRequestManager.cpp:109:18:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function - **src/http/HTTPRequestManager.cpp:145:28:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_rateLimitFactory', which is reserved in the global namespace ```cpp 145 | std::shared_ptr _rateLimitFactory(std::string_view domain) { | ^~~~~~~~~~~~~~~~~ | rateLimitFactory ``` - **src/http/HTTPRequestManager.cpp:145:28:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 145 | std::shared_ptr _rateLimitFactory(std::string_view domain) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ | auto -> std::shared_ptr /home/runner/work/Firmware/Firmware/src/http/HTTPRequestManager.cpp:149:23: warning: 1000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers] 149 | rateLimit->addLimit(1000, 5); // 5 per second | ^ /home/runner/work/Firmware/Firmware/src/http/HTTPRequestManager.cpp:149:29: warning: 5 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers] 149 | rateLimit->addLimit(1000, 5); // 5 per second | ^ ``` - **src/http/HTTPRequestManager.cpp:161:28:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_getRateLimiter', which is reserved in the global namespace ```cpp 161 | std::shared_ptr _getRateLimiter(std::string_view url) { | ^~~~~~~~~~~~~~~ | getRateLimiter ``` - **src/http/HTTPRequestManager.cpp:161:28:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 161 | std::shared_ptr _getRateLimiter(std::string_view url) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ | auto -> std::shared_ptr ``` - **src/http/HTTPRequestManager.cpp:180:6:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_setupClient', which is reserved in the global namespace ```cpp 180 | void _setupClient(HTTPClient& client) { | ^~~~~~~~~~~~ | setupClient ``` - **src/http/HTTPRequestManager.cpp:184:8:** warning: [[cppcoreguidelines-pro-type-member-init](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/pro-type-member-init.html)] > constructor does not initialize these fields: result, nWritten ```cpp 184 | struct StreamReaderResult { | ^ 185 | HTTP::RequestResult result; | | {} 186 | std::size_t nWritten; | | {} ``` - **src/http/HTTPRequestManager.cpp:207:16:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_tryParseHexSizeT', which is reserved in the global namespace ```cpp 207 | constexpr bool _tryParseHexSizeT(std::size_t& result, std::string_view str) { | ^~~~~~~~~~~~~~~~~ | tryParseHexSizeT ``` - **src/http/HTTPRequestManager.cpp:207:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 207 | constexpr bool _tryParseHexSizeT(std::size_t& result, std::string_view str) { | ~~~~ ^ | auto -> bool ``` - **src/http/HTTPRequestManager.cpp:442:29:** warning: [[bugprone-reserved-identifier](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html)] > declaration uses identifier '_doGetStream', which is reserved in the global namespace ```cpp 442 | HTTP::Response _doGetStream( | ^~~~~~~~~~~~ | doGetStream ``` - **src/http/HTTPRequestManager.cpp:442:29:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function - **src/http/HTTPRequestManager.cpp:444:3:** warning: [[bugprone-easily-swappable-parameters](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/easily-swappable-parameters.html)] > 3 adjacent parameters of '_doGetStream' of similar type are easily swapped by mistake ```cpp 444 | std::string_view url, | ^~~~~~~~~~~~~~~~~~~~~ 445 | const std::map& headers, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 446 | const std::vector& acceptedCodes, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/runner/work/Firmware/Firmware/src/http/HTTPRequestManager.cpp:444:20: note: the first parameter in the range is 'url' 444 | std::string_view url, | ^~~ /home/runner/work/Firmware/Firmware/src/http/HTTPRequestManager.cpp:446:27: note: the last parameter in the range is 'acceptedCodes' 446 | const std::vector& acceptedCodes, | ^~~~~~~~~~~~~ /home/runner/work/Firmware/Firmware/src/http/HTTPRequestManager.cpp:445:3: note: 'int' and 'const int &' parameters accept and bind the same kind of values 445 | const std::map& headers, | ^ ``` - **src/http/HTTPRequestManager.cpp:448:3:** warning: [[bugprone-easily-swappable-parameters](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/easily-swappable-parameters.html)] > 3 adjacent parameters of '_doGetStream' of convertible types are easily swapped by mistake ```cpp 448 | HTTP::GotContentLengthCallback contentLengthCallback, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 449 | HTTP::DownloadCallback downloadCallback, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 450 | uint32_t timeoutMs | ~~~~~~~~~~~~~~~~~~ /home/runner/work/Firmware/Firmware/src/http/HTTPRequestManager.cpp:448:34: note: the first parameter in the range is 'contentLengthCallback' 448 | HTTP::GotContentLengthCallback contentLengthCallback, | ^~~~~~~~~~~~~~~~~~~~~ /home/runner/work/Firmware/Firmware/src/http/HTTPRequestManager.cpp:450:12: note: the last parameter in the range is 'timeoutMs' 450 | uint32_t timeoutMs | ^~~~~~~~~ /home/runner/work/Firmware/Firmware/src/http/HTTPRequestManager.cpp:448:3: note: 448 | HTTP::GotContentLengthCallback contentLengthCallback, | ^ /home/runner/work/Firmware/Firmware/src/http/HTTPRequestManager.cpp:450:3: note: 'int' and 'uint32_t' may be implicitly converted: 'int' -> 'uint32_t' (as 'unsigned int'), 'uint32_t' (as 'unsigned int') -> 'int' 450 | uint32_t timeoutMs | ^ ``` - **src/http/HTTPRequestManager.cpp:452:11:** warning: [[cppcoreguidelines-init-variables](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/init-variables.html)] > variable 'begin' is not initialized ```cpp 452 | int64_t begin = OpenShock::millis(); | ^ | = 0 ``` - **src/http/JsonAPI.cpp:1:10:** error: [clang-diagnostic-error] > 'http/JsonAPI.h' file not found ```cpp 1 | #include "http/JsonAPI.h" | ^~~~~~~~~~~~~~~~ ``` - **src/intconv.cpp:1:10:** error: [clang-diagnostic-error] > 'intconv.h' file not found ```cpp 1 | #include "intconv.h" | ^~~~~~~~~~~ ``` - **src/intconv.cpp:11:24:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 11 | constexpr unsigned int NumDigits() { | ~~~~~~~~~~~~ ^ | auto -> unsigned int ``` - **src/intconv.cpp:12:17:** warning: [[modernize-type-traits](https://clang.llvm.org/extra/clang-tidy/checks/modernize/type-traits.html)] > use c++17 style variable templates ```cpp 12 | static_assert(std::is_integral::value); | ^ ~~~~~~~ | _v ``` - **src/intconv.cpp:26:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 26 | constexpr bool spanToT(std::string_view str, T& val) { | ~~~~ ^ | auto -> bool ``` - **src/intconv.cpp:27:17:** warning: [[modernize-type-traits](https://clang.llvm.org/extra/clang-tidy/checks/modernize/type-traits.html)] > use c++17 style variable templates ```cpp 27 | static_assert(std::is_integral::value); | ^ ~~~~~~~ | _v ``` - **src/intconv.cpp:61:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 61 | constexpr bool spanToUT(std::string_view str, T& val) { | ~~~~ ^ | auto -> bool ``` - **src/intconv.cpp:62:17:** warning: [[modernize-type-traits](https://clang.llvm.org/extra/clang-tidy/checks/modernize/type-traits.html)] > use c++17 style variable templates ```cpp 62 | static_assert(std::is_unsigned::value); | ^ ~~~~~~~ | _v ``` - **src/intconv.cpp:73:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 73 | constexpr bool spanToST(std::string_view str, T& val) { | ~~~~ ^ | auto -> bool ``` - **src/intconv.cpp:74:17:** warning: [[modernize-type-traits](https://clang.llvm.org/extra/clang-tidy/checks/modernize/type-traits.html)] > use c++17 style variable templates ```cpp 74 | static_assert(std::is_signed::value); | ^ ~~~~~~~ | _v ``` - **src/intconv.cpp:140:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 140 | constexpr bool test_spanToUT8() { | ~~~~ ^ | auto -> bool ``` - **src/intconv.cpp:141:11:** warning: [[readability-identifier-length](https://clang.llvm.org/extra/clang-tidy/checks/readability/identifier-length.html)] > variable name 'u8' is too short, expected at least 3 characters ```cpp 141 | uint8_t u8 = 0; | ^ ``` - **src/intconv.cpp:147:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 147 | constexpr bool test_spanToUT16() { | ~~~~ ^ | auto -> bool ``` - **src/intconv.cpp:154:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 154 | constexpr bool test_spanToUT32() { | ~~~~ ^ | auto -> bool ``` - **src/intconv.cpp:161:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 161 | constexpr bool test_spanToUT64() { | ~~~~ ^ | auto -> bool ``` - **src/intconv.cpp:168:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 168 | constexpr bool test_spanToUT8Overflow() { | ~~~~ ^ | auto -> bool ``` - **src/intconv.cpp:169:11:** warning: [[readability-identifier-length](https://clang.llvm.org/extra/clang-tidy/checks/readability/identifier-length.html)] > variable name 'u8' is too short, expected at least 3 characters ```cpp 169 | uint8_t u8 = 0; | ^ ``` - **src/intconv.cpp:175:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 175 | constexpr bool test_spanToUT16Overflow() { | ~~~~ ^ | auto -> bool ``` - **src/intconv.cpp:182:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 182 | constexpr bool test_spanToUT32Overflow() { | ~~~~ ^ | auto -> bool ``` - **src/intconv.cpp:189:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 189 | constexpr bool test_spanToUT64Overflow() { | ~~~~ ^ | auto -> bool ``` - **src/intconv.cpp:196:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 196 | constexpr bool test_spanToST8() { | ~~~~ ^ | auto -> bool ``` - **src/intconv.cpp:197:10:** warning: [[readability-identifier-length](https://clang.llvm.org/extra/clang-tidy/checks/readability/identifier-length.html)] > variable name 'i8' is too short, expected at least 3 characters ```cpp 197 | int8_t i8 = 0; | ^ ``` - **src/intconv.cpp:203:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 203 | constexpr bool test_spanToST16() { | ~~~~ ^ | auto -> bool ``` - **src/intconv.cpp:210:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 210 | constexpr bool test_spanToST32() { | ~~~~ ^ | auto -> bool ``` - **src/intconv.cpp:217:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 217 | constexpr bool test_spanToST64() { | ~~~~ ^ | auto -> bool ``` - **src/intconv.cpp:224:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 224 | constexpr bool test_spanToST8Underflow() { | ~~~~ ^ | auto -> bool ``` - **src/intconv.cpp:225:10:** warning: [[readability-identifier-length](https://clang.llvm.org/extra/clang-tidy/checks/readability/identifier-length.html)] > variable name 'i8' is too short, expected at least 3 characters ```cpp 225 | int8_t i8 = 0; | ^ ``` - **src/intconv.cpp:231:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 231 | constexpr bool test_spanToST8Overflow() { | ~~~~ ^ | auto -> bool ``` - **src/intconv.cpp:232:10:** warning: [[readability-identifier-length](https://clang.llvm.org/extra/clang-tidy/checks/readability/identifier-length.html)] > variable name 'i8' is too short, expected at least 3 characters ```cpp 232 | int8_t i8 = 0; | ^ ``` - **src/intconv.cpp:238:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 238 | constexpr bool test_spanToST16Underflow() { | ~~~~ ^ | auto -> bool ``` - **src/intconv.cpp:245:16:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)] > use a trailing return type for this function ```cpp 245 | constexpr bool test_spanToST16Overflow() { | ~~~~ ^ | auto -> bool ```

Have any feedback or feature suggestions? Share it here.