From 2c830a4698fce7e40d6ad9018cc838427061ec9c Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 27 Nov 2014 23:06:32 +0900 Subject: [PATCH] Add make clang-format --- Makefile.am | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Makefile.am b/Makefile.am index 5657382e..10dd98c3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -28,3 +28,15 @@ dist_doc_DATA = README.rst EXTRA_DIST = nghttpx.conf.sample proxy.pac.sample android-config android-make \ Dockerfile.android + +.PONY: clang-format + +# Format source files using clang-format. Don't format source files +# under third-party directory since we are not responsible for thier +# coding style. +clang-format: + CLANGFORMAT=`git config --get clangformat.binary`; \ + test -z $${CLANGFORMAT} && CLANGFORMAT="clang-format"; \ + $${CLANGFORMAT} -i lib/*.{c,h} lib/includes/nghttp2/*.h \ + src/*.{c,cc,h} src/includes/nghttp2/*.h examples/*.{c,cc} \ + tests/*.{c,h}