如图:
下载好之后在设置中追加加入以下代码:
//cppcheck配置
"cpp-check-lint.cppcheck.--executable": "C:\Program Files\Cppcheck\cppcheck.exe", //cppcheck路径
"cpp-check-lint.cpplint.--enable": false, //关闭无用的cpplint
"cpp-check-lint.cppcheck.--language=": "c", //使用c语言进行检查
"cpp-check-lint.cppcheck.--inline-suppr": false, //取消内联
"cpp-check-lint.cppcheck.--onsave": true, //在文件保存时立刻检查该文件
"cpp-check-lint.cppcheck.--enable=": "style", //输出信息等级,可选为all, warning, style, performance, portability, information, unusedFunction, missingInclide
// "cpp-check-lint.cppcheck.--addon=": [ //暂时不开启插件
// "misra.py"
// ],
2 插件使用例子
1 生成dump文件
cppcheck.exe --template={file}:{line}:{column}: {severity}: CWE-{cwe} {message}:[{id}] --enable=style -j4 --max-ctu-depth=2 --platform=native --std=c89 --std=c++03 --report-progress --suppress=unmatchedSuppression --suppress=missingIncludeSystem --dump ./src/thread_rs485_readmeter_entry.c
2 使用misra 2012进行检查
python3 /mnt/c/Program Files/Cppcheck/addons/misra.py --rule-texts=/mnt/f/OneDrive/Tools/cppcheck/misra_rules_dummy.txt ./src/thread_rs485_readmeter_entry.c.dump



