Debian Codegraph @

.clang-tidy

raw
1 # SPDX-License-Identifier: LGPL-2.1-or-later
2 ---
3 Checks: '
4 -*,
5 bugprone-argument-comment,
6 bugprone-chained-comparison,
7 bugprone-integer-division,
8 bugprone-misplaced-operator-in-strlen-in-alloc,
9 bugprone-misplaced-pointer-arithmetic-in-alloc,
10 bugprone-posix-return,
11 bugprone-redundant-branch-condition,
12 bugprone-sizeof-expression,
13 bugprone-suspicious-enum-usage,
14 bugprone-suspicious-semicolon,
15 bugprone-suspicious-string-compare,
16 bugprone-swapped-arguments,
17 bugprone-tautological-type-limits,
18 bugprone-unsafe-functions,
19 bugprone-unused-return-value,
20 misc-header-include-cycle,
21 misc-include-cleaner,
22 misc-misplaced-const,
23 misc-use-internal-linkage,
24 readability-avoid-const-params-in-decls,
25 readability-const-return-type,
26 readability-duplicate-include,
27 readability-inconsistent-declaration-parameter-name,
28 readability-misleading-indentation,
29 readability-named-parameter,
30 readability-redundant-casting,
31 readability-redundant-declaration,
32 readability-redundant-function-ptr-dereference
33 '
34 CheckOptions:
35 misc-include-cleaner.MissingIncludes: 'false'
36 # These all lead to common false positives by clang-tidy where it tries to
37 # remove these includes even though they're required in some situations (many
38 # of them related to musl).
39 misc-include-cleaner.IgnoreHeaders: '
40 endian\.h;
41 sys/stat\.h;
42 sys/statvfs\.h;
43 sys/syscall\.h;
44 sys/timex\.h;
45 sys/uio\.h;
46 netinet/in\.h;
47 net/if\.h;
48 net/if_arp\.h;
49 runtime-scope\.h;
50 varlink-io\.systemd\..*;
51 varlink-idl-common\.h;
52 unistd\.h
53 '
54 bugprone-unsafe-functions.ReportDefaultFunctions: false
55 bugprone-unsafe-functions.CustomFunctions: '
56 ^fgets$,read_line(),is potentially dangerous;
57 ^strtok$,extract_first_word(),is potentially dangerous;
58 ^strsep$,extract_first_word(),is potentially dangerous;
59 ^dup$,fcntl() with F_DUPFD_CLOEXEC,is potentially dangerous;
60 ^htonl$,htobe32(),is confusing;
61 ^htons$,htobe16(),is confusing;
62 ^ntohl$,be32toh(),is confusing;
63 ^ntohs$,be16toh(),is confusing;
64 ^strerror$,STRERROR() or printf %m,is not thread-safe;
65 ^accept$,accept4(),is not O_CLOEXEC-safe;
66 ^dirname$,path_extract_directory(),is icky;
67 ^basename$,path_extract_filename(),is icky;
68 ^setmntent$,libmount_parse_fstab(),libmount parser should be used instead;
69 ^getmntent$,mnt_table_next_fs(),libmount parser should be used instead
70 '
71 misc-header-include-cycle.IgnoredFilesList: 'glib-2.0'
72 RemovedArgs: ['-fwide-exec-charset=UCS2', '-maccumulate-outgoing-args']
73 WarningsAsErrors: '*'
74 ExcludeHeaderFilterRegex: 'blkid\.h|gmessages\.h|gstring\.h'
75 HeaderFileExtensions:
76 - h
77 ImplementationFileExtensions:
78 - c
79 ...