我的项目结构相当复杂。看起来是这样的:
App/
Inc/
Src/
OtherDir/
ManyOtherDirsInc/
ManyOtherDirsSrc/
OtherDirs/ThatAre/Inside/OtherDirs/Inc
build/
我正在使用CMake和额外的compile_commands.json来构建它。
为了运行CppCheck,我使用了运行以下(大量)命令的VsCode任务:
cppcheck --addon=${workspaceFolder}/misra.json
--cppcheck-build-dir=${workspaceFolder}/build
-D__GNUC__ --enable=warning,style,performance,portability,information
--suppress=missingIncludeSystem --suppress=unmatchedSuppression
--project=${workspaceFolder}/build/compile_commands.json
-i${workspaceFolder}/ParentFolderOfManyOtherDirs/WithOtherDirsInside
-i${workspaceFolder}/OtherDirs/ThatAlsoShouldBeRecursivelyIgnored
--quiet --template=gcc --verbose
这是否意味着-i不是递归的?这可能很奇怪,因为当添加文件夹时,它们是递归添加的。
我会非常感谢你的帮助。
发布于 2021-10-30 11:31:24
问题是,尽管有.h标志,但仍然选中了-i文件。解决方案:
--supress-lists=suppressions.txt
suppressions.txt
*:/home/Projects/Full/Path/*
重要注意事项!
抑制中的路径必须是满的,亲戚由于某种原因不能工作。对于一个包含多个开发人员的项目来说,这是个问题。需要一些自动生成此文件的脚本。
https://stackoverflow.com/questions/69774751
复制相似问题