0

I created a cppcheck project in the GUI version and enabled the misra addon and specified the location of my misra rules text file. This works and shows me the misra rule violations.

Now, when I run cppcheck on the command line with:

cppcheck --addon=misra.json --project=test.cppcheck

This doesn't work, it gives me:

style: misra violation (use --rule-texts=<file> to get proper output) [misra-c2012-8.9]

When I look in the .cppcheck file it has the misra addon enabled but not a path to the rule file. And when running the command adding the --addon=misra.json argument does not help.

I want to use the .cppcheck file for both in the GUI and command line, so I don't have to change the command, I would just use the .cppcheck file instead.

Has anyone done this before or had any luck with it?

Any help is appreciated!

misra.json:

{
    "script": "misra.py",
    "args": [
        "--rule-texts=misracheck.txt"
    ]
}
Joe
  • 37
  • 8
  • Yes, I have it working on the command line as follows: `cppcheck --addon=./misra.json my-src-file.c` this also works: `cppcheck --addon=./misra.json src-dir` – deadParrot Jul 28 '23 at 13:26
  • Thanks that works but only if you specify a source folder. Which means I'll have to also include other options manually. I would prefer it to use the .cppcheck file that gets created when using the GUI version. – Joe Aug 01 '23 at 21:14

0 Answers0