diff --git a/.clang-tidy b/.clang-tidy index 4e128a19455..9aeeb1fc26c 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -96,7 +96,6 @@ Checks: >- -modernize-avoid-variadic-functions, -modernize-avoid-c-arrays, -modernize-avoid-c-style-cast, - -modernize-concat-nested-namespaces, -modernize-macro-to-enum, -modernize-return-braced-init-list, -modernize-type-traits, diff --git a/.clang-tidy.hash b/.clang-tidy.hash index 582e0c1eaa2..2f973e34d9f 100644 --- a/.clang-tidy.hash +++ b/.clang-tidy.hash @@ -1 +1 @@ -0c7f309d70eca8e3efd510092ddb23c530f3934c49371717efa124b788d761f8 +c1e4375738304baabf7e915e5f7ca50fb22ec9b4a2d8312827a32a659f3fa40c diff --git a/esphome/components/adc/adc_sensor_esp8266.cpp b/esphome/components/adc/adc_sensor_esp8266.cpp index be14b252d43..e4f2f82f085 100644 --- a/esphome/components/adc/adc_sensor_esp8266.cpp +++ b/esphome/components/adc/adc_sensor_esp8266.cpp @@ -11,8 +11,7 @@ ADC_MODE(ADC_VCC) #include #endif // USE_ADC_SENSOR_VCC -namespace esphome { -namespace adc { +namespace esphome::adc { static const char *const TAG = "adc.esp8266"; @@ -55,7 +54,6 @@ float ADCSensor::sample() { return aggr.aggregate() / 1024.0f; } -} // namespace adc -} // namespace esphome +} // namespace esphome::adc #endif // USE_ESP8266 diff --git a/esphome/components/adc/adc_sensor_libretiny.cpp b/esphome/components/adc/adc_sensor_libretiny.cpp index 0b1393c2e70..d9b9f50be1f 100644 --- a/esphome/components/adc/adc_sensor_libretiny.cpp +++ b/esphome/components/adc/adc_sensor_libretiny.cpp @@ -3,8 +3,7 @@ #include "adc_sensor.h" #include "esphome/core/log.h" -namespace esphome { -namespace adc { +namespace esphome::adc { static const char *const TAG = "adc.libretiny"; @@ -48,7 +47,6 @@ float ADCSensor::sample() { return aggr.aggregate() / 1000.0f; } -} // namespace adc -} // namespace esphome +} // namespace esphome::adc #endif // USE_LIBRETINY diff --git a/esphome/components/adc/adc_sensor_rp2040.cpp b/esphome/components/adc/adc_sensor_rp2040.cpp index a79707e2347..8d41edb8145 100644 --- a/esphome/components/adc/adc_sensor_rp2040.cpp +++ b/esphome/components/adc/adc_sensor_rp2040.cpp @@ -15,8 +15,7 @@ #define PICO_VSYS_PIN 29 // NOLINT(cppcoreguidelines-macro-usage) #endif -namespace esphome { -namespace adc { +namespace esphome::adc { static const char *const TAG = "adc.rp2040"; @@ -98,7 +97,6 @@ float ADCSensor::sample() { return aggr.aggregate() * 3.3f / 4096.0f * coeff; } -} // namespace adc -} // namespace esphome +} // namespace esphome::adc #endif // USE_RP2040 diff --git a/esphome/components/adc/adc_sensor_zephyr.cpp b/esphome/components/adc/adc_sensor_zephyr.cpp index 2fb9d4b0e50..c3632b00e20 100644 --- a/esphome/components/adc/adc_sensor_zephyr.cpp +++ b/esphome/components/adc/adc_sensor_zephyr.cpp @@ -5,8 +5,7 @@ #include "hal/nrf_saadc.h" -namespace esphome { -namespace adc { +namespace esphome::adc { static const char *const TAG = "adc.zephyr"; @@ -202,6 +201,5 @@ float ADCSensor::sample() { return val_mv / 1000.0f; } -} // namespace adc -} // namespace esphome +} // namespace esphome::adc #endif diff --git a/esphome/components/beken_spi_led_strip/led_strip.cpp b/esphome/components/beken_spi_led_strip/led_strip.cpp index f425f3ca5c4..4e22489844b 100644 --- a/esphome/components/beken_spi_led_strip/led_strip.cpp +++ b/esphome/components/beken_spi_led_strip/led_strip.cpp @@ -33,8 +33,7 @@ static const uint32_t CTRL_NSSMD_3 = 1 << 17; static const uint32_t SPI_TX_FINISH_EN = 1 << 2; static const uint32_t SPI_RX_FINISH_EN = 1 << 3; -namespace esphome { -namespace beken_spi_led_strip { +namespace esphome::beken_spi_led_strip { static const char *const TAG = "beken_spi_led_strip"; @@ -382,7 +381,6 @@ void BekenSPILEDStripLightOutput::dump_config() { float BekenSPILEDStripLightOutput::get_setup_priority() const { return setup_priority::HARDWARE; } -} // namespace beken_spi_led_strip -} // namespace esphome +} // namespace esphome::beken_spi_led_strip #endif // USE_BK72XX diff --git a/esphome/components/beken_spi_led_strip/led_strip.h b/esphome/components/beken_spi_led_strip/led_strip.h index 705f9102a99..4ed640a3bc4 100644 --- a/esphome/components/beken_spi_led_strip/led_strip.h +++ b/esphome/components/beken_spi_led_strip/led_strip.h @@ -8,8 +8,7 @@ #include "esphome/core/component.h" #include "esphome/core/helpers.h" -namespace esphome { -namespace beken_spi_led_strip { +namespace esphome::beken_spi_led_strip { enum RGBOrder : uint8_t { ORDER_RGB, @@ -79,7 +78,6 @@ class BekenSPILEDStripLightOutput : public light::AddressableLight { optional max_refresh_rate_{}; }; -} // namespace beken_spi_led_strip -} // namespace esphome +} // namespace esphome::beken_spi_led_strip #endif // USE_BK72XX diff --git a/esphome/components/bme68x_bsec2_i2c/bme68x_bsec2_i2c.cpp b/esphome/components/bme68x_bsec2_i2c/bme68x_bsec2_i2c.cpp index 2d74ba6b122..2a2c5e2bcc8 100644 --- a/esphome/components/bme68x_bsec2_i2c/bme68x_bsec2_i2c.cpp +++ b/esphome/components/bme68x_bsec2_i2c/bme68x_bsec2_i2c.cpp @@ -9,8 +9,7 @@ #include -namespace esphome { -namespace bme68x_bsec2_i2c { +namespace esphome::bme68x_bsec2_i2c { static const char *const TAG = "bme68x_bsec2_i2c.sensor"; @@ -53,6 +52,5 @@ void BME68xBSEC2I2CComponent::delay_us(uint32_t period, void *intfPtr) { delayMicroseconds(period); } -} // namespace bme68x_bsec2_i2c -} // namespace esphome +} // namespace esphome::bme68x_bsec2_i2c #endif diff --git a/esphome/components/bme68x_bsec2_i2c/bme68x_bsec2_i2c.h b/esphome/components/bme68x_bsec2_i2c/bme68x_bsec2_i2c.h index a21a123f7b9..6d20b613903 100644 --- a/esphome/components/bme68x_bsec2_i2c/bme68x_bsec2_i2c.h +++ b/esphome/components/bme68x_bsec2_i2c/bme68x_bsec2_i2c.h @@ -9,8 +9,7 @@ #include "esphome/components/bme68x_bsec2/bme68x_bsec2.h" #include "esphome/components/i2c/i2c.h" -namespace esphome { -namespace bme68x_bsec2_i2c { +namespace esphome::bme68x_bsec2_i2c { class BME68xBSEC2I2CComponent : public bme68x_bsec2::BME68xBSEC2Component, public i2c::I2CDevice { void setup() override; @@ -23,6 +22,5 @@ class BME68xBSEC2I2CComponent : public bme68x_bsec2::BME68xBSEC2Component, publi static void delay_us(uint32_t period, void *intfPtr); }; -} // namespace bme68x_bsec2_i2c -} // namespace esphome +} // namespace esphome::bme68x_bsec2_i2c #endif diff --git a/esphome/components/debug/debug_esp8266.cpp b/esphome/components/debug/debug_esp8266.cpp index 0519ab72fe9..272123dfc0e 100644 --- a/esphome/components/debug/debug_esp8266.cpp +++ b/esphome/components/debug/debug_esp8266.cpp @@ -15,8 +15,7 @@ extern uint32_t core_version; extern const char *core_release; } -namespace esphome { -namespace debug { +namespace esphome::debug { static const char *const TAG = "debug"; @@ -170,6 +169,5 @@ void DebugComponent::update_platform_() { #endif } -} // namespace debug -} // namespace esphome +} // namespace esphome::debug #endif diff --git a/esphome/components/debug/debug_host.cpp b/esphome/components/debug/debug_host.cpp index 0dfab86e4c4..298a7e44e70 100644 --- a/esphome/components/debug/debug_host.cpp +++ b/esphome/components/debug/debug_host.cpp @@ -2,8 +2,7 @@ #ifdef USE_HOST #include -namespace esphome { -namespace debug { +namespace esphome::debug { const char *DebugComponent::get_reset_reason_(std::span buffer) { return ""; } @@ -15,6 +14,5 @@ size_t DebugComponent::get_device_info_(std::span void DebugComponent::update_platform_() {} -} // namespace debug -} // namespace esphome +} // namespace esphome::debug #endif diff --git a/esphome/components/debug/debug_libretiny.cpp b/esphome/components/debug/debug_libretiny.cpp index 6f36debb95a..1cc04dcbd8e 100644 --- a/esphome/components/debug/debug_libretiny.cpp +++ b/esphome/components/debug/debug_libretiny.cpp @@ -2,8 +2,7 @@ #ifdef USE_LIBRETINY #include "esphome/core/log.h" -namespace esphome { -namespace debug { +namespace esphome::debug { static const char *const TAG = "debug"; @@ -62,6 +61,5 @@ void DebugComponent::update_platform_() { #endif } -} // namespace debug -} // namespace esphome +} // namespace esphome::debug #endif diff --git a/esphome/components/debug/debug_rp2040.cpp b/esphome/components/debug/debug_rp2040.cpp index 73f08492c86..adc23dbf51f 100644 --- a/esphome/components/debug/debug_rp2040.cpp +++ b/esphome/components/debug/debug_rp2040.cpp @@ -12,8 +12,7 @@ #ifdef USE_RP2040_CRASH_HANDLER #include "esphome/components/rp2040/crash_handler.h" #endif -namespace esphome { -namespace debug { +namespace esphome::debug { static const char *const TAG = "debug"; @@ -84,6 +83,5 @@ size_t DebugComponent::get_device_info_(std::span void DebugComponent::update_platform_() {} -} // namespace debug -} // namespace esphome +} // namespace esphome::debug #endif diff --git a/esphome/components/deep_sleep/deep_sleep_esp8266.cpp b/esphome/components/deep_sleep/deep_sleep_esp8266.cpp index 42c153c2f38..9239a7fb311 100644 --- a/esphome/components/deep_sleep/deep_sleep_esp8266.cpp +++ b/esphome/components/deep_sleep/deep_sleep_esp8266.cpp @@ -3,8 +3,7 @@ #include -namespace esphome { -namespace deep_sleep { +namespace esphome::deep_sleep { static const char *const TAG = "deep_sleep"; @@ -20,6 +19,5 @@ void DeepSleepComponent::deep_sleep_() { bool DeepSleepComponent::should_teardown_() { return true; } -} // namespace deep_sleep -} // namespace esphome +} // namespace esphome::deep_sleep #endif diff --git a/esphome/components/esp8266_pwm/esp8266_pwm.cpp b/esphome/components/esp8266_pwm/esp8266_pwm.cpp index cc6bfbc8a88..b5b3d5073aa 100644 --- a/esphome/components/esp8266_pwm/esp8266_pwm.cpp +++ b/esphome/components/esp8266_pwm/esp8266_pwm.cpp @@ -8,8 +8,7 @@ #include -namespace esphome { -namespace esp8266_pwm { +namespace esphome::esp8266_pwm { static const char *const TAG = "esp8266_pwm"; @@ -53,7 +52,6 @@ void HOT ESP8266PWM::write_state(float state) { } } -} // namespace esp8266_pwm -} // namespace esphome +} // namespace esphome::esp8266_pwm #endif diff --git a/esphome/components/esp8266_pwm/esp8266_pwm.h b/esphome/components/esp8266_pwm/esp8266_pwm.h index 4b021fc4622..51c4ea16028 100644 --- a/esphome/components/esp8266_pwm/esp8266_pwm.h +++ b/esphome/components/esp8266_pwm/esp8266_pwm.h @@ -7,8 +7,7 @@ #include "esphome/core/automation.h" #include "esphome/components/output/float_output.h" -namespace esphome { -namespace esp8266_pwm { +namespace esphome::esp8266_pwm { class ESP8266PWM : public output::FloatOutput, public Component { public: @@ -48,7 +47,6 @@ template class SetFrequencyAction : public Action { ESP8266PWM *parent_; }; -} // namespace esp8266_pwm -} // namespace esphome +} // namespace esphome::esp8266_pwm #endif diff --git a/esphome/components/esp_ldo/esp_ldo.cpp b/esphome/components/esp_ldo/esp_ldo.cpp index f8ebec19035..b3c9a59865d 100644 --- a/esphome/components/esp_ldo/esp_ldo.cpp +++ b/esphome/components/esp_ldo/esp_ldo.cpp @@ -3,8 +3,7 @@ #include "esphome/core/log.h" #include "esphome/core/helpers.h" -namespace esphome { -namespace esp_ldo { +namespace esphome::esp_ldo { static const char *const TAG = "esp_ldo"; void EspLdo::setup() { @@ -41,7 +40,6 @@ void EspLdo::adjust_voltage(float voltage) { } } -} // namespace esp_ldo -} // namespace esphome +} // namespace esphome::esp_ldo #endif // USE_ESP32_VARIANT_ESP32P4 diff --git a/esphome/components/esp_ldo/esp_ldo.h b/esphome/components/esp_ldo/esp_ldo.h index 1a20f1d08ad..bb1579e83dd 100644 --- a/esphome/components/esp_ldo/esp_ldo.h +++ b/esphome/components/esp_ldo/esp_ldo.h @@ -4,8 +4,7 @@ #include "esphome/core/automation.h" #include "esp_ldo_regulator.h" -namespace esphome { -namespace esp_ldo { +namespace esphome::esp_ldo { class EspLdo : public Component { public: @@ -40,7 +39,6 @@ template class AdjustAction : public Action { EspLdo *ldo_; }; -} // namespace esp_ldo -} // namespace esphome +} // namespace esphome::esp_ldo #endif // USE_ESP32_VARIANT_ESP32P4 diff --git a/esphome/components/host/gpio.h b/esphome/components/host/gpio.h index ea6b13f436e..6f2bccf1021 100644 --- a/esphome/components/host/gpio.h +++ b/esphome/components/host/gpio.h @@ -4,8 +4,7 @@ #include "esphome/core/hal.h" -namespace esphome { -namespace host { +namespace esphome::host { class HostGPIOPin : public InternalGPIOPin { public: @@ -32,7 +31,6 @@ class HostGPIOPin : public InternalGPIOPin { gpio::Flags flags_{}; }; -} // namespace host -} // namespace esphome +} // namespace esphome::host #endif // USE_HOST diff --git a/esphome/components/libretiny_pwm/libretiny_pwm.cpp b/esphome/components/libretiny_pwm/libretiny_pwm.cpp index 4e4a16d761f..eea593a39da 100644 --- a/esphome/components/libretiny_pwm/libretiny_pwm.cpp +++ b/esphome/components/libretiny_pwm/libretiny_pwm.cpp @@ -3,8 +3,7 @@ #ifdef USE_LIBRETINY -namespace esphome { -namespace libretiny_pwm { +namespace esphome::libretiny_pwm { static const char *const TAG = "libretiny.pwm"; @@ -49,7 +48,6 @@ void LibreTinyPWM::update_frequency(float frequency) { this->write_state(this->duty_); } -} // namespace libretiny_pwm -} // namespace esphome +} // namespace esphome::libretiny_pwm #endif diff --git a/esphome/components/libretiny_pwm/libretiny_pwm.h b/esphome/components/libretiny_pwm/libretiny_pwm.h index f9117090548..f7737be386b 100644 --- a/esphome/components/libretiny_pwm/libretiny_pwm.h +++ b/esphome/components/libretiny_pwm/libretiny_pwm.h @@ -7,8 +7,7 @@ #ifdef USE_LIBRETINY -namespace esphome { -namespace libretiny_pwm { +namespace esphome::libretiny_pwm { class LibreTinyPWM : public output::FloatOutput, public Component { public: @@ -49,7 +48,6 @@ template class SetFrequencyAction : public Action { LibreTinyPWM *parent_; }; -} // namespace libretiny_pwm -} // namespace esphome +} // namespace esphome::libretiny_pwm #endif diff --git a/esphome/components/light/light_traits.h b/esphome/components/light/light_traits.h index c3bb27a9647..a2a6b0a916b 100644 --- a/esphome/components/light/light_traits.h +++ b/esphome/components/light/light_traits.h @@ -3,15 +3,7 @@ #include "color_mode.h" #include "esphome/core/helpers.h" -namespace esphome { - -#ifdef USE_API -namespace api { -class APIConnection; -} // namespace api -#endif - -namespace light { +namespace esphome::light { /// This class is used to represent the capabilities of a light. class LightTraits { @@ -43,5 +35,4 @@ class LightTraits { ColorModeMask supported_color_modes_{}; }; -} // namespace light -} // namespace esphome +} // namespace esphome::light diff --git a/esphome/components/lightwaverf/LwRx.cpp b/esphome/components/lightwaverf/LwRx.cpp index 97104578508..dfb8edfaf7a 100644 --- a/esphome/components/lightwaverf/LwRx.cpp +++ b/esphome/components/lightwaverf/LwRx.cpp @@ -10,8 +10,7 @@ #include #include "esphome/core/helpers.h" -namespace esphome { -namespace lightwaverf { +namespace esphome::lightwaverf { /** Pin change interrupt routine that identifies 1 and 0 LightwaveRF bits @@ -430,6 +429,5 @@ void LwRx::rx_remove_pair_(uint8_t *buf) { } } -} // namespace lightwaverf -} // namespace esphome +} // namespace esphome::lightwaverf #endif diff --git a/esphome/components/lightwaverf/LwTx.cpp b/esphome/components/lightwaverf/LwTx.cpp index 8852935bfd8..339980d6ee6 100644 --- a/esphome/components/lightwaverf/LwTx.cpp +++ b/esphome/components/lightwaverf/LwTx.cpp @@ -11,8 +11,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -namespace esphome { -namespace lightwaverf { +namespace esphome::lightwaverf { static const uint8_t TX_NIBBLE[] = {0xF6, 0xEE, 0xED, 0xEB, 0xDE, 0xDD, 0xDB, 0xBE, 0xBD, 0xBB, 0xB7, 0x7E, 0x7D, 0x7B, 0x77, 0x6F}; @@ -208,6 +207,5 @@ void LwTx::lw_timer_stop() { } } -} // namespace lightwaverf -} // namespace esphome +} // namespace esphome::lightwaverf #endif diff --git a/esphome/components/lightwaverf/lightwaverf.cpp b/esphome/components/lightwaverf/lightwaverf.cpp index 2c6a1ecf5b5..b8b6a9697ea 100644 --- a/esphome/components/lightwaverf/lightwaverf.cpp +++ b/esphome/components/lightwaverf/lightwaverf.cpp @@ -5,8 +5,7 @@ #include "lightwaverf.h" -namespace esphome { -namespace lightwaverf { +namespace esphome::lightwaverf { static const char *const TAG = "lightwaverf.sensor"; @@ -62,7 +61,6 @@ void LightWaveRF::dump_config() { LOG_PIN(" Pin RX: ", this->pin_rx_); LOG_UPDATE_INTERVAL(this); } -} // namespace lightwaverf -} // namespace esphome +} // namespace esphome::lightwaverf #endif diff --git a/esphome/components/lightwaverf/lightwaverf.h b/esphome/components/lightwaverf/lightwaverf.h index 6210e6b5d47..224da6315f4 100644 --- a/esphome/components/lightwaverf/lightwaverf.h +++ b/esphome/components/lightwaverf/lightwaverf.h @@ -11,8 +11,7 @@ #include "LwRx.h" #include "LwTx.h" -namespace esphome { -namespace lightwaverf { +namespace esphome::lightwaverf { #ifdef USE_ESP8266 @@ -61,6 +60,5 @@ template class SendRawAction : public Action { }; #endif -} // namespace lightwaverf -} // namespace esphome +} // namespace esphome::lightwaverf #endif diff --git a/esphome/components/midea/ir_transmitter.h b/esphome/components/midea/ir_transmitter.h index a16aed2e722..f11682230d3 100644 --- a/esphome/components/midea/ir_transmitter.h +++ b/esphome/components/midea/ir_transmitter.h @@ -4,8 +4,7 @@ #ifdef USE_REMOTE_TRANSMITTER #include "esphome/components/remote_base/midea_protocol.h" -namespace esphome { -namespace midea { +namespace esphome::midea { using remote_base::RemoteTransmitterBase; using IrData = remote_base::MideaData; @@ -84,8 +83,7 @@ class IrTransmitter { RemoteTransmitterBase *transmitter_{nullptr}; }; -} // namespace midea -} // namespace esphome +} // namespace esphome::midea #endif #endif // USE_ARDUINO diff --git a/esphome/components/mipi_dsi/mipi_dsi.cpp b/esphome/components/mipi_dsi/mipi_dsi.cpp index fc59aeffe89..9bd2dded2c8 100644 --- a/esphome/components/mipi_dsi/mipi_dsi.cpp +++ b/esphome/components/mipi_dsi/mipi_dsi.cpp @@ -3,8 +3,7 @@ #include "mipi_dsi.h" #include "esphome/core/helpers.h" -namespace esphome { -namespace mipi_dsi { +namespace esphome::mipi_dsi { // Maximum bytes to log for init commands (truncated if larger) static constexpr size_t MIPI_DSI_MAX_CMD_LOG_BYTES = 64; @@ -411,6 +410,5 @@ void MIPI_DSI::dump_config() { YESNO(this->invert_colors_), this->pclk_frequency_); LOG_PIN(" Reset Pin ", this->reset_pin_); } -} // namespace mipi_dsi -} // namespace esphome +} // namespace esphome::mipi_dsi #endif // USE_ESP32_VARIANT_ESP32P4 diff --git a/esphome/components/mipi_dsi/mipi_dsi.h b/esphome/components/mipi_dsi/mipi_dsi.h index c27c9ccc6ef..82827d813e8 100644 --- a/esphome/components/mipi_dsi/mipi_dsi.h +++ b/esphome/components/mipi_dsi/mipi_dsi.h @@ -16,8 +16,7 @@ #include "esp_lcd_mipi_dsi.h" -namespace esphome { -namespace mipi_dsi { +namespace esphome::mipi_dsi { constexpr static const char *const TAG = "display.mipi_dsi"; const uint8_t SW_RESET_CMD = 0x01; @@ -113,6 +112,5 @@ class MIPI_DSI : public display::Display { uint16_t y_high_{0}; }; -} // namespace mipi_dsi -} // namespace esphome +} // namespace esphome::mipi_dsi #endif diff --git a/esphome/components/mipi_rgb/mipi_rgb.cpp b/esphome/components/mipi_rgb/mipi_rgb.cpp index 6f5e2f2490c..b07460fdba9 100644 --- a/esphome/components/mipi_rgb/mipi_rgb.cpp +++ b/esphome/components/mipi_rgb/mipi_rgb.cpp @@ -8,8 +8,7 @@ #include #include -namespace esphome { -namespace mipi_rgb { +namespace esphome::mipi_rgb { static const uint8_t DELAY_FLAG = 0xFF; @@ -400,6 +399,5 @@ void MipiRgb::dump_config() { this->dump_pins_(3, 8, "Red", 0); } -} // namespace mipi_rgb -} // namespace esphome +} // namespace esphome::mipi_rgb #endif // defined(USE_ESP32_VARIANT_ESP32S3) || defined(USE_ESP32_VARIANT_ESP32P4) diff --git a/esphome/components/mipi_rgb/mipi_rgb.h b/esphome/components/mipi_rgb/mipi_rgb.h index accc251a184..4d1d8360998 100644 --- a/esphome/components/mipi_rgb/mipi_rgb.h +++ b/esphome/components/mipi_rgb/mipi_rgb.h @@ -8,8 +8,7 @@ #include "esphome/components/spi/spi.h" #endif -namespace esphome { -namespace mipi_rgb { +namespace esphome::mipi_rgb { constexpr static const char *const TAG = "display.mipi_rgb"; const uint8_t SW_RESET_CMD = 0x01; @@ -120,6 +119,5 @@ class MipiRgbSpi : public MipiRgb, }; #endif -} // namespace mipi_rgb -} // namespace esphome +} // namespace esphome::mipi_rgb #endif diff --git a/esphome/components/neopixelbus/neopixelbus_light.h b/esphome/components/neopixelbus/neopixelbus_light.h index c27244b94dd..1cbe889acf9 100644 --- a/esphome/components/neopixelbus/neopixelbus_light.h +++ b/esphome/components/neopixelbus/neopixelbus_light.h @@ -11,8 +11,7 @@ #include "NeoPixelBus.h" -namespace esphome { -namespace neopixelbus { +namespace esphome::neopixelbus { enum class ESPNeoPixelOrder { GBWR = 0b11000110, @@ -140,7 +139,6 @@ class NeoPixelRGBWLightOutput : public NeoPixelBusLightOutputBasereset_pin_); } -} // namespace qspi_dbi -} // namespace esphome +} // namespace esphome::qspi_dbi #endif diff --git a/esphome/components/qspi_dbi/qspi_dbi.h b/esphome/components/qspi_dbi/qspi_dbi.h index 3eee9bec47b..fa77cc5f762 100644 --- a/esphome/components/qspi_dbi/qspi_dbi.h +++ b/esphome/components/qspi_dbi/qspi_dbi.h @@ -11,8 +11,7 @@ #include "esp_lcd_panel_rgb.h" -namespace esphome { -namespace qspi_dbi { +namespace esphome::qspi_dbi { constexpr static const char *const TAG = "display.qspi_dbi"; static const uint8_t SW_RESET_CMD = 0x01; @@ -168,6 +167,5 @@ class QspiDbi : public display::DisplayBuffer, esp_lcd_panel_handle_t handle_{}; }; -} // namespace qspi_dbi -} // namespace esphome +} // namespace esphome::qspi_dbi #endif diff --git a/esphome/components/rp2040/core.h b/esphome/components/rp2040/core.h index 92fc4f824e6..db8937a8a36 100644 --- a/esphome/components/rp2040/core.h +++ b/esphome/components/rp2040/core.h @@ -7,8 +7,6 @@ extern "C" unsigned long ulMainGetRunTimeCounterValue(); -namespace esphome { -namespace rp2040 {} // namespace rp2040 -} // namespace esphome +namespace esphome::rp2040 {} // namespace esphome::rp2040 #endif // USE_RP2040 diff --git a/esphome/components/rp2040/gpio.h b/esphome/components/rp2040/gpio.h index a98e1dab140..da97cff9b1e 100644 --- a/esphome/components/rp2040/gpio.h +++ b/esphome/components/rp2040/gpio.h @@ -5,8 +5,7 @@ #include #include "esphome/core/hal.h" -namespace esphome { -namespace rp2040 { +namespace esphome::rp2040 { class RP2040GPIOPin : public InternalGPIOPin { public: @@ -33,7 +32,6 @@ class RP2040GPIOPin : public InternalGPIOPin { gpio::Flags flags_{}; }; -} // namespace rp2040 -} // namespace esphome +} // namespace esphome::rp2040 #endif // USE_RP2040 diff --git a/esphome/components/rp2040_pio_led_strip/led_strip.cpp b/esphome/components/rp2040_pio_led_strip/led_strip.cpp index fdb49fb3efe..8afba6ba1d4 100644 --- a/esphome/components/rp2040_pio_led_strip/led_strip.cpp +++ b/esphome/components/rp2040_pio_led_strip/led_strip.cpp @@ -12,8 +12,7 @@ #include #include -namespace esphome { -namespace rp2040_pio_led_strip { +namespace esphome::rp2040_pio_led_strip { static const char *TAG = "rp2040_pio_led_strip"; @@ -210,7 +209,6 @@ void RP2040PIOLEDStripLightOutput::dump_config() { float RP2040PIOLEDStripLightOutput::get_setup_priority() const { return setup_priority::HARDWARE; } -} // namespace rp2040_pio_led_strip -} // namespace esphome +} // namespace esphome::rp2040_pio_led_strip #endif diff --git a/esphome/components/rp2040_pio_led_strip/led_strip.h b/esphome/components/rp2040_pio_led_strip/led_strip.h index 7b626489743..ebc3bbbaa54 100644 --- a/esphome/components/rp2040_pio_led_strip/led_strip.h +++ b/esphome/components/rp2040_pio_led_strip/led_strip.h @@ -16,8 +16,7 @@ #include #include -namespace esphome { -namespace rp2040_pio_led_strip { +namespace esphome::rp2040_pio_led_strip { enum RGBOrder : uint8_t { ORDER_RGB, @@ -127,7 +126,6 @@ class RP2040PIOLEDStripLightOutput : public light::AddressableLight { inline static struct semaphore dma_write_complete_sem_[12]; }; -} // namespace rp2040_pio_led_strip -} // namespace esphome +} // namespace esphome::rp2040_pio_led_strip #endif // USE_RP2040 diff --git a/esphome/components/rp2040_pwm/rp2040_pwm.cpp b/esphome/components/rp2040_pwm/rp2040_pwm.cpp index 90a507b14f7..c9b9e6739d1 100644 --- a/esphome/components/rp2040_pwm/rp2040_pwm.cpp +++ b/esphome/components/rp2040_pwm/rp2040_pwm.cpp @@ -11,8 +11,7 @@ #include #include -namespace esphome { -namespace rp2040_pwm { +namespace esphome::rp2040_pwm { static const char *const TAG = "rp2040_pwm"; @@ -60,7 +59,6 @@ void HOT RP2040PWM::write_state(float state) { pwm_set_gpio_level(this->pin_->get_pin(), state * this->wrap_); } -} // namespace rp2040_pwm -} // namespace esphome +} // namespace esphome::rp2040_pwm #endif diff --git a/esphome/components/rp2040_pwm/rp2040_pwm.h b/esphome/components/rp2040_pwm/rp2040_pwm.h index b82765b1c01..58d3955a31e 100644 --- a/esphome/components/rp2040_pwm/rp2040_pwm.h +++ b/esphome/components/rp2040_pwm/rp2040_pwm.h @@ -7,8 +7,7 @@ #include "esphome/core/component.h" #include "esphome/core/hal.h" -namespace esphome { -namespace rp2040_pwm { +namespace esphome::rp2040_pwm { class RP2040PWM : public output::FloatOutput, public Component { public: @@ -53,7 +52,6 @@ template class SetFrequencyAction : public Action { RP2040PWM *parent_; }; -} // namespace rp2040_pwm -} // namespace esphome +} // namespace esphome::rp2040_pwm #endif // USE_RP2040 diff --git a/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp b/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp index d29f6a0bcb9..00530c3f96e 100644 --- a/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp +++ b/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp @@ -4,8 +4,7 @@ #include "esphome/core/log.h" #include -namespace esphome { -namespace rpi_dpi_rgb { +namespace esphome::rpi_dpi_rgb { void RpiDpiRgb::setup() { this->reset_display_(); @@ -160,7 +159,6 @@ void RpiDpiRgb::reset_display_() const { } } -} // namespace rpi_dpi_rgb -} // namespace esphome +} // namespace esphome::rpi_dpi_rgb #endif // USE_ESP32_VARIANT_ESP32S3 diff --git a/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.h b/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.h index 7525040cd1f..8b1457926c1 100644 --- a/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.h +++ b/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.h @@ -14,8 +14,7 @@ #include "esp_lcd_panel_rgb.h" -namespace esphome { -namespace rpi_dpi_rgb { +namespace esphome::rpi_dpi_rgb { constexpr static const char *const TAG = "rpi_dpi_rgb"; @@ -92,6 +91,5 @@ class RpiDpiRgb : public display::Display { esp_lcd_panel_handle_t handle_{}; }; -} // namespace rpi_dpi_rgb -} // namespace esphome +} // namespace esphome::rpi_dpi_rgb #endif // USE_ESP32_VARIANT_ESP32S3 diff --git a/esphome/components/sdl/sdl_esphome.cpp b/esphome/components/sdl/sdl_esphome.cpp index 74ca2ce39a5..c99b5081b3d 100644 --- a/esphome/components/sdl/sdl_esphome.cpp +++ b/esphome/components/sdl/sdl_esphome.cpp @@ -2,8 +2,7 @@ #include "sdl_esphome.h" #include "esphome/components/display/display_color_utils.h" -namespace esphome { -namespace sdl { +namespace esphome::sdl { int Sdl::get_width() { switch (this->rotation_) { @@ -162,6 +161,5 @@ void Sdl::loop() { } } -} // namespace sdl -} // namespace esphome +} // namespace esphome::sdl #endif diff --git a/esphome/components/sdl/sdl_esphome.h b/esphome/components/sdl/sdl_esphome.h index ce34cb817e0..3f54b705606 100644 --- a/esphome/components/sdl/sdl_esphome.h +++ b/esphome/components/sdl/sdl_esphome.h @@ -9,8 +9,7 @@ #include "SDL.h" #include -namespace esphome { -namespace sdl { +namespace esphome::sdl { constexpr static const char *const TAG = "sdl"; @@ -66,7 +65,6 @@ class Sdl : public display::Display { uint16_t y_high_{0}; std::map> key_callbacks_{}; }; -} // namespace sdl -} // namespace esphome +} // namespace esphome::sdl #endif diff --git a/esphome/components/sdl/touchscreen/sdl_touchscreen.h b/esphome/components/sdl/touchscreen/sdl_touchscreen.h index a1f0fb15e32..cf2fd650889 100644 --- a/esphome/components/sdl/touchscreen/sdl_touchscreen.h +++ b/esphome/components/sdl/touchscreen/sdl_touchscreen.h @@ -4,8 +4,7 @@ #include "../sdl_esphome.h" #include "esphome/components/touchscreen/touchscreen.h" -namespace esphome { -namespace sdl { +namespace esphome::sdl { class SdlTouchscreen : public touchscreen::Touchscreen, public Parented { public: @@ -21,6 +20,5 @@ class SdlTouchscreen : public touchscreen::Touchscreen, public Parented { } }; -} // namespace sdl -} // namespace esphome +} // namespace esphome::sdl #endif diff --git a/esphome/components/shelly_dimmer/dev_table.h b/esphome/components/shelly_dimmer/dev_table.h index e73cd1271cb..32b4810d7a2 100644 --- a/esphome/components/shelly_dimmer/dev_table.h +++ b/esphome/components/shelly_dimmer/dev_table.h @@ -23,8 +23,7 @@ #ifdef USE_SHD_FIRMWARE_DATA #include "stm32flash.h" -namespace esphome { -namespace shelly_dimmer { +namespace esphome::shelly_dimmer { constexpr uint32_t SZ_128 = 0x00000080; constexpr uint32_t SZ_256 = 0x00000100; @@ -153,7 +152,6 @@ constexpr stm32_dev_t DEVICES[] = { {0x0, "", 0x0, 0x0, 0x0, 0x0, 0x0, nullptr, 0x0, 0x0, 0x0, 0x0, 0x0}, }; -} // namespace shelly_dimmer -} // namespace esphome +} // namespace esphome::shelly_dimmer #endif // USE_SHD_FIRMWARE_DATA diff --git a/esphome/components/shelly_dimmer/shelly_dimmer.cpp b/esphome/components/shelly_dimmer/shelly_dimmer.cpp index 230fb963b13..b0f43f0ffca 100644 --- a/esphome/components/shelly_dimmer/shelly_dimmer.cpp +++ b/esphome/components/shelly_dimmer/shelly_dimmer.cpp @@ -56,8 +56,7 @@ template constexpr size_t size(const T (&/*unused*/)[N]) n } // Anonymous namespace -namespace esphome { -namespace shelly_dimmer { +namespace esphome::shelly_dimmer { /// Computes a crappy checksum as defined by the Shelly Dimmer protocol. uint16_t shelly_dimmer_checksum(const uint8_t *buf, int len) { @@ -522,7 +521,6 @@ void ShellyDimmer::reset_dfu_boot_() { this->reset_(true); } -} // namespace shelly_dimmer -} // namespace esphome +} // namespace esphome::shelly_dimmer #endif // USE_ESP8266 diff --git a/esphome/components/shelly_dimmer/shelly_dimmer.h b/esphome/components/shelly_dimmer/shelly_dimmer.h index fd75caa797d..c6d0e20afe8 100644 --- a/esphome/components/shelly_dimmer/shelly_dimmer.h +++ b/esphome/components/shelly_dimmer/shelly_dimmer.h @@ -10,8 +10,7 @@ #include -namespace esphome { -namespace shelly_dimmer { +namespace esphome::shelly_dimmer { class ShellyDimmer : public PollingComponent, public light::LightOutput, public uart::UARTDevice { private: @@ -117,7 +116,6 @@ class ShellyDimmer : public PollingComponent, public light::LightOutput, public void reset_dfu_boot_(); }; -} // namespace shelly_dimmer -} // namespace esphome +} // namespace esphome::shelly_dimmer #endif // USE_ESP8266 diff --git a/esphome/components/shelly_dimmer/stm32flash.cpp b/esphome/components/shelly_dimmer/stm32flash.cpp index a1a933bcab1..c758b0a3123 100644 --- a/esphome/components/shelly_dimmer/stm32flash.cpp +++ b/esphome/components/shelly_dimmer/stm32flash.cpp @@ -112,8 +112,7 @@ constexpr char TAG[] = "stm32flash"; } // Anonymous namespace -namespace esphome { -namespace shelly_dimmer { +namespace esphome::shelly_dimmer { namespace { @@ -487,12 +486,6 @@ template stm32_unique_ptr make_stm32_with_deletor(T ptr) { } // Anonymous namespace -} // namespace shelly_dimmer -} // namespace esphome - -namespace esphome { -namespace shelly_dimmer { - /* find newer command by higher code */ #define newer(prev, a) (((prev) == STM32_CMD_ERR) ? (a) : (((prev) > (a)) ? (prev) : (a))) @@ -1059,7 +1052,6 @@ stm32_err_t stm32_crc_wrapper(const stm32_unique_ptr &stm, uint32_t address, uin return STM32_ERR_OK; } -} // namespace shelly_dimmer -} // namespace esphome +} // namespace esphome::shelly_dimmer #endif // USE_SHD_FIRMWARE_DATA diff --git a/esphome/components/shelly_dimmer/stm32flash.h b/esphome/components/shelly_dimmer/stm32flash.h index d973b352221..9a81f07373e 100644 --- a/esphome/components/shelly_dimmer/stm32flash.h +++ b/esphome/components/shelly_dimmer/stm32flash.h @@ -26,8 +26,7 @@ #include #include "esphome/components/uart/uart.h" -namespace esphome { -namespace shelly_dimmer { +namespace esphome::shelly_dimmer { /* flags */ constexpr auto STREAM_OPT_BYTE = (1 << 0); /* byte (not frame) oriented */ @@ -125,7 +124,6 @@ stm32_err_t stm32_crc_memory(const stm32_unique_ptr &stm, uint32_t address, uint stm32_err_t stm32_crc_wrapper(const stm32_unique_ptr &stm, uint32_t address, uint32_t length, uint32_t *crc); uint32_t stm32_sw_crc(uint32_t crc, uint8_t *buf, unsigned int len); -} // namespace shelly_dimmer -} // namespace esphome +} // namespace esphome::shelly_dimmer #endif // USE_SHD_FIRMWARE_DATA diff --git a/esphome/components/st7701s/st7701s.cpp b/esphome/components/st7701s/st7701s.cpp index 701b6dd79ea..dac8ac9dbcd 100644 --- a/esphome/components/st7701s/st7701s.cpp +++ b/esphome/components/st7701s/st7701s.cpp @@ -4,8 +4,7 @@ #include "esphome/core/log.h" #include -namespace esphome { -namespace st7701s { +namespace esphome::st7701s { void ST7701S::setup() { this->spi_setup(); @@ -195,6 +194,5 @@ void ST7701S::dump_config() { ESP_LOGCONFIG(TAG, " SPI Data rate: %dMHz", (unsigned) (this->data_rate_ / 1000000)); } -} // namespace st7701s -} // namespace esphome +} // namespace esphome::st7701s #endif // USE_ESP32_VARIANT_ESP32S3 diff --git a/esphome/components/st7701s/st7701s.h b/esphome/components/st7701s/st7701s.h index a1e3c2e54a0..de5e4c13d49 100644 --- a/esphome/components/st7701s/st7701s.h +++ b/esphome/components/st7701s/st7701s.h @@ -12,8 +12,7 @@ #include "esp_lcd_panel_rgb.h" -namespace esphome { -namespace st7701s { +namespace esphome::st7701s { constexpr static const char *const TAG = "display.st7701s"; const uint8_t SW_RESET_CMD = 0x01; @@ -113,6 +112,5 @@ class ST7701S : public display::Display, esp_lcd_panel_handle_t handle_{}; }; -} // namespace st7701s -} // namespace esphome +} // namespace esphome::st7701s #endif diff --git a/tests/integration/fixtures/external_components/crc8_test_component/crc8_test_component.cpp b/tests/integration/fixtures/external_components/crc8_test_component/crc8_test_component.cpp index 6c46af19fdf..0c0201508af 100644 --- a/tests/integration/fixtures/external_components/crc8_test_component/crc8_test_component.cpp +++ b/tests/integration/fixtures/external_components/crc8_test_component/crc8_test_component.cpp @@ -2,8 +2,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -namespace esphome { -namespace crc8_test_component { +namespace esphome::crc8_test_component { static const char *const TAG = "crc8_test"; @@ -166,5 +165,4 @@ void CRC8TestComponent::log_test_result(const char *test_name, bool passed) { } } -} // namespace crc8_test_component -} // namespace esphome +} // namespace esphome::crc8_test_component diff --git a/tests/integration/fixtures/external_components/crc8_test_component/crc8_test_component.h b/tests/integration/fixtures/external_components/crc8_test_component/crc8_test_component.h index 3b8847259c3..5d21ab134e0 100644 --- a/tests/integration/fixtures/external_components/crc8_test_component/crc8_test_component.h +++ b/tests/integration/fixtures/external_components/crc8_test_component/crc8_test_component.h @@ -4,8 +4,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -namespace esphome { -namespace crc8_test_component { +namespace esphome::crc8_test_component { class CRC8TestComponent : public Component { public: @@ -25,5 +24,4 @@ class CRC8TestComponent : public Component { uint8_t poly = 0x8C, bool msb_first = false); }; -} // namespace crc8_test_component -} // namespace esphome +} // namespace esphome::crc8_test_component diff --git a/tests/integration/fixtures/external_components/custom_api_device_component/custom_api_device_component.cpp b/tests/integration/fixtures/external_components/custom_api_device_component/custom_api_device_component.cpp index c86ab992425..b66372d8ba6 100644 --- a/tests/integration/fixtures/external_components/custom_api_device_component/custom_api_device_component.cpp +++ b/tests/integration/fixtures/external_components/custom_api_device_component/custom_api_device_component.cpp @@ -2,8 +2,7 @@ #include "esphome/core/log.h" #ifdef USE_API -namespace esphome { -namespace custom_api_device_component { +namespace esphome::custom_api_device_component { static const char *const TAG = "custom_api"; @@ -58,6 +57,5 @@ void CustomAPIDeviceComponent::on_ha_state_changed(std::string entity_id, std::s ESP_LOGI(TAG, "This subscription uses std::string API for backward compatibility"); } -} // namespace custom_api_device_component -} // namespace esphome +} // namespace esphome::custom_api_device_component #endif // USE_API diff --git a/tests/integration/fixtures/external_components/custom_api_device_component/custom_api_device_component.h b/tests/integration/fixtures/external_components/custom_api_device_component/custom_api_device_component.h index 4d519d3ed1f..e75b3401223 100644 --- a/tests/integration/fixtures/external_components/custom_api_device_component/custom_api_device_component.h +++ b/tests/integration/fixtures/external_components/custom_api_device_component/custom_api_device_component.h @@ -6,8 +6,7 @@ #include "esphome/components/api/custom_api_device.h" #ifdef USE_API -namespace esphome { -namespace custom_api_device_component { +namespace esphome::custom_api_device_component { using namespace api; @@ -28,6 +27,5 @@ class CustomAPIDeviceComponent : public Component, public CustomAPIDevice { void on_ha_state_changed(std::string entity_id, std::string state); }; -} // namespace custom_api_device_component -} // namespace esphome +} // namespace esphome::custom_api_device_component #endif // USE_API diff --git a/tests/integration/fixtures/external_components/defer_stress_component/defer_stress_component.cpp b/tests/integration/fixtures/external_components/defer_stress_component/defer_stress_component.cpp index 21ca45947ec..5c3bbeea84d 100644 --- a/tests/integration/fixtures/external_components/defer_stress_component/defer_stress_component.cpp +++ b/tests/integration/fixtures/external_components/defer_stress_component/defer_stress_component.cpp @@ -5,8 +5,7 @@ #include #include -namespace esphome { -namespace defer_stress_component { +namespace esphome::defer_stress_component { static const char *const TAG = "defer_stress"; @@ -71,5 +70,4 @@ void DeferStressComponent::run_multi_thread_test() { ESP_LOGI(TAG, "All threads finished in %lldms. Created %d defer requests", thread_time, this->total_defers_.load()); } -} // namespace defer_stress_component -} // namespace esphome +} // namespace esphome::defer_stress_component diff --git a/tests/integration/fixtures/external_components/defer_stress_component/defer_stress_component.h b/tests/integration/fixtures/external_components/defer_stress_component/defer_stress_component.h index 59b75657260..2aac0aeddce 100644 --- a/tests/integration/fixtures/external_components/defer_stress_component/defer_stress_component.h +++ b/tests/integration/fixtures/external_components/defer_stress_component/defer_stress_component.h @@ -3,8 +3,7 @@ #include "esphome/core/component.h" #include -namespace esphome { -namespace defer_stress_component { +namespace esphome::defer_stress_component { class DeferStressComponent : public Component { public: @@ -16,5 +15,4 @@ class DeferStressComponent : public Component { std::atomic executed_defers_{0}; }; -} // namespace defer_stress_component -} // namespace esphome +} // namespace esphome::defer_stress_component diff --git a/tests/integration/fixtures/external_components/loop_test_component/loop_test_component.cpp b/tests/integration/fixtures/external_components/loop_test_component/loop_test_component.cpp index 28a05d3d45d..dd54381c350 100644 --- a/tests/integration/fixtures/external_components/loop_test_component/loop_test_component.cpp +++ b/tests/integration/fixtures/external_components/loop_test_component/loop_test_component.cpp @@ -1,7 +1,6 @@ #include "loop_test_component.h" -namespace esphome { -namespace loop_test_component { +namespace esphome::loop_test_component { void LoopTestComponent::setup() { ESP_LOGI(TAG, "[%s] Setup called", this->name_.c_str()); } @@ -63,5 +62,4 @@ void LoopTestUpdateComponent::update() { this->update_count_, loop_disabled ? "YES" : "NO"); } -} // namespace loop_test_component -} // namespace esphome +} // namespace esphome::loop_test_component diff --git a/tests/integration/fixtures/external_components/loop_test_component/loop_test_component.h b/tests/integration/fixtures/external_components/loop_test_component/loop_test_component.h index 3dca2da2e9f..1a814118619 100644 --- a/tests/integration/fixtures/external_components/loop_test_component/loop_test_component.h +++ b/tests/integration/fixtures/external_components/loop_test_component/loop_test_component.h @@ -6,8 +6,7 @@ #include "esphome/core/automation.h" #include "esphome/core/helpers.h" -namespace esphome { -namespace loop_test_component { +namespace esphome::loop_test_component { static const char *const TAG = "loop_test_component"; @@ -79,5 +78,4 @@ class LoopTestUpdateComponent : public PollingComponent { int disable_loop_after_{0}; }; -} // namespace loop_test_component -} // namespace esphome +} // namespace esphome::loop_test_component diff --git a/tests/integration/fixtures/external_components/loop_test_component/loop_test_isr_component.cpp b/tests/integration/fixtures/external_components/loop_test_component/loop_test_isr_component.cpp index 30afec04223..b6f94aacf2d 100644 --- a/tests/integration/fixtures/external_components/loop_test_component/loop_test_isr_component.cpp +++ b/tests/integration/fixtures/external_components/loop_test_component/loop_test_isr_component.cpp @@ -2,8 +2,7 @@ #include "esphome/core/hal.h" #include "esphome/core/application.h" -namespace esphome { -namespace loop_test_component { +namespace esphome::loop_test_component { static const char *const ISR_TAG = "loop_test_isr_component"; @@ -76,5 +75,4 @@ void IRAM_ATTR LoopTestISRComponent::simulate_isr_enable() { // For testing, we'll track the call count and log it from the main loop } -} // namespace loop_test_component -} // namespace esphome +} // namespace esphome::loop_test_component diff --git a/tests/integration/fixtures/external_components/loop_test_component/loop_test_isr_component.h b/tests/integration/fixtures/external_components/loop_test_component/loop_test_isr_component.h index 20e11b5ecdb..5537bd02333 100644 --- a/tests/integration/fixtures/external_components/loop_test_component/loop_test_isr_component.h +++ b/tests/integration/fixtures/external_components/loop_test_component/loop_test_isr_component.h @@ -4,8 +4,7 @@ #include "esphome/core/log.h" #include "esphome/core/hal.h" -namespace esphome { -namespace loop_test_component { +namespace esphome::loop_test_component { class LoopTestISRComponent : public Component { public: @@ -28,5 +27,4 @@ class LoopTestISRComponent : public Component { int isr_call_count_{0}; }; -} // namespace loop_test_component -} // namespace esphome +} // namespace esphome::loop_test_component diff --git a/tests/integration/fixtures/external_components/scheduler_bulk_cleanup_component/scheduler_bulk_cleanup_component.cpp b/tests/integration/fixtures/external_components/scheduler_bulk_cleanup_component/scheduler_bulk_cleanup_component.cpp index be85228c3cf..f6fd1b1de72 100644 --- a/tests/integration/fixtures/external_components/scheduler_bulk_cleanup_component/scheduler_bulk_cleanup_component.cpp +++ b/tests/integration/fixtures/external_components/scheduler_bulk_cleanup_component/scheduler_bulk_cleanup_component.cpp @@ -2,8 +2,7 @@ #include "esphome/core/log.h" #include "esphome/core/helpers.h" -namespace esphome { -namespace scheduler_bulk_cleanup_component { +namespace esphome::scheduler_bulk_cleanup_component { static const char *const TAG = "bulk_cleanup"; @@ -68,5 +67,4 @@ void SchedulerBulkCleanupComponent::trigger_bulk_cleanup() { } } -} // namespace scheduler_bulk_cleanup_component -} // namespace esphome +} // namespace esphome::scheduler_bulk_cleanup_component diff --git a/tests/integration/fixtures/external_components/scheduler_bulk_cleanup_component/scheduler_bulk_cleanup_component.h b/tests/integration/fixtures/external_components/scheduler_bulk_cleanup_component/scheduler_bulk_cleanup_component.h index f55472d426c..34b4a8e0d01 100644 --- a/tests/integration/fixtures/external_components/scheduler_bulk_cleanup_component/scheduler_bulk_cleanup_component.h +++ b/tests/integration/fixtures/external_components/scheduler_bulk_cleanup_component/scheduler_bulk_cleanup_component.h @@ -3,8 +3,7 @@ #include "esphome/core/component.h" #include "esphome/core/application.h" -namespace esphome { -namespace scheduler_bulk_cleanup_component { +namespace esphome::scheduler_bulk_cleanup_component { class SchedulerBulkCleanupComponent : public Component { public: @@ -14,5 +13,4 @@ class SchedulerBulkCleanupComponent : public Component { void trigger_bulk_cleanup(); }; -} // namespace scheduler_bulk_cleanup_component -} // namespace esphome +} // namespace esphome::scheduler_bulk_cleanup_component diff --git a/tests/integration/fixtures/external_components/scheduler_heap_stress_component/heap_scheduler_stress_component.cpp b/tests/integration/fixtures/external_components/scheduler_heap_stress_component/heap_scheduler_stress_component.cpp index 305d3595919..f75a2fdd920 100644 --- a/tests/integration/fixtures/external_components/scheduler_heap_stress_component/heap_scheduler_stress_component.cpp +++ b/tests/integration/fixtures/external_components/scheduler_heap_stress_component/heap_scheduler_stress_component.cpp @@ -6,8 +6,7 @@ #include #include -namespace esphome { -namespace scheduler_heap_stress_component { +namespace esphome::scheduler_heap_stress_component { static const char *const TAG = "scheduler_heap_stress"; @@ -100,5 +99,4 @@ void SchedulerHeapStressComponent::run_multi_thread_test() { ESP_LOGI(TAG, "All threads finished in %lldms. Created %d callbacks", thread_time, this->total_callbacks_.load()); } -} // namespace scheduler_heap_stress_component -} // namespace esphome +} // namespace esphome::scheduler_heap_stress_component diff --git a/tests/integration/fixtures/external_components/scheduler_heap_stress_component/heap_scheduler_stress_component.h b/tests/integration/fixtures/external_components/scheduler_heap_stress_component/heap_scheduler_stress_component.h index 5da32ca9f8a..9f7810d0adf 100644 --- a/tests/integration/fixtures/external_components/scheduler_heap_stress_component/heap_scheduler_stress_component.h +++ b/tests/integration/fixtures/external_components/scheduler_heap_stress_component/heap_scheduler_stress_component.h @@ -3,8 +3,7 @@ #include "esphome/core/component.h" #include -namespace esphome { -namespace scheduler_heap_stress_component { +namespace esphome::scheduler_heap_stress_component { class SchedulerHeapStressComponent : public Component { public: @@ -18,5 +17,4 @@ class SchedulerHeapStressComponent : public Component { std::atomic executed_callbacks_{0}; }; -} // namespace scheduler_heap_stress_component -} // namespace esphome +} // namespace esphome::scheduler_heap_stress_component diff --git a/tests/integration/fixtures/external_components/scheduler_rapid_cancellation_component/rapid_cancellation_component.cpp b/tests/integration/fixtures/external_components/scheduler_rapid_cancellation_component/rapid_cancellation_component.cpp index b735c453f2d..0e5525d2656 100644 --- a/tests/integration/fixtures/external_components/scheduler_rapid_cancellation_component/rapid_cancellation_component.cpp +++ b/tests/integration/fixtures/external_components/scheduler_rapid_cancellation_component/rapid_cancellation_component.cpp @@ -6,8 +6,7 @@ #include #include -namespace esphome { -namespace scheduler_rapid_cancellation_component { +namespace esphome::scheduler_rapid_cancellation_component { static const char *const TAG = "scheduler_rapid_cancellation"; @@ -76,5 +75,4 @@ void SchedulerRapidCancellationComponent::run_rapid_cancellation_test() { }); } -} // namespace scheduler_rapid_cancellation_component -} // namespace esphome +} // namespace esphome::scheduler_rapid_cancellation_component diff --git a/tests/integration/fixtures/external_components/scheduler_rapid_cancellation_component/rapid_cancellation_component.h b/tests/integration/fixtures/external_components/scheduler_rapid_cancellation_component/rapid_cancellation_component.h index 0a01b2a8de7..f1ef9a72b61 100644 --- a/tests/integration/fixtures/external_components/scheduler_rapid_cancellation_component/rapid_cancellation_component.h +++ b/tests/integration/fixtures/external_components/scheduler_rapid_cancellation_component/rapid_cancellation_component.h @@ -3,8 +3,7 @@ #include "esphome/core/component.h" #include -namespace esphome { -namespace scheduler_rapid_cancellation_component { +namespace esphome::scheduler_rapid_cancellation_component { class SchedulerRapidCancellationComponent : public Component { public: @@ -18,5 +17,4 @@ class SchedulerRapidCancellationComponent : public Component { std::atomic total_executed_{0}; }; -} // namespace scheduler_rapid_cancellation_component -} // namespace esphome +} // namespace esphome::scheduler_rapid_cancellation_component diff --git a/tests/integration/fixtures/external_components/scheduler_recursive_timeout_component/recursive_timeout_component.cpp b/tests/integration/fixtures/external_components/scheduler_recursive_timeout_component/recursive_timeout_component.cpp index 2a08bd72a9f..6bc03f34c0d 100644 --- a/tests/integration/fixtures/external_components/scheduler_recursive_timeout_component/recursive_timeout_component.cpp +++ b/tests/integration/fixtures/external_components/scheduler_recursive_timeout_component/recursive_timeout_component.cpp @@ -1,8 +1,7 @@ #include "recursive_timeout_component.h" #include "esphome/core/log.h" -namespace esphome { -namespace scheduler_recursive_timeout_component { +namespace esphome::scheduler_recursive_timeout_component { static const char *const TAG = "scheduler_recursive_timeout"; @@ -36,5 +35,4 @@ void SchedulerRecursiveTimeoutComponent::run_recursive_timeout_test() { }); } -} // namespace scheduler_recursive_timeout_component -} // namespace esphome +} // namespace esphome::scheduler_recursive_timeout_component diff --git a/tests/integration/fixtures/external_components/scheduler_recursive_timeout_component/recursive_timeout_component.h b/tests/integration/fixtures/external_components/scheduler_recursive_timeout_component/recursive_timeout_component.h index 8d2c085a111..237f9785b21 100644 --- a/tests/integration/fixtures/external_components/scheduler_recursive_timeout_component/recursive_timeout_component.h +++ b/tests/integration/fixtures/external_components/scheduler_recursive_timeout_component/recursive_timeout_component.h @@ -2,8 +2,7 @@ #include "esphome/core/component.h" -namespace esphome { -namespace scheduler_recursive_timeout_component { +namespace esphome::scheduler_recursive_timeout_component { class SchedulerRecursiveTimeoutComponent : public Component { public: @@ -16,5 +15,4 @@ class SchedulerRecursiveTimeoutComponent : public Component { int nested_level_{0}; }; -} // namespace scheduler_recursive_timeout_component -} // namespace esphome +} // namespace esphome::scheduler_recursive_timeout_component diff --git a/tests/integration/fixtures/external_components/scheduler_simultaneous_callbacks_component/simultaneous_callbacks_component.cpp b/tests/integration/fixtures/external_components/scheduler_simultaneous_callbacks_component/simultaneous_callbacks_component.cpp index b4c2b8c6c2d..a817b9f508f 100644 --- a/tests/integration/fixtures/external_components/scheduler_simultaneous_callbacks_component/simultaneous_callbacks_component.cpp +++ b/tests/integration/fixtures/external_components/scheduler_simultaneous_callbacks_component/simultaneous_callbacks_component.cpp @@ -5,8 +5,7 @@ #include #include -namespace esphome { -namespace scheduler_simultaneous_callbacks_component { +namespace esphome::scheduler_simultaneous_callbacks_component { static const char *const TAG = "scheduler_simultaneous_callbacks"; @@ -105,5 +104,4 @@ void SchedulerSimultaneousCallbacksComponent::run_simultaneous_callbacks_test() }); } -} // namespace scheduler_simultaneous_callbacks_component -} // namespace esphome +} // namespace esphome::scheduler_simultaneous_callbacks_component diff --git a/tests/integration/fixtures/external_components/scheduler_simultaneous_callbacks_component/simultaneous_callbacks_component.h b/tests/integration/fixtures/external_components/scheduler_simultaneous_callbacks_component/simultaneous_callbacks_component.h index 1a36af4b3de..9746331aec1 100644 --- a/tests/integration/fixtures/external_components/scheduler_simultaneous_callbacks_component/simultaneous_callbacks_component.h +++ b/tests/integration/fixtures/external_components/scheduler_simultaneous_callbacks_component/simultaneous_callbacks_component.h @@ -3,8 +3,7 @@ #include "esphome/core/component.h" #include -namespace esphome { -namespace scheduler_simultaneous_callbacks_component { +namespace esphome::scheduler_simultaneous_callbacks_component { class SchedulerSimultaneousCallbacksComponent : public Component { public: @@ -20,5 +19,4 @@ class SchedulerSimultaneousCallbacksComponent : public Component { std::atomic max_concurrent_{0}; }; -} // namespace scheduler_simultaneous_callbacks_component -} // namespace esphome +} // namespace esphome::scheduler_simultaneous_callbacks_component diff --git a/tests/integration/fixtures/external_components/scheduler_string_lifetime_component/string_lifetime_component.cpp b/tests/integration/fixtures/external_components/scheduler_string_lifetime_component/string_lifetime_component.cpp index 8c3f665f197..cc1b9f78147 100644 --- a/tests/integration/fixtures/external_components/scheduler_string_lifetime_component/string_lifetime_component.cpp +++ b/tests/integration/fixtures/external_components/scheduler_string_lifetime_component/string_lifetime_component.cpp @@ -4,8 +4,7 @@ #include #include -namespace esphome { -namespace scheduler_string_lifetime_component { +namespace esphome::scheduler_string_lifetime_component { static const char *const TAG = "scheduler_string_lifetime"; @@ -258,5 +257,4 @@ void SchedulerStringLifetimeComponent::test_lambda_capture_lifetime() { }); } -} // namespace scheduler_string_lifetime_component -} // namespace esphome +} // namespace esphome::scheduler_string_lifetime_component diff --git a/tests/integration/fixtures/external_components/scheduler_string_lifetime_component/string_lifetime_component.h b/tests/integration/fixtures/external_components/scheduler_string_lifetime_component/string_lifetime_component.h index 95532328bb8..20185f128d1 100644 --- a/tests/integration/fixtures/external_components/scheduler_string_lifetime_component/string_lifetime_component.h +++ b/tests/integration/fixtures/external_components/scheduler_string_lifetime_component/string_lifetime_component.h @@ -4,8 +4,7 @@ #include #include -namespace esphome { -namespace scheduler_string_lifetime_component { +namespace esphome::scheduler_string_lifetime_component { class SchedulerStringLifetimeComponent : public Component { public: @@ -33,5 +32,4 @@ class SchedulerStringLifetimeComponent : public Component { int tests_failed_{0}; }; -} // namespace scheduler_string_lifetime_component -} // namespace esphome +} // namespace esphome::scheduler_string_lifetime_component diff --git a/tests/integration/fixtures/external_components/scheduler_string_name_stress_component/string_name_stress_component.cpp b/tests/integration/fixtures/external_components/scheduler_string_name_stress_component/string_name_stress_component.cpp index 9071e573bbf..677d371f255 100644 --- a/tests/integration/fixtures/external_components/scheduler_string_name_stress_component/string_name_stress_component.cpp +++ b/tests/integration/fixtures/external_components/scheduler_string_name_stress_component/string_name_stress_component.cpp @@ -7,8 +7,7 @@ #include #include -namespace esphome { -namespace scheduler_string_name_stress_component { +namespace esphome::scheduler_string_name_stress_component { static const char *const TAG = "scheduler_string_name_stress"; @@ -106,5 +105,4 @@ void SchedulerStringNameStressComponent::run_string_name_stress_test() { }); } -} // namespace scheduler_string_name_stress_component -} // namespace esphome +} // namespace esphome::scheduler_string_name_stress_component diff --git a/tests/integration/fixtures/external_components/scheduler_string_name_stress_component/string_name_stress_component.h b/tests/integration/fixtures/external_components/scheduler_string_name_stress_component/string_name_stress_component.h index 002a0a7b511..121bda62041 100644 --- a/tests/integration/fixtures/external_components/scheduler_string_name_stress_component/string_name_stress_component.h +++ b/tests/integration/fixtures/external_components/scheduler_string_name_stress_component/string_name_stress_component.h @@ -3,8 +3,7 @@ #include "esphome/core/component.h" #include -namespace esphome { -namespace scheduler_string_name_stress_component { +namespace esphome::scheduler_string_name_stress_component { class SchedulerStringNameStressComponent : public Component { public: @@ -18,5 +17,4 @@ class SchedulerStringNameStressComponent : public Component { std::atomic executed_callbacks_{0}; }; -} // namespace scheduler_string_name_stress_component -} // namespace esphome +} // namespace esphome::scheduler_string_name_stress_component