mirror of
https://github.com/esphome/esphome.git
synced 2026-09-30 16:30:22 +00:00
[ci] Add lint check to prevent powf in core and base entity platforms
Add a ci-custom.py check that prevents powf() from being introduced into esphome/core/ and base entity platform components (sensor, light, climate, etc.). These files are linked into every build, and powf pulls in __ieee754_powf (~2.3KB flash). Existing legitimate uses of powf with non-integer exponents (gamma correction in helpers.cpp) are excluded. New uses can opt out with // NOLINT if truly necessary.
This commit is contained in:
@@ -714,7 +714,7 @@ float gamma_correct(float value, float gamma) {
|
||||
if (gamma <= 0.0f)
|
||||
return value;
|
||||
|
||||
return powf(value, gamma);
|
||||
return powf(value, gamma); // NOLINT - deprecated, removal 2026.9.0
|
||||
}
|
||||
float gamma_uncorrect(float value, float gamma) {
|
||||
if (value <= 0.0f)
|
||||
@@ -722,7 +722,7 @@ float gamma_uncorrect(float value, float gamma) {
|
||||
if (gamma <= 0.0f)
|
||||
return value;
|
||||
|
||||
return powf(value, 1 / gamma);
|
||||
return powf(value, 1 / gamma); // NOLINT - deprecated, removal 2026.9.0
|
||||
}
|
||||
|
||||
void rgb_to_hsv(float red, float green, float blue, int &hue, float &saturation, float &value) {
|
||||
|
||||
Reference in New Issue
Block a user