Skip to content

Commit ce6b923

Browse files
committed
Build: Add target to check code formatting with clang-format
However, this requires clang 10.
1 parent 1749811 commit ce6b923

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Makefile.am

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,9 @@ include $(top_srcdir)/build/dist-changelog.am
5252
# clang-format versions via a bash alias.)
5353
format:
5454
clang-format -i `find . -name "*.h" -or -name "*.cc"`
55+
56+
# Run clang-format over all files, and fail if they are not formatted correctly.
57+
# (This requires clang-format 10, which has the --dry-run and --Werror
58+
# command-line arguments.)
59+
check-format:
60+
clang-format --dry-run --Werror `find . -name "*.h" -or -name "*.cc"`

0 commit comments

Comments
 (0)