Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
dart_pdf
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
David PHAM-VAN
2019-02-17 11:40:39 -0500
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
af108760b66076255a2d5c56fc25f20cbff84fc7
af108760
1 parent
68d2f10f
Add pana reporting summary
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
2 deletions
Makefile
pana_report.py
Makefile
View file @
af10876
...
...
@@ -54,7 +54,7 @@ publish-printing: format clean
touch .pana
analyze
:
.pana
pana --no-warning --source path pdf
pana --no-warning --source path printing
@
pana --no-warning --source path pdf 2> /dev/null | python pana_report.py
@
pana --no-warning --source path printing 2> /dev/null | python pana_report.py
.PHONY
:
test format format-dart format-clang clean publish-pdf publish-printing analyze
...
...
pana_report.py
0 → 100644
View file @
af10876
from
__future__
import
print_function
import
sys
import
json
import
re
def
parse_suggestions
(
data
):
for
item
in
data
:
print
(
' -'
,
item
[
'description'
]
.
replace
(
'
\n\n
'
,
'
\n
'
)
.
replace
(
'
\n
'
,
'
\n
'
))
def
parse_key
(
data
):
for
key
,
val
in
data
.
iteritems
():
if
val
is
False
:
continue
if
val
==
0
:
continue
if
key
==
'strongModeEnabled'
and
val
is
True
:
continue
label
=
re
.
sub
(
r"([a-z])([A-Z])"
,
r"
\
g<1>
\
g<2>"
,
key
)
.
capitalize
()
if
key
==
'suggestions'
:
print
(
' - {key}:'
.
format
(
key
=
label
))
parse_suggestions
(
val
)
continue
print
(
' - {key}: {val}'
.
format
(
key
=
label
,
val
=
val
))
def
main
():
json_data
=
sys
.
stdin
.
read
()
data
=
json
.
loads
(
json_data
)
data
[
'problems'
]
=
data
[
'health'
][
'analyzeProcessFailed'
]
or
data
[
'health'
][
'formatProcessFailed'
]
or
data
[
'health'
][
'resolveProcessFailed'
]
data
[
'healthErrors'
]
=
data
[
'health'
][
'analyzerErrorCount'
]
data
[
'healthWarnings'
]
=
data
[
'health'
][
'analyzerWarningCount'
]
data
[
'healthHint'
]
=
data
[
'health'
][
'analyzerHintCount'
]
data
[
'healthConflict'
]
=
data
[
'health'
][
'platformConflictCount'
]
print
(
'Package {packageName} version {packageVersion}'
.
format
(
**
data
))
parse_key
(
data
[
'health'
])
parse_key
(
data
[
'maintenance'
])
if
__name__
==
"__main__"
:
main
()
...
...
Please
register
or
login
to post a comment