changeset 34859:2bf152128d59

makefile: add target to apply clang-format in-place This makes it easy to reformat files after you finish editing them. Differential Revision: https://phab.mercurial-scm.org/D1167
author Augie Fackler <augie@google.com>
date Mon, 14 Sep 2015 14:52:20 -0400
parents 85a2db47ad50
children d0912876d7a7
files Makefile
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Mon Oct 16 17:41:27 2017 +0200
+++ b/Makefile	Mon Sep 14 14:52:20 2015 -0400
@@ -122,6 +122,10 @@
 check-code:
 	hg manifest | xargs python contrib/check-code.py
 
+format-c:
+	clang-format --style file -i \
+	  `hg files 'set:(**.c or **.h) and not "listfile:contrib/clang-format-blacklist"'`
+
 update-pot: i18n/hg.pot
 
 i18n/hg.pot: $(PYFILES) $(DOCFILES) i18n/posplit i18n/hggettext