From 2118805b929a47887f2ded218c95a5a274e36aa0 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Mon, 14 Aug 2017 14:30:46 -0700 Subject: Makefile: add style build rule Add the 'style' build rule which will run git-clang-format on the diff between HEAD and the current worktree. The result is a diff of suggested changes. Signed-off-by: Brandon Williams Signed-off-by: Junio C Hamano --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 461c845d3..8e5b2df99 100644 --- a/Makefile +++ b/Makefile @@ -2440,6 +2440,10 @@ $(SP_OBJ): %.sp: %.c GIT-CFLAGS FORCE .PHONY: sparse $(SP_OBJ) sparse: $(SP_OBJ) +.PHONY: style +style: + git clang-format --style file --diff --extensions c,h + check: common-cmds.h @if sparse; \ then \ -- cgit v1.2.1