diff --git a/esphome/components/modem/modem_component.cpp b/esphome/components/modem/modem_component.cpp index c99e83d1f8..5b0e7b8c26 100644 --- a/esphome/components/modem/modem_component.cpp +++ b/esphome/components/modem/modem_component.cpp @@ -124,7 +124,8 @@ void ModemComponent::setup() { ESP_LOGV(TAG, "DCE setup"); - // clang-format off ( create_modem_dce(dce_factory::ModemType, config, std::move(dte), netif) is private ) + // NOLINTBEGIN(bugprone-branch-clone) + // ( because create_modem_dce(dce_factory::ModemType, config, std::move(dte), netif) is private ) switch (this->model_) { case ModemModel::BG96: this->dce = create_BG96_dce(&dce_config, this->dte_, this->ppp_netif_); @@ -143,7 +144,7 @@ void ModemComponent::setup() { return; break; } - // clang-format on + // NOLINTEND assert(this->dce); diff --git a/esphome/components/modem/modem_component.h b/esphome/components/modem/modem_component.h index ffe87b7a64..cd7851c625 100644 --- a/esphome/components/modem/modem_component.h +++ b/esphome/components/modem/modem_component.h @@ -11,14 +11,12 @@ // esp_modem will use esphome logger (needed if other components include esphome/core/log.h) // We need to do this because "cxx_include/esp_modem_api.hpp" is not a pure C++ header, and use logging. -// FIXME: Find another workaround. clang is currently disabled. +// FIXME: Find another workaround ?. // error: using declarations in the global namespace in headers are prohibited // [google-global-names-in-headers,-warnings-as-errors] -// clang-format off -using esphome::esp_log_printf_; -// clang-format on +using esphome::esp_log_printf_; // NOLINT(google-global-names-in-headers): -#include +#include // NOLINT(clang-diagnostic-error) #include #include #include