mirror of
https://github.com/esphome/esphome.git
synced 2026-09-01 02:26:01 +00:00
Merge branch 'dev' of https://github.com/esphome/esphome into templatable-value-specialize
This commit is contained in:
+1
-1
@@ -1083,7 +1083,7 @@ def command_config(args: ArgsProtocol, config: ConfigType) -> int | None:
|
||||
# add the console decoration so the front-end can hide the secrets
|
||||
if not args.show_secrets:
|
||||
output = re.sub(
|
||||
r"(password|key|psk|ssid)\: (.+)", r"\1: \\033[5m\2\\033[6m", output
|
||||
r"(password|key|psk|ssid)\: (.+)", r"\1: \\033[8m\2\\033[28m", output
|
||||
)
|
||||
if not CORE.quiet:
|
||||
safe_print(output)
|
||||
|
||||
+2
-2
@@ -54,8 +54,8 @@ namespace esphome {
|
||||
#define ESPHOME_LOG_COLOR_CYAN "36" // DEBUG
|
||||
#define ESPHOME_LOG_COLOR_GRAY "37" // VERBOSE
|
||||
#define ESPHOME_LOG_COLOR_WHITE "38"
|
||||
#define ESPHOME_LOG_SECRET_BEGIN "\033[5m"
|
||||
#define ESPHOME_LOG_SECRET_END "\033[6m"
|
||||
#define ESPHOME_LOG_SECRET_BEGIN "\033[8m"
|
||||
#define ESPHOME_LOG_SECRET_END "\033[28m"
|
||||
#define LOG_SECRET(x) ESPHOME_LOG_SECRET_BEGIN x ESPHOME_LOG_SECRET_END
|
||||
|
||||
#define ESPHOME_LOG_COLOR(COLOR) "\033[0;" COLOR "m"
|
||||
|
||||
@@ -1006,6 +1006,38 @@ def lint_log_in_header(fname, line, col, content):
|
||||
)
|
||||
|
||||
|
||||
PACKAGE_BUS_RE = re.compile(
|
||||
r"^\s+(\w+):\s*!include\s+\S*test_build_components/common/(\w+)/",
|
||||
re.MULTILINE,
|
||||
)
|
||||
|
||||
|
||||
@lint_content_check(include=["tests/components/*/test.*.yaml"])
|
||||
def lint_test_package_key_matches_bus(fname, content):
|
||||
"""Ensure package keys match the common bus directory name.
|
||||
|
||||
For example, a package using uart_115200 includes must use
|
||||
'uart_115200' as the key, not 'uart'.
|
||||
"""
|
||||
errs: list[tuple[int, int, str]] = []
|
||||
for match in PACKAGE_BUS_RE.finditer(content):
|
||||
pkg_key = match.group(1)
|
||||
bus_dir = match.group(2)
|
||||
if pkg_key != bus_dir:
|
||||
lineno = content.count("\n", 0, match.start()) + 1
|
||||
errs.append(
|
||||
(
|
||||
lineno,
|
||||
1,
|
||||
f"Package key {highlight(pkg_key)} does not match bus directory "
|
||||
f"{highlight(bus_dir)}. The package key must match the directory "
|
||||
f"name under tests/test_build_components/common/. "
|
||||
f"Change {highlight(pkg_key)} to {highlight(bus_dir)}.",
|
||||
)
|
||||
)
|
||||
return errs
|
||||
|
||||
|
||||
@lint_content_find_check(
|
||||
"FINAL_VALIDATE_SCHEMA",
|
||||
include=["esphome/core/*.py"],
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
packages:
|
||||
uart: !include ../../test_build_components/common/uart_115200/esp32-idf.yaml
|
||||
uart_115200: !include ../../test_build_components/common/uart_115200/esp32-idf.yaml
|
||||
|
||||
<<: !include common.yaml
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
packages:
|
||||
uart: !include ../../test_build_components/common/uart_115200/esp8266-ard.yaml
|
||||
uart_115200: !include ../../test_build_components/common/uart_115200/esp8266-ard.yaml
|
||||
|
||||
<<: !include common.yaml
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
packages:
|
||||
uart: !include ../../test_build_components/common/uart_115200/rp2040-ard.yaml
|
||||
uart_115200: !include ../../test_build_components/common/uart_115200/rp2040-ard.yaml
|
||||
|
||||
<<: !include common.yaml
|
||||
|
||||
Reference in New Issue
Block a user