From 2e21d5a021aebef871f0d7551cd05fc9832ece17 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 3 Jan 2020 21:12:20 +0200 Subject: [PATCH] add new `format` make target --- Makefile.am | 6 ++++++ _clang-format | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 _clang-format diff --git a/Makefile.am b/Makefile.am index 8ca940a..8a48730 100644 --- a/Makefile.am +++ b/Makefile.am @@ -77,6 +77,7 @@ noinst_HEADERS = strophepp.h pkgconfig_DATA = libstrophe.pc EXTRA_DIST = \ + _clang-format \ Doxyfile \ GPL-LICENSE.txt \ LICENSE.txt \ @@ -203,3 +204,8 @@ tests_test_stanza_SOURCES = tests/test_stanza.c tests_test_stanza_CFLAGS = $(STROPHE_FLAGS) tests_test_stanza_LDADD = $(STROPHE_LIBS) tests_test_stanza_LDFLAGS = -static + +format: + @echo " * run clang-format on all sources" + @dos2unix -q src/*.[ch] *.h tests/*.[ch] examples/*.c + @clang-format -i src/*.[ch] *.h tests/*.[ch] examples/*.c diff --git a/_clang-format b/_clang-format new file mode 100644 index 0000000..c80ab6c --- /dev/null +++ b/_clang-format @@ -0,0 +1,17 @@ +--- +AlignConsecutiveAssignments: 'false' +AlignEscapedNewlines: Left +AllowShortBlocksOnASingleLine: 'true' +AllowShortFunctionsOnASingleLine: Empty +AllowShortIfStatementsOnASingleLine: 'false' +BinPackParameters: 'false' +BreakBeforeBraces: Linux +ColumnLimit: '80' +DerivePointerAlignment: 'false' +IndentWidth: '4' +PointerAlignment: Right +SortIncludes: 'false' +TabWidth: '4' +UseTab: Never + +...