Cppcheck GUI: Excluding a file or folder from checking
Asked Answered
M

3

10

I am using Cppcheck GUI to scan my projects (new in Cppcheck, just starded to use it) and want to exclude some sub folders when I am scanning my project.

How to exclude some sub folder when scanning project folder with cppcheck GUI?

I have watched some videos on YouTube and tried to exclude as shown in this video but it still scanning excluded sub folders.

Thanks in advance.

Murrain answered 20/6, 2015 at 13:5 Comment(1)
It's even possible to do so in the project fileManhandle
B
6

Excluding a file or folder from checking To exclude a file or folder, there are two options. The first option is to only provide the paths and files you want to check.

cppcheck src/a src/b

All files under src/a and src/b are then checked. The second option is to use -i, with it you specify files/paths to ignore. With this command no files in src/c are checked:

cppcheck -isrc/c src

ref : http://cppcheck.sourceforge.net/manual.pdf

Bonneau answered 25/10, 2016 at 5:22 Comment(0)
M
5

As of version 1.80, the manual still misses to describe the structure of GUI project files (chapter 12). The GUI itself has a lot of flaws, so I consider editing the project file through the GUI a waste of time. On the other hand, having these project files (under version control) and editing them by hand proved to be useful.

Here is the structure of a minimal project:

<?xml version="1.0" encoding="UTF-8"?>
<project version="1"/>

With such a file, Cppcheck is run on all potential C/C++ source files in the directory the cppcheck project file resides in (recursively including subfolders). You may exclude files or paths like this:

<?xml version="1.0" encoding="UTF-8"?>
<project version="1">
    <exclude>
        <path name="utilities/fileToExclude.c"/>
        <path name="utilities/pathToExclude/"/>
    </exclude>
</project>

Note: If you have the project already open in the GUI and edited its project file, remember to re-open the project file, only re-running all checks will not force a refresh of the project settings.

Manhandle answered 4/9, 2017 at 8:57 Comment(1)
There is some documentation in a textfile in the source repository.Dnieper
L
3

As of cppcheck-gui 1.88, the option to add excluded paths is found on the "Warning Options" tab:

screen grab of warning options tab

Lithopone answered 26/8, 2019 at 17:3 Comment(1)
Where is that window dialog ??Novotny

© 2022 - 2024 — McMap. All rights reserved.