QiuminGe / cpp-check-lint

MIT License
12 stars 6 forks source link

How to enable cppcheck addons? #28

Closed ptskyin closed 3 years ago

ptskyin commented 3 years ago

I'm trying to use the MISRA addon in cppcheck. The corresponding cppcheck command is: cppcheck --addon=misra .\test.c How can I enable it in cpp-check-lint?

QiuminGe commented 3 years ago

try v1.4.3 CppCheck:--addon=["misra"]

support cppcheck --addon=cert --addon=y2038 src/test.c

unsupport cppcheck --dump --quiet src/test.c python cert.py src/test.c.dump python misra.py --rule-texts=~/misra_rules.txt src/test.c.dump

ptskyin commented 3 years ago

Thanks, QiuminGe! The MISRA warning now shows. One more question: Possible to support the following method to use _misra_rules.txt_? I tried this way, but seems not working. image

QiuminGe commented 3 years ago

I updated read me in v1.4.4 Can it solve your problem? image

QiuminGe commented 3 years ago

"args": [ "--rule-texts=misra.txt" ] Do you know how to use relative paths?

ptskyin commented 3 years ago

Great thanks! The misra descriptions show now.

I'm not sure about relative paths. But, it seems from the Cppcheck manual that the idea is to create a json file with "--script" and "--args", then probably you can use the relative path of the json file in the "--addon" argument when calling cppcheck.