misra.py: Fixup rules severity#1911
Conversation
| class Rule(object): | ||
| """Class to keep rule text and metadata""" | ||
|
|
||
| SEVERITY_MAP = {'Required': 'warning', 'Mandatory': 'error', 'Advisory': 'style', 'style': 'style'} |
There was a problem hiding this comment.
hmm.. this was not your idea, but this does not seem right to me. The severity should explain what type of issue is seen. Here, another definition is used.
I think it's better we always say 'style' for misra addon output. I did not want to put many (or all) of these checks in Cppcheck because they are too stylistic.
danmar
left a comment
There was a problem hiding this comment.
sorry but I think you were mislead by the old code. I'd like to see a cleanup.
Yes, that makes sense. I print severity levels like this: I also show counters in summary using MISRA severity levels: |
|
hmm.. I think we need to tweak the GUI and maybe some other stuff also. The "rule text" column should not say "(Required)". If the output is saved in xml format I would also like that it is not saved in the warning message but kept separately. I signed a legal document where I am saying we will not modify the misra rule texts and well I want to ensure nobody will complain later. I think we need some generic infrastructure so addons can provide some optional extra attribute in output. I don't want to hardcode some specific handling for misra in Cppcheck. |
|
maybe we can change the |
|
@danmar, hm, really, it looks strange in GUI. JSON, like any other intermediate representation, seems like a good idea. We could define set of formatting functions to generate human-readable reports for command line tools as good as save internal data in file and use it in GUI client, for example. Right now I don't see a way to integrate additional addon-specific fields in existing UI. We need to separate addons output from cppcheck output. Do you have any suggestions? |
|
I changed to JSON with c97dc79 There will be an "extra" attribute. Maybe we can use some other better name. For now the CLI will not use that attribute but maybe that is fine for now. I guess the GUI needs to handle this somehow also. Could you update the misra addon so it outputs the "extra" attribute. |
* misra.py: Fixup rules severity * Divide cppcheck and MISRA severity.
No description provided.