a few missing nolint messages

This commit is contained in:
Kevin Ahrendt 2025-07-14 15:52:40 -04:00
parent b47f9158b2
commit d3ab7f320e

View File

@ -28,6 +28,7 @@ struct SpiRamAllocator : ArduinoJson::Allocator {
std::string build_json(const json_build_t &f) {
auto doc_allocator = SpiRamAllocator();
JsonDocument json_document(&doc_allocator);
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) false positive with ArduinoJson
if (json_document.overflowed()) {
ESP_LOGE(TAG, "Could not allocate memory for JSON document!");
return "{}";
@ -35,6 +36,7 @@ std::string build_json(const json_build_t &f) {
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) false positive with ArduinoJson
JsonObject root = json_document.to<JsonObject>();
f(root);
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) false positive with ArduinoJson
if (json_document.overflowed()) {
ESP_LOGE(TAG, "Could not allocate memory for JSON document!");
return "{}";
@ -47,6 +49,7 @@ std::string build_json(const json_build_t &f) {
bool parse_json(const std::string &data, const json_parse_t &f) {
auto doc_allocator = SpiRamAllocator();
JsonDocument json_document(&doc_allocator);
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) false positive with ArduinoJson
if (json_document.overflowed()) {
ESP_LOGE(TAG, "Could not allocate memory for JSON document!");
return false;