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