Prevent wilcard coverage ignore if tests exist (#86455)
This commit is contained in:
parent
33fb27eb1a
commit
15ab04f97d
2 changed files with 54 additions and 15 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue