Hi,
I was testing the CPPcheck GUI. I was able to get the Misra test add-on running. next step is to create a misra-rules.txt file. I did have a look at some samples from https://github.com/danmar/cppcheck/tree/main/addons/test/misra. But creating a simple text file results in an error while starting the test. The error looks like Failed to load/setup misra: ... Cppcheck/addons/misra.py. failed. 'args' must be na array.
The misra-rules.txt looks like:
Appendix A Summary of guidelines
Rule 1.1 Required
Text of rule 1.1
Rule 1.2 Required
Text of rule 1.2
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello Daniel, i have had the same error for a few releases now
What i did:
- Install CPPCheck
- Edit -> Preferences -> Addons and under Misra Addon i simply selected the rule file
That's it. Python 3.11.2 is installed
When adding:
<addons>
<addon>.../Documents/code/MISRA/misra.json</addon>
</addons>
to the project file, it will work (until the project is updated.., then the lines are removed.)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There should be a ticket in trac that says it should be able to configure addons properly in the GUI. There is no plan for the fix right now but I think it shouldn't be too long..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I was testing the CPPcheck GUI. I was able to get the Misra test add-on running. next step is to create a misra-rules.txt file. I did have a look at some samples from https://github.com/danmar/cppcheck/tree/main/addons/test/misra. But creating a simple text file results in an error while starting the test. The error looks like Failed to load/setup misra: ... Cppcheck/addons/misra.py. failed. 'args' must be na array.
The misra-rules.txt looks like:
Appendix A Summary of guidelines
Rule 1.1 Required
Text of rule 1.1
Rule 1.2 Required
Text of rule 1.2
The error message says that args should be an array did you try that?
you can show the json file here.
Hello Daniel, i have had the same error for a few releases now
What i did:
- Install CPPCheck
- Edit -> Preferences -> Addons and under Misra Addon i simply selected the rule file
That's it. Python 3.11.2 is installed
Thanks! I have created this ticket: https://trac.cppcheck.net/ticket/13014
When adding:
<addons>
<addon>.../Documents/code/MISRA/misra.json</addon>
</addons>
to the project file, it will work (until the project is updated.., then the lines are removed.)
There should be a ticket in trac that says it should be able to configure addons properly in the GUI. There is no plan for the fix right now but I think it shouldn't be too long..