Skip to content

Commit 79bdf05

Browse files
committed
rephrazing
1 parent 98011b5 commit 79bdf05

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

cli/cmdlineparser.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,8 +1837,11 @@ void CmdLineParser::printHelp(bool premium) const
18371837
" this is not needed.\n"
18381838
" --include=<file>\n"
18391839
" Force inclusion of a file before the checked file.\n"
1840-
" -i <str> Skip translation units whose *source filename* matches\n"
1841-
" <str>. <str> can be a filename or directory.\n"
1840+
" -i <str> Ignore files that match <str>. <str> can be a filename\n"
1841+
" or directory and can contain *,**,?. A file that is\n"
1842+
" ignored will not be checked directly (the whole\n"
1843+
" translation unit is skipped completely). Header files\n"
1844+
" are checked indirectly when they are #include'd.\n"
18421845
" Note: If you want to prevent warnings in some headers,\n"
18431846
" use suppressions instead.\n"
18441847
" --inconclusive Allow that Cppcheck reports even though the analysis is\n"

man/manual.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,13 @@ Typically a `compile_commands.json` contains absolute paths. However no matter i
126126
* a file with relative path `src/test2.c` can be checked.
127127
* a file with relative path `src/test3.cpp` is not checked.
128128

129-
### Ignore/skip files matching a given pattern
129+
### Ignore files matching a given pattern
130130

131-
With `-i <str>` you can configure filename/directory patterns that should be ignored/skipped.
131+
With `-i <str>` you can configure filename/directory patterns that should be ignored.
132132

133-
> *Note*: If you want to filter out warnings for a header file then `-i` will not work. The option `--suppress` should be used instead. Any header included in a source file which is not ignored would be processed regardless the `-i` option applied to that header.
133+
A file that is ignored will not be checked directly (the complete translation unit is skipped). Any header #include'd from a source file which is not ignored is checked indirectly, regardless if the header is ignored.
134134

135-
Translation units are skipped if their *source filename* matches the exclusion pattern. This filtering happens *before* preprocessing, and the exclusion patterns are not applied during preprocessing or analysis.
135+
> *Note*: If you want to filter out warnings for a header file then `-i` will not work. Use suppressions instead.
136136
137137
You can use `**`, `*` and `?` in the pattern to specify excluded folders/files.
138138
`**`: matches zero or more characters, including path separators

0 commit comments

Comments
 (0)