File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree File renamed without changes.
Original file line number Diff line number Diff line change @@ -5,6 +5,21 @@ set -o pipefail
55
66# https://clang.llvm.org/extra/clang-tidy/
77
8+ : '
9+
10+ Runs clang-tidy on the code in src/
11+
12+ Return `1` if there are files automatically fixed by clang-tidy.
13+
14+ Returns `0` if no fixes by clang-tidy.
15+
16+ TODO: should also return non-zero if clang-tidy emits warnings
17+ or errors about things it cannot automatically fix. However I cannot
18+ figure out how to get this working yet as it seems that clang-tidy
19+ always returns 0 even on errors.
20+
21+ '
22+
823# to speed up re-runs, only re-create environment if needed
924if [[ ! -f local.env ]]; then
1025 # automatically setup environment
4358cd build
4459${PATH_TO_CLANG_TIDY_SCRIPT} -fix
4560
61+ # Print list of modified files
62+ dirty=$( git ls-files --modified src/)
63+
64+ if [[ $dirty ]]; then
65+ echo " The following files have been modified:"
66+ echo $dirty
67+ git diff
68+ exit 1
69+ else
70+ exit 0
71+ fi
72+
You can’t perform that action at this time.
0 commit comments