From fac2e752f60187482e5dafd2e59f6bd267616d94 Mon Sep 17 00:00:00 2001
From: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
Date: Fri, 16 Jun 2017 23:33:24 +0900
Subject: [PATCH] Add `make clang-format`

---
 Makefile.am | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index dfeac5ce..9c9fd6c1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,3 +23,11 @@
 SUBDIRS = lib tests
 
 ACLOCAL_AMFLAGS = -I m4
+
+# 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/ngtcp2/*.h
-- 
GitLab