Settings: Don't Check Files
You may specify file masks to exclude some of the files or folders from analysis on the tab "Don't Check Files". The analyzer will not check those files that meet the masks' conditions.
Using this technique, you may, for instance, exclude autogenerated files from the analysis. Besides, you may define the files to be excluded from analysis by the name of the folder they are located in.
A mask is defined with the help of wildcard match types: the "*" character (expands to any number of arbitrary characters) and the "?" character (expands to a single arbitrary character).
The case of a character is irrelevant. The "*" character could be inserted in any part of the mask. After masks of the '*\mask\*' type were specified, the messages from files corresponding to these masks will disappear from PVS-Studio Output window, and the next time the analysis is started these files will be excluded from it. Thereby the total time of the entire project's analysis could be substantially decreased by excluding files and directories with these masks.
Note: masks of the 'a*b' type are applied only after restarting the analysis.
2 types of masks could be specified: the Path masks and the File name masks. The masks specified from within the FileNameMasks list are used to filter messages by the names of the corresponding files only and ignoring these files' location. The masks from the PathMasks list, on the other hand, are used to filter messages by taking into account their location within the filesystem on the disk and could be used to suppress diagnostics either from the single file or even from the whole directories and subdirectories. To filter the messages from one specific file, the full path to it should be added to the PathMasks list, but to filter files sharing the same name (or with the names complying to the wildcard mask), such names or masks should be inserted into the FileNameMask list.
Valid masks examples for the FileNameMask property:
- *ex.c — all files with the names ending with "ex" characters and "c" extension will be excluded;
- *.cpp — all files possessing the "cpp" extension will be excluded;
- stdafx.cpp — every file possessing such name will be excluded from analysis regardless of its location within the filesystem.
- *.?pp - all files with the 'pp' extension will be excluded.
Valid masks examples for the PathMasks property:
- c:\Libs\ — all files located in this directory and its subdirectories will be excluded;
- \Libs\ or *\Libs\* — all files located in the directories with path containing the Libs subdirectory will be excluded;
- Libs or *Libs* — the files possessing within their paths the subdirectory with the 'Libs' chars in its name will be excluded. Also the files with names containing the 'libs' characters will be excluded as well, for example 'c:\project\mylibs.cpp.' To avoid confusion we advise you always to specify folders with slash separators;
- c:\proj\includes.cpp — a single file located in the c:\proj\ folder with the specified name will be excluded from the analysis.
Note. If the "*" characters are not indicated in the PathMasks, they still will be added automatically.