Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
ECSS Services
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AcubeSat-OBC
ECSS Services
Commits
f6091610
Commit
f6091610
authored
6 years ago
by
Grigoris Pavlakis
Committed by
kongr45gpen
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Attempt to fix the script not running in gitlab runners
parent
157d3be2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ci/summarizer.py
+13
-12
13 additions, 12 deletions
ci/summarizer.py
with
13 additions
and
12 deletions
ci/summarizer.py
+
13
−
12
View file @
f6091610
...
@@ -8,17 +8,18 @@ from collections import Counter
...
@@ -8,17 +8,18 @@ from collections import Counter
Naive parser and pretty printer for the MISRA reports by cppcheck
Naive parser and pretty printer for the MISRA reports by cppcheck
"""
"""
red
=
"
\033
[91m
"
yellow
=
"
\033
[93m
"
green
=
"
\033
[92m
"
bold
=
"
\033
[1m
"
end
=
"
\033
[0m
"
class
Summarizer
(
object
):
class
Summarizer
(
object
):
def
__init__
(
self
,
report_name
):
def
__init__
(
self
,
report_name
):
with
open
(
report_name
,
'
r
'
)
as
f
:
with
open
(
report_name
,
'
r
'
)
as
f
:
self
.
file_lines
=
f
.
readlines
()
self
.
file_lines
=
f
.
readlines
()
f
.
close
()
f
.
close
()
self
.
red
=
"
\033
[91m
"
self
.
yellow
=
"
\033
[93m
"
self
.
green
=
"
\033
[92m
"
self
.
bold
=
"
\033
[1m
"
self
.
end
=
"
\033
[0m
"
def
analyze
(
self
):
def
analyze
(
self
):
"""
"""
...
@@ -55,19 +56,19 @@ class Summarizer(object):
...
@@ -55,19 +56,19 @@ class Summarizer(object):
Pretty-prints the contents of the error dictionary with colors and stuff
Pretty-prints the contents of the error dictionary with colors and stuff
"""
"""
print
(
bold
+
red
+
"
=================================================
\n
"
+
end
)
print
(
self
.
bold
+
self
.
red
+
"
=================================================
\n
"
+
self
.
end
)
print
(
bold
+
red
+
"
Static analysis results: Error Summary
\n
"
+
end
)
print
(
self
.
bold
+
self
.
red
+
"
Static analysis results: Error Summary
\n
"
+
self
.
end
)
for
key
in
errors
:
for
key
in
errors
:
for
error
in
errors
[
key
]:
for
error
in
errors
[
key
]:
name_string
=
f
"
{
bold
}{
red
}
File
{
yellow
}{
key
}{
red
}
"
name_string
=
f
"
{
self
.
bold
}{
self
.
red
}
File
{
self
.
yellow
}{
key
}{
self
.
red
}
"
rule_violated_string
=
f
"
violates rule
{
yellow
}
#
{
error
[
1
]
}{
red
}
of the MISRA C 2012 standard
"
rule_violated_string
=
f
"
violates rule
{
self
.
yellow
}
#
{
error
[
1
]
}{
self
.
red
}
of the MISRA C 2012 standard
"
line_number_string
=
f
"
at line
{
yellow
}{
error
[
0
]
}{
end
}
"
line_number_string
=
f
"
at line
{
self
.
yellow
}{
error
[
0
]
}{
self
.
end
}
"
print
(
f
"
{
name_string
.
ljust
(
75
)
}
{
rule_violated_string
}
{
line_number_string
}
"
)
print
(
f
"
{
name_string
.
ljust
(
75
)
}
{
rule_violated_string
}
{
line_number_string
}
"
)
print
(
""
)
print
(
""
)
print
(
""
)
print
(
""
)
print
(
bold
+
red
+
"
=================================================
"
+
end
)
print
(
self
.
bold
+
self
.
red
+
"
=================================================
"
+
self
.
end
)
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
...
...
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