Patchwork D1116: Makefile: add target to apply clang-format in-place

login
register
mail settings
Submitter phabricator
Date Oct. 16, 2017, 3:53 p.m.
Message ID <differential-rev-PHID-DREV-dkzlseg5643gdotrrcod-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/25003/
State Superseded
Headers show

Comments

phabricator - Oct. 16, 2017, 3:53 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This makes it easy to reformat files after you finish editing them.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1116

AFFECTED FILES
  Makefile

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -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