Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
HomeAssistant
Core
Commits
8bc47c0c
Unverified
Commit
8bc47c0c
authored
4 years ago
by
Paulus Schoutsen
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Catch it when files are ignored by coverage but shouldn't (#41876)
parent
62343f87
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.pre-commit-config.yaml
+2
-2
2 additions, 2 deletions
.pre-commit-config.yaml
script/hassfest/coverage.py
+90
-3
90 additions, 3 deletions
script/hassfest/coverage.py
with
92 additions
and
5 deletions
.pre-commit-config.yaml
+
2
−
2
View file @
8bc47c0c
...
...
@@ -87,5 +87,5 @@ repos:
entry
:
script/run-in-env.sh python3 -m script.hassfest
pass_filenames
:
false
language
:
script
types
:
[
json
]
files
:
^homeassistant/.+/(manifest|strings)\.json$
types
:
[
text
]
files
:
^
(
homeassistant/.+/(manifest|strings)\.json
|\.coveragerc)
$
This diff is collapsed.
Click to expand it.
script/hassfest/coverage.py
+
90
−
3
View file @
8bc47c0c
...
...
@@ -4,6 +4,70 @@ from typing import Dict
from
.model
import
Config
,
Integration
DONT_IGNORE
=
(
"
config_flow.py
"
,
"
device_action.py
"
,
"
device_condition.py
"
,
"
device_trigger.py
"
,
"
group.py
"
,
"
intent.py
"
,
"
logbook.py
"
,
"
media_source.py
"
,
"
scene.py
"
,
)
# They were violating when we introduced this check
# Need to be fixed in a future PR.
ALLOWED_IGNORE_VIOLATIONS
=
{
(
"
ambient_station
"
,
"
config_flow.py
"
),
(
"
cast
"
,
"
config_flow.py
"
),
(
"
daikin
"
,
"
config_flow.py
"
),
(
"
doorbird
"
,
"
config_flow.py
"
),
(
"
doorbird
"
,
"
logbook.py
"
),
(
"
elkm1
"
,
"
config_flow.py
"
),
(
"
elkm1
"
,
"
scene.py
"
),
(
"
fibaro
"
,
"
scene.py
"
),
(
"
flume
"
,
"
config_flow.py
"
),
(
"
hangouts
"
,
"
config_flow.py
"
),
(
"
harmony
"
,
"
config_flow.py
"
),
(
"
hisense_aehw4a1
"
,
"
config_flow.py
"
),
(
"
home_connect
"
,
"
config_flow.py
"
),
(
"
huawei_lte
"
,
"
config_flow.py
"
),
(
"
ifttt
"
,
"
config_flow.py
"
),
(
"
ios
"
,
"
config_flow.py
"
),
(
"
iqvia
"
,
"
config_flow.py
"
),
(
"
knx
"
,
"
scene.py
"
),
(
"
konnected
"
,
"
config_flow.py
"
),
(
"
lcn
"
,
"
scene.py
"
),
(
"
life360
"
,
"
config_flow.py
"
),
(
"
lifx
"
,
"
config_flow.py
"
),
(
"
lutron
"
,
"
scene.py
"
),
(
"
mobile_app
"
,
"
config_flow.py
"
),
(
"
nest
"
,
"
config_flow.py
"
),
(
"
plaato
"
,
"
config_flow.py
"
),
(
"
point
"
,
"
config_flow.py
"
),
(
"
rachio
"
,
"
config_flow.py
"
),
(
"
sense
"
,
"
config_flow.py
"
),
(
"
sms
"
,
"
config_flow.py
"
),
(
"
solarlog
"
,
"
config_flow.py
"
),
(
"
somfy
"
,
"
config_flow.py
"
),
(
"
sonos
"
,
"
config_flow.py
"
),
(
"
speedtestdotnet
"
,
"
config_flow.py
"
),
(
"
spider
"
,
"
config_flow.py
"
),
(
"
starline
"
,
"
config_flow.py
"
),
(
"
tado
"
,
"
config_flow.py
"
),
(
"
tahoma
"
,
"
scene.py
"
),
(
"
totalconnect
"
,
"
config_flow.py
"
),
(
"
tradfri
"
,
"
config_flow.py
"
),
(
"
tuya
"
,
"
config_flow.py
"
),
(
"
tuya
"
,
"
scene.py
"
),
(
"
upnp
"
,
"
config_flow.py
"
),
(
"
velux
"
,
"
scene.py
"
),
(
"
wemo
"
,
"
config_flow.py
"
),
(
"
wiffi
"
,
"
config_flow.py
"
),
(
"
wink
"
,
"
scene.py
"
),
}
def
validate
(
integrations
:
Dict
[
str
,
Integration
],
config
:
Config
):
"""
Validate coverage.
"""
...
...
@@ -31,11 +95,34 @@ def validate(integrations: Dict[str, Integration], config: Config):
path
=
Path
(
line
)
# Discard wildcard
while
"
*
"
in
path
.
name
:
path
=
path
.
parent
path_exists
=
path
while
"
*
"
in
path_exists
.
name
:
path_exists
=
path_exists
.
parent
if
not
path
.
exists
():
if
not
path
_exists
.
exists
():
not_found
.
append
(
line
)
continue
if
(
not
line
.
startswith
(
"
homeassistant/components/
"
)
or
not
len
(
path
.
parts
)
==
4
or
not
path
.
parts
[
-
1
]
==
"
*
"
):
continue
integration_path
=
path
.
parent
integration
=
integrations
[
integration_path
.
name
]
for
check
in
DONT_IGNORE
:
if
(
integration_path
.
name
,
check
)
in
ALLOWED_IGNORE_VIOLATIONS
:
continue
if
(
integration_path
/
check
).
exists
():
integration
.
add_error
(
"
coverage
"
,
f
"
{
check
}
must not be ignored by the .coveragerc file
"
,
)
if
not
not_found
:
return
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment