D1874: formatting: enforce clang-format on all .cc files as well as .c files
durin42 (Augie Fackler)
phabricator at mercurial-scm.org
Wed Jan 17 21:31:18 UTC 2018
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
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
To: durin42, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list