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
3bb4d1d9
Commit
3bb4d1d9
authored
6 years ago
by
Grigoris Pavlakis
Committed by
kongr45gpen
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove an unnecessary statement
Test commit for Python version
parent
f6091610
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ci/cppcheck-misra.sh
+1
-0
1 addition, 0 deletions
ci/cppcheck-misra.sh
ci/summarizer.py
+12
-14
12 additions, 14 deletions
ci/summarizer.py
with
13 additions
and
14 deletions
ci/cppcheck-misra.sh
+
1
−
0
View file @
3bb4d1d9
...
@@ -26,4 +26,5 @@ sed -i -r 's/(.*Script.*)|(.*Checking.*)|(.*MISRA.*)//gm; /(^$)/d; s/(\s\(.*\)\s
...
@@ -26,4 +26,5 @@ sed -i -r 's/(.*Script.*)|(.*Checking.*)|(.*MISRA.*)//gm; /(^$)/d; s/(\s\(.*\)\s
# run the summarizer for a nice, clean summary of errors
# run the summarizer for a nice, clean summary of errors
echo
-e
"
\u
001b[34;1mSummarizing results...
\u
001b[0m"
echo
-e
"
\u
001b[34;1mSummarizing results...
\u
001b[0m"
python3
--version
python3 ci/summarizer.py ci/report.msr
python3 ci/summarizer.py ci/report.msr
This diff is collapsed.
Click to expand it.
ci/summarizer.py
+
12
−
14
View file @
3bb4d1d9
#!/bin/env python3
#!/bin/env python3
from
sys
import
argv
from
sys
import
argv
from
sys
import
exit
from
collections
import
Counter
from
collections
import
Counter
"""
"""
...
@@ -33,22 +32,21 @@ class Summarizer(object):
...
@@ -33,22 +32,21 @@ class Summarizer(object):
if
len
(
self
.
file_lines
)
==
0
:
if
len
(
self
.
file_lines
)
==
0
:
print
(
bold
+
green
+
"
Static analysis for MISRA compliance complete. No errors found.
"
+
end
)
print
(
bold
+
green
+
"
Static analysis for MISRA compliance complete. No errors found.
"
+
end
)
return
0
return
0
else
:
for
line
in
self
.
file_lines
:
# remove duplicate lines
for
line
in
self
.
file_lines
:
# remove duplicate lines
if
line
not
in
lines_seen
:
if
line
not
in
lines_seen
:
lines_seen
.
add
(
line
)
lines_seen
.
add
(
line
)
line_contents
=
line
.
split
(
'
:
'
)
line_contents
=
line
.
split
(
'
:
'
)
file_name
=
line_contents
[
0
]
# first part is the filename (index 0)
file_name
=
line_contents
[
0
]
# first part is the filename (index 0)
error
=
(
line_contents
[
1
],
line_contents
[
2
].
strip
(
'
\n
'
))
# index 1 is the line number, index 2 is the number of violated rule
error
=
(
line_contents
[
1
],
line_contents
[
2
].
strip
(
'
\n
'
))
# index 1 is the line number, index 2 is the number of violated rule
if
file_name
not
in
errors_map
.
keys
():
if
file_name
not
in
errors_map
.
keys
():
errors_map
[
file_name
]
=
list
()
# create a new list for the new filename and append the tuple in it
errors_map
[
file_name
]
=
list
()
# create a new list for the new filename and append the tuple in it
errors_map
[
file_name
].
append
(
error
)
errors_map
[
file_name
].
append
(
error
)
else
:
else
:
errors_map
[
file_name
].
append
(
error
)
# do not append if it already exists
errors_map
[
file_name
].
append
(
error
)
# do not append if it already exists
return
errors_map
# return the completed error dictionary
return
errors_map
# return the completed error dictionary
def
pretty_print
(
self
,
errors
):
def
pretty_print
(
self
,
errors
):
...
...
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