Menu

Misra rules file not accepted

2024-07-03
2024-08-14
  • Bob van der Putten

    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

     
  • Rohan Majumdar

    Rohan Majumdar - 2024-07-10

     
    • Daniel Marjamäki

      The error message says that args should be an array did you try that?

       
  • Daniel Marjamäki

    you can show the json file here.

     
  • Jack Monegato

    Jack Monegato - 2024-07-16

    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

     
    • Daniel Marjamäki

      Thanks! I have created this ticket: https://trac.cppcheck.net/ticket/13014

       
  • Bob van der Putten

    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.)

     
    • Daniel Marjamäki

      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..

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.