Avoid non-const globals and enable clang-tidy check (#1892)

This commit is contained in:
Stefan Agner
2021-06-10 22:19:44 +02:00
committed by GitHub
parent 360effcb72
commit 501f88ca86
376 changed files with 466 additions and 468 deletions
+2 -2
View File
@@ -5,9 +5,9 @@
namespace esphome {
namespace status_led {
static const char *TAG = "status_led";
static const char *const TAG = "status_led";
StatusLED *global_status_led = nullptr;
StatusLED *global_status_led = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
StatusLED::StatusLED(GPIOPin *pin) : pin_(pin) { global_status_led = this; }
void StatusLED::pre_setup() {
+1 -1
View File
@@ -20,7 +20,7 @@ class StatusLED : public Component {
GPIOPin *pin_;
};
extern StatusLED *global_status_led;
extern StatusLED *global_status_led; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
} // namespace status_led
} // namespace esphome