Files
Martin Vogel 3908624fad Fix remaining lint: cppcheck variableScope, dead code, const correctness
- platform.c: move nlen into if(env) block (variableScope)
- userconfig.c: move home into else block (variableScope)
- pipeline.c: remove dead rc!=0 check after httplinks removal
- cli.c: rmdir_recursive propagates cbm_rmdir errors, remove redundant local
- clang-tidy: whitelist cosmetic-only checks, enable all safety checks
- Thread-safe getenv via environ iteration (concurrency-mt-unsafe fix)
- Multiple files: add constants.h includes for named constants
2026-04-02 12:46:39 +02:00

69 lines
2.5 KiB
YAML

# .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'