FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-kasa/devtools/check_readme_vs_fixtures.py at intint · IDavinciCode/python-kasa · GitHub
IDavinciCode
python-kasa
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-kasa
/
devtools
/
check_readme_vs_fixtures.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
43 lines (35 loc) · 866 Bytes
Breadcrumbs
python-kasa
/
devtools
/
check_readme_vs_fixtures.py
Copy path
File metadata and controls
43 lines (35 loc) · 866 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""Script that checks if README.md is missing devices that have fixtures."""
import
re
import
sys
from
kasa
.
tests
.
conftest
import
(
ALL_DEVICES
,
BULBS
,
DIMMERS
,
LIGHT_STRIPS
,
PLUGS
,
STRIPS
,
)
with
open
(
"README.md"
)
as
f
:
readme
=
f
.
read
()
typemap
=
{
"light strips"
:
LIGHT_STRIPS
,
"bulbs"
:
BULBS
,
"plugs"
:
PLUGS
,
"strips"
:
STRIPS
,
"dimmers"
:
DIMMERS
,
}
def
_get_device_type
(
dev
,
typemap
):
for
typename
,
devs
in
typemap
.
items
():
if
dev
in
devs
:
return
typename
else
:
return
"Unknown type"
found_unlisted
=
False
for
dev
in
ALL_DEVICES
:
regex
=
rf"^\*.*\s
{
dev
}
"
match
=
re
.
search
(
regex
,
readme
,
re
.
MULTILINE
)
if
match
is
None
:
print
(
f"
{
dev
}
not listed in
{
_get_device_type
(
dev
,
typemap
)
}
"
)
found_unlisted
=
True
if
found_unlisted
:
sys
.
exit
(
-
1
)
Back
|
FazBrowse Home
|
New Git URL