Skip to content

Commit c7d9a27

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

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
@@ -67,3 +67,9 @@ include $(top_srcdir)/build/dist-changelog.am
6767
# clang-format versions via a bash alias.)
6868
format:
6969
clang-format -i `find . -name "*.h" -or -name "*.cc"`
70+
71+
# Run clang-format over all files, and fail if they are not formatted correctly.
72+
# (This requires clang-format 10, which has the --dry-run and --Werror
73+
# command-line arguments.)
74+
check-format:
75+
clang-format --dry-run --Werror `find . -name "*.h" -or -name "*.cc"`

0 commit comments

Comments
 (0)