Patchwork D1874: formatting: enforce clang-format on all .cc files as well as .c files

login
register
mail settings
Submitter phabricator
Date Jan. 17, 2018, 9:31 p.m.
Message ID <differential-rev-PHID-DREV-twzrvaq52zszxc3ahjkh-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/26825/
State Superseded
Headers show

Comments

phabricator - Jan. 17, 2018, 9:31 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  As part of my upcoming fuzzer patch we're going to grow some .cc
  files. They're not part of the release build (they're only used for
  fuzzing, which requires clang 6 which in turn implies a working C++
  compiler), so I'm not terribly worried about growing some C++ files.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  Makefile
  tests/test-check-clang-format.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-check-clang-format.t b/tests/test-check-clang-format.t
--- a/tests/test-check-clang-format.t
+++ b/tests/test-check-clang-format.t
@@ -3,7 +3,7 @@ 
   $ . "$TESTDIR/helpers-testrepo.sh"
 
   $ cd "$TESTDIR"/..
-  $ for f in `testrepohg files 'set:(**.c or **.h) and not "listfile:contrib/clang-format-blacklist"'` ; do
+  $ for f in `testrepohg files 'set:(**.c or **.cc or **.h) and not "listfile:contrib/clang-format-blacklist"'` ; do
   >   clang-format --style file $f > $f.formatted
   >   cmp $f $f.formatted || diff -u $f $f.formatted
   >   rm $f.formatted
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -124,7 +124,7 @@ 
 
 format-c:
 	clang-format --style file -i \
-	  `hg files 'set:(**.c or **.h) and not "listfile:contrib/clang-format-blacklist"'`
+	  `hg files 'set:(**.c or **.cc or **.h) and not "listfile:contrib/clang-format-blacklist"'`
 
 update-pot: i18n/hg.pot