Files
Yyunozor d899bf44f7 fix(hooks): scope pre-commit clang-tidy to staged changes (#1264)
make -j3 -f Makefile.cbm lint runs the full lint-tidy sweep, which
currently surfaces ~5,100 pre-existing clang-tidy findings across 113
files. Since the pre-commit hook (scripts/hooks/pre-commit) runs that
target unconditionally, it blocks every commit for every contributor
who has clang-tidy on PATH, regardless of what the commit touches.

Add lint-tidy-diff (scripts/lint-tidy-diff.sh), which runs the same
clang-tidy binary/config but passes clang-tidy's own -line-filter so
only lines the commit actually added or modified can produce a
diagnostic. Pre-existing findings on untouched lines are not reported,
whether they are in an untouched file or on an untouched line of a
file the commit does touch. The hook now runs lint-ci (unchanged:
cppcheck + clang-format + no-suppress) plus lint-tidy-diff instead of
the full lint target; make lint / make lint-tidy / scripts/lint.sh are
unchanged and remain the full-tree audit.

Signed-off-by: Yyunozor <yyunozor@icloud.com>
2026-07-31 18:29:22 +02:00
..