ZaStoGram_desktop/tools/clangtidy
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-14 18:03:15 +03:00
..
compile_db.py Added clang-tidy ban of qMin, qMax, qAbs and qBound. 2026-09-14 16:22:17 +03:00
README.md Added tests of house rules hook. 2026-09-14 18:03:15 +03:00

clang-tidy for tdesktop

python3 tools/clangtidy/compile_db.py               # after each configure
git diff -U0 HEAD | clang-tidy-diff.py -p1 -path out/clang-tidy -j 10 -quiet
run-clang-tidy -p out/clang-tidy -j 10 -quiet <files>

Both runners ship with LLVM, under share/clang. Needs clang-tidy 20 or newer: an older one ignores CustomFunctions without a word.

The commit hook, once per clone, submodules included; its tests run with python3 tools/rules/test_hook.py:

for repo in . $(git config -f .gitmodules --get-regexp path \
        | awk '{print $2}' | grep -v ThirdParty); do
    hooks=$(git -C "$repo" rev-parse --git-path hooks)/pre-commit
    printf '#!/bin/sh\nexec python3 %s/tools/rules/hook.py --staged\n' \
        "$PWD" > "$hooks" && chmod +x "$hooks"
done