Version 1.88 changed the parsing of the MISRA rules file adding a
severity setting. This caused a regression in rule parsing.
In particular the following format used to parse cleanly and produce
rule output that would show the severity as part of the rule text.
Rule 1.2
Advisory
Rule text goes here.
Rule 1.3
Required
More rule text goes here.
As of 1.88 a file structured like above would parse as having no rules.
The problem is the use of blank lines as a rule delimiter. The
modified rule parser wants to see a rules formatted like below:
Rule 3.1 Required
R3.1 text.
Rule 4.1 Required
R4.1 text.
or:
Rule 1.1
Add this rule and parse to next, skipping empty lines.
Rule 1.2
Rule text.
Any rule text that did not fall into one of the above formats would
result in incomplete rule text parsing.
Change the parsing of the rule text file so that blank lines are ignored
instead of treating them as a delimiter between rules. Instead use the
start of the next rule as a delimiter for the end of the previous rule.
This allows both of the newer formats but also supports the behavior of
pre-1.88 versions.
Change units tests that were specifically forbidding the use of blank
lines to ones that allow blank lines.
* Update addons structure. Make Y2038 addon works.
All addons are now located in same directory, where cppcheck-gui is
looking for them.
Y2038 addon has been updated to latest cppcheck version. Output is same
as 303622f01c commit as it described in
README: 303622f01c/addons/y2038/README.
* Clean up .travis.yml
* Update travis.yml paths.
* misra.py: Bring back -P argument for backward compatibility
* Fix paths
* Normalize dumpfile paths tpo cppcheck format
* Fixup 3 test.
* Add arguments regression test.
* Fixing travis build
* MISRA: Fix suppressed rules line numbers
Line numbers represented as strings in lxml ETree, but we use it in
integer comparison later.
* MISRA: Use standard library function instead file_prefix.
* MISRA: Use pytest's capsys for capturing, add suppressions tests.
* travis.yml: Update pytest version
* misra.py: Fixup load rules parser.
* misra.py: Report when rule text is missing in rule-texts file
* misra.py: Allow to skip misra checks not specified in rule-texts.
* misra.py: Remove top-level control flow.
Create separate class that stores settings, instead of global variables.
This is required to perform imports from misra.py for testing purposes.
* misra.py: Add simple pytest test for load rules.
* misra.py: Add document structure tests.
* misra.py: Exit after show rules table.
* misra.py: Add document structure tests.
* misra.py: Fixup import pitfall with python2
* misra.py: Minor fixes