diff --git a/.coveragerc b/.coveragerc index 94d445cf8c8..d5dc2f755ef 100644 --- a/.coveragerc +++ b/.coveragerc @@ -729,7 +729,6 @@ omit = homeassistant/components/lookin/sensor.py homeassistant/components/loqed/sensor.py homeassistant/components/luci/device_tracker.py - homeassistant/components/luftdaten/sensor.py homeassistant/components/lupusec/__init__.py homeassistant/components/lupusec/alarm_control_panel.py homeassistant/components/lupusec/binary_sensor.py diff --git a/script/hassfest/coverage.py b/script/hassfest/coverage.py index 1d4f99deb47..388f2a1c761 100644 --- a/script/hassfest/coverage.py +++ b/script/hassfest/coverage.py @@ -19,6 +19,7 @@ DONT_IGNORE = ( "recorder.py", "scene.py", ) +FORCE_COVERAGE = ("gold", "platinum") CORE_PREFIX = """# Sorted by hassfest. # @@ -105,6 +106,14 @@ def validate(integrations: dict[str, Integration], config: Config) -> None: integration = integrations[integration_path.name] + if integration.quality_scale in FORCE_COVERAGE: + integration.add_error( + "coverage", + f"has quality scale {integration.quality_scale} and " + "should not be present in .coveragerc file", + ) + continue + if (last_part := path.parts[-1]) in {"*", "const.py"} and Path( f"tests/components/{integration.domain}/__init__.py" ).exists(): @@ -112,6 +121,7 @@ def validate(integrations: dict[str, Integration], config: Config) -> None: "coverage", f"has tests and should not use {last_part} in .coveragerc file", ) + continue for check in DONT_IGNORE: if path.parts[-1] not in {"*", check}: