mirror of
https://github.com/home-assistant/core.git
synced 2025-10-16 07:09:27 +00:00
Prevent wilcard coverage ignore if tests exist (#86455)
This commit is contained in:
@@ -50,7 +50,6 @@ ALLOWED_IGNORE_VIOLATIONS = {
|
||||
("sonos", "diagnostics.py"),
|
||||
("stookalert", "diagnostics.py"),
|
||||
("stookwijzer", "diagnostics.py"),
|
||||
("stream", "diagnostics.py"),
|
||||
("synology_dsm", "diagnostics.py"),
|
||||
("system_bridge", "media_source.py"),
|
||||
("tractive", "diagnostics.py"),
|
||||
@@ -108,6 +107,15 @@ def validate(integrations: dict[str, Integration], config: Config) -> None:
|
||||
|
||||
integration = integrations[integration_path.name]
|
||||
|
||||
if (
|
||||
path.parts[-1] == "*"
|
||||
and Path(f"tests/components/{integration.domain}/__init__.py").exists()
|
||||
):
|
||||
integration.add_error(
|
||||
"coverage",
|
||||
"has tests and should not use wildcard in .coveragerc file",
|
||||
)
|
||||
|
||||
for check in DONT_IGNORE:
|
||||
if path.parts[-1] not in {"*", check}:
|
||||
continue
|
||||
|
Reference in New Issue
Block a user