-
Notifications
You must be signed in to change notification settings - Fork 183
Expand file tree
/
Copy path.clang-tidy
More file actions
68 lines (63 loc) · 2.46 KB
/
.clang-tidy
File metadata and controls
68 lines (63 loc) · 2.46 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
# .clang-tidy — C11 static analysis configuration (BLOCKING).
#
# ALL checks enabled. WarningsAsErrors: '*'.
# Check thresholds configured for idiomatic C11 (not C++).
#
# Disabled checks (with reasoning):
#
# C++ idiom checks (not applicable to C11):
# - bugprone-multi-level-implicit-pointer-conversion: void* is implicit in C
# - readability-implicit-bool-conversion: if(ptr), if(count) is idiomatic C
#
# LLVM analyzer false positives (no fix available):
# - DeprecatedOrUnsafeBufferHandling: flags fprintf/snprintf, Annex K not
# available on Linux/macOS (LLVM #64027)
# - ArrayBound: taint analysis false positives on buf[fread_result] (LLVM #126884)
#
# Cosmetic checks whitelisted (no memory safety or performance impact):
# - bugprone-easily-swappable-parameters: internal APIs with descriptive
# param names; struct wrappers would add churn without safety benefit
# - concurrency-mt-unsafe: only readdir() remains, which is safe with
# per-directory-handle usage (each thread owns its DIR*)
# - bugprone-command-processor: popen() required for git integration;
# all inputs are validated internal strings, no injection risk
Checks: >
-*,
bugprone-*,
cert-*,
concurrency-*,
darwin-*,
linuxkernel-*,
misc-*,
performance-*,
portability-*,
readability-*,
clang-analyzer-*,
-bugprone-multi-level-implicit-pointer-conversion,
-readability-implicit-bool-conversion,
-bugprone-easily-swappable-parameters,
-concurrency-mt-unsafe,
-bugprone-command-processor,
-cert-env33-c,
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
-clang-analyzer-security.ArrayBound,
WarningsAsErrors: '*'
CheckOptions:
readability-identifier-length.MinimumVariableNameLength: 1
readability-identifier-length.MinimumParameterNameLength: 1
readability-identifier-length.MinimumLoopCounterNameLength: 1
readability-magic-numbers.IgnoredIntegerValues: ""
readability-magic-numbers.IgnoredFloatingPointValues: ""
bugprone-easily-swappable-parameters.MinimumLength: 3
misc-include-cleaner.IgnoreHeaders: "sys/.*|mach/.*|dispatch/.*|_types/.*|Availability\\.h|secure/.*|_.*\\.h|zconf\\.h"
readability-function-cognitive-complexity.Threshold: 25
readability-function-size.StatementThreshold: 200
readability-function-size.LineThreshold: 400
HeaderFilterRegex: '^(src|tests)/.*\.h$'
ExtraArgs:
- '-std=c11'
- '-Isrc'
- '-Ivendored'
- '-Ivendored/sqlite3'
- '-Iinternal/cbm'
- '-Iinternal/cbm/vendored/ts_runtime/include'