summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMurray Cumming <murraycu@google.com>2019-10-28 12:19:20 +0100
committerMurray Cumming <murrayc@murrayc.com>2021-01-24 11:05:36 +0100
commitc7d9a270a56ab1f48ddeba7406b0b7c8450e06af (patch)
treea883978199471f123d1ca15c7af31dea613b0eee
parentc658a66c318c1f6702cb45abaebb4a64eeaba8cd (diff)
downloadsigc++-c7d9a270a56ab1f48ddeba7406b0b7c8450e06af.tar.gz
Build: Add target to check code formatting with clang-format
However, this requires clang 10.
-rw-r--r--Makefile.am6
1 files changed, 6 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 0b7b78b..b619dbd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -67,3 +67,9 @@ include $(top_srcdir)/build/dist-changelog.am
# clang-format versions via a bash alias.)
format:
clang-format -i `find . -name "*.h" -or -name "*.cc"`
+
+# Run clang-format over all files, and fail if they are not formatted correctly.
+# (This requires clang-format 10, which has the --dry-run and --Werror
+# command-line arguments.)
+check-format:
+ clang-format --dry-run --Werror `find . -name "*.h" -or -name "*.cc"`