Skip to content

Commit

Permalink
[ament_cppcheck] Report errors from additional includes (#216)
Browse files Browse the repository at this point in the history
* [ament_cppcheck] Report errors from additional includes

Before, if an error was found in an additional include we get a KeyError exception.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Use defaultdict

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
  • Loading branch information
jacobperron authored Mar 4, 2020
1 parent 418476e commit 49ab00d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ament_cppcheck/ament_cppcheck/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ def main(argv=sys.argv[1:]):
return 1

# output errors
report = {}
report = defaultdict(list)
# even though we use a defaultdict, explicity add known files so they are listed
for filename in files:
report[filename] = []
for error in root.find('errors'):
Expand Down

0 comments on commit 49ab00d

Please sign in to comment.