FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
testcontainers-python/scripts/mypy_report.py at main · stackninja7/testcontainers-python · GitHub
stackninja7
/
testcontainers-python
Public
forked from
testcontainers/testcontainers-python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
testcontainers-python
/
scripts
/
mypy_report.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
35 lines (26 loc) · 984 Bytes
Breadcrumbs
testcontainers-python
/
scripts
/
mypy_report.py
Copy path
File metadata and controls
executable file
·
35 lines (26 loc) · 984 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
# Description: This script reads the output of mypy and generates a summary of errors by file.
import
re
import
sys
from
rich
.
console
import
Console
from
rich
.
table
import
Table
# Regular expression to match file path and error count
pattern
=
r"(.*\.py:\d+):\s+error: (.*)"
error_dict
=
{}
for
line
in
sys
.
stdin
:
match
=
re
.
search
(
pattern
,
line
)
if
match
:
# Extract file path and error message
file_path
,
_
=
match
.
group
(
1
).
split
(
":"
)
error_message
=
match
.
group
(
2
)
if
file_path
not
in
error_dict
:
error_dict
[
file_path
]
=
1
else
:
error_dict
[
file_path
]
+=
1
table
=
Table
(
title
=
"Error Summary"
)
table
.
add_column
(
"File Path"
)
table
.
add_column
(
"Errors"
,
justify
=
"left"
)
for
file_path
,
error_count
in
error_dict
.
items
():
table
.
add_row
(
file_path
,
str
(
error_count
))
console
=
Console
()
console
.
print
(
table
)
console
.
print
(
f"[red]Found
{
sum
(
error_dict
.
values
())
}
errors in
{
len
(
error_dict
)
}
files.[/red]"
)
Back
|
FazBrowse Home
|
New Git URL