Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Adam Blank
vscode-config
Commits
72dcbc51
Commit
72dcbc51
authored
3 months ago
by
Adam Blank
Browse files
Options
Download
Email Patches
Plain Diff
Update codequality.py
parent
6a84b518
master
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
codequality.py
+15
-4
codequality.py
with
15 additions
and
4 deletions
+15
-4
codequality.py
View file @
72dcbc51
...
@@ -486,7 +486,7 @@ def check_style() -> str | None:
...
@@ -486,7 +486,7 @@ def check_style() -> str | None:
elif
type
(
desc
)
==
type
(
tt
):
elif
type
(
desc
)
==
type
(
tt
):
if
not
match_ast
(
tt
,
desc
,
contents
):
if
not
match_ast
(
tt
,
desc
,
contents
):
continue
continue
print
(
colored
(
"* "
+
msg
,
"red"
)
+
" in "
+
colored
(
print
(
colored
(
msg
,
"red"
)
+
" in "
+
colored
(
# type: ignore
# type: ignore
filename
+
":"
+
str
(
desc
.
lineno
),
"yellow"
),
file
=
log
)
# type: ignore
filename
+
":"
+
str
(
desc
.
lineno
),
"yellow"
),
file
=
log
)
# type: ignore
...
@@ -500,10 +500,21 @@ def check_style() -> str | None:
...
@@ -500,10 +500,21 @@ def check_style() -> str | None:
# print('in ' + ff + ",", 'the variable "' + loc + '"', 'has type', ty)
# print('in ' + ff + ",", 'the variable "' + loc + '"', 'has type', ty)
pass
pass
val
=
log
.
getvalue
()
return
log
.
getvalue
()
return
(
colored
(
"FAILED"
,
"red"
)
+
": code quality
\n
"
+
val
)
if
val
else
None
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
if
not
os
.
path
.
exists
(
'tests'
):
print
()
print
()
print
(
'
\x1b
[1m
\x1b
[31mCould not find the tests directory. :(
\x1b
[0m'
)
print
()
exit
(
1
)
result
=
check_style
()
result
=
check_style
()
print
(
json
.
dumps
({
'success'
:
result
is
None
,
'output'
:
result
}))
if
'--json'
in
sys
.
argv
:
print
(
json
.
dumps
(
{
'success'
:
not
result
,
'output'
:
result
.
strip
().
split
(
os
.
linesep
)
if
result
else
""
}))
print
(
result
.
strip
()
if
result
else
""
,
file
=
sys
.
stderr
)
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help