addon/misra.py: fix problem with summary
This commit is contained in:
parent
e0da316759
commit
7f19a9a255
|
@ -2016,7 +2016,7 @@ class MisraChecker:
|
||||||
|
|
||||||
if not severity in self.violations:
|
if not severity in self.violations:
|
||||||
self.violations[severity] = []
|
self.violations[severity] = []
|
||||||
self.violations[severity].append(errorId)
|
self.violations[severity].append('misra-' + errorId)
|
||||||
|
|
||||||
def loadRuleTexts(self, filename):
|
def loadRuleTexts(self, filename):
|
||||||
num1 = 0
|
num1 = 0
|
||||||
|
@ -2316,8 +2316,11 @@ else:
|
||||||
convert = lambda text: int(text) if text.isdigit() else text
|
convert = lambda text: int(text) if text.isdigit() else text
|
||||||
misra_sort = lambda key: [ convert(c) for c in re.split('[\.-]([0-9]*)', key) ]
|
misra_sort = lambda key: [ convert(c) for c in re.split('[\.-]([0-9]*)', key) ]
|
||||||
for misra_id in sorted(rules_violated.keys(), key=misra_sort):
|
for misra_id in sorted(rules_violated.keys(), key=misra_sort):
|
||||||
num = misra_id[len("misra-c2012-"):]
|
res = re.match(r'misra-c2012-([0-9]+)\\.([0-9]+)', misra_id)
|
||||||
num = int(num[:num.index(".")]) * 100 + int(num[num.index(".")+1:])
|
if res is None:
|
||||||
|
num = 0
|
||||||
|
else:
|
||||||
|
num = int(res.group(1)) * 100 + int(res.group(2))
|
||||||
severity = '-'
|
severity = '-'
|
||||||
if num in checker.ruleTexts:
|
if num in checker.ruleTexts:
|
||||||
severity = checker.ruleTexts[num].severity
|
severity = checker.ruleTexts[num].severity
|
||||||
|
|
Loading…
Reference in New Issue