mirror of
https://github.com/esphome/esphome.git
synced 2026-05-27 11:56:11 +08:00
[ci] Update lint message to recommend constexpr over static const (#14099)
This commit is contained in:
+1
-1
@@ -301,7 +301,7 @@ def highlight(s):
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
def lint_no_defines(fname, match):
|
def lint_no_defines(fname, match):
|
||||||
s = highlight(f"static const uint8_t {match.group(1)} = {match.group(2)};")
|
s = highlight(f"static constexpr uint8_t {match.group(1)} = {match.group(2)};")
|
||||||
return (
|
return (
|
||||||
"#define macros for integer constants are not allowed, please use "
|
"#define macros for integer constants are not allowed, please use "
|
||||||
f"{s} style instead (replace uint8_t with the appropriate "
|
f"{s} style instead (replace uint8_t with the appropriate "
|
||||||
|
|||||||
Reference in New Issue
Block a user