[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang-tools-extra / docs / clang-tidy / checks / portability / restrict-system-includes.rst
blob26d4e0d3fcc54dbcbcdfa041189f2d692733f6e5
1 .. title:: clang-tidy - portability-restrict-system-includes
3 portability-restrict-system-includes
4 ====================================
6 Checks to selectively allow or disallow a configurable list of system headers.
8 For example:
10 In order to **only** allow `zlib.h` from the system you would set the options
11 to `-*,zlib.h`.
13 .. code-block:: c++
15   #include <curses.h>       // Bad: disallowed system header.
16   #include <openssl/ssl.h>  // Bad: disallowed system header.
17   #include <zlib.h>         // Good: allowed system header.
18   #include "src/myfile.h"   // Good: non-system header always allowed.
20 In order to allow everything **except** `zlib.h` from the system you would set
21 the options to `*,-zlib.h`.
23 .. code-block:: c++
25   #include <curses.h>       // Good: allowed system header.
26   #include <openssl/ssl.h>  // Good: allowed system header.
27   #include <zlib.h>         // Bad: disallowed system header.
28   #include "src/myfile.h"   // Good: non-system header always allowed.
30 Since the options support globbing you can use wildcarding to allow groups of
31 headers.
33 `-*,openssl/*.h` will allow all openssl headers but disallow any others.
35 .. code-block:: c++
37   #include <curses.h>       // Bad: disallowed system header.
38   #include <openssl/ssl.h>  // Good: allowed system header.
39   #include <openssl/rsa.h>  // Good: allowed system header.
40   #include <zlib.h>         // Bad: disallowed system header.
41   #include "src/myfile.h"   // Good: non-system header always allowed.
43 Options
44 -------
46 .. option:: Includes
48    A string containing a comma separated glob list of allowed include
49    filenames. Similar to the -checks glob list for running clang-tidy itself,
50    the two wildcard characters are `*` and `-`, to include and exclude globs,
51    respectively. The default is `*`, which allows all includes.