Skip to content

Commit 8d747d7

Browse files
committed
Build: Add target to format code with clang-format
This lets us do "make format" to reformat the code.
1 parent 94f2fe5 commit 8d747d7

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
@@ -46,3 +46,9 @@ DISTCLEANFILES = MSVC_NMake/sigc++config.h
4646

4747
# Optional: auto-generate the ChangeLog file from the git log on make dist
4848
include $(top_srcdir)/build/dist-changelog.am
49+
50+
# Run clang-format over all the files, to reformat them.
51+
# (We don't use xargs here because that wouldn't let us specify different
52+
# clang-format versions via a bash alias.)
53+
format:
54+
clang-format -i `find . -name "*.h" -or -name "*.cc"`

0 commit comments

Comments
 (0)