Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude gold and platinum integrations from .coveragerc #117563

Merged
merged 4 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,6 @@ omit =
homeassistant/components/lookin/sensor.py
homeassistant/components/loqed/sensor.py
homeassistant/components/luci/device_tracker.py
homeassistant/components/luftdaten/sensor.py
frenck marked this conversation as resolved.
Show resolved Hide resolved
homeassistant/components/lupusec/__init__.py
homeassistant/components/lupusec/alarm_control_panel.py
homeassistant/components/lupusec/binary_sensor.py
Expand Down
10 changes: 10 additions & 0 deletions script/hassfest/coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"recorder.py",
"scene.py",
)
FORCE_COVERAGE = ("gold", "platinum")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we add internal to the list, we have:

  • browser
  • downloader
  • folder_watcher
  • kitchen_sink
  • otp
  • ping
  • recorder
  • stream
  • time_date
  • zeroconf


CORE_PREFIX = """# Sorted by hassfest.
#
Expand Down Expand Up @@ -105,13 +106,22 @@ 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():
integration.add_error(
"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}:
Expand Down