Patchwork D1133: test-clang-format: new test to verify that files stay clang-formatted

login
register
mail settings
Submitter phabricator
Date Oct. 17, 2017, 9:32 p.m.
Message ID <1f9a203f452485afe8de94e777c9f8e8@localhost.localdomain>
Download mbox | patch
Permalink /patch/25145/
State Not Applicable
Headers show

Comments

phabricator - Oct. 17, 2017, 9:32 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG2e8477059d4f: test-clang-format: new test to verify that files stay clang-formatted (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1133?vs=2916&id=2948

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

AFFECTED FILES
  contrib/clang-format-blacklist
  tests/test-check-clang-format.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-check-clang-format.t b/tests/test-check-clang-format.t
new file mode 100644
--- /dev/null
+++ b/tests/test-check-clang-format.t
@@ -0,0 +1,10 @@ 
+#require clang-format test-repo
+
+  $ . "$TESTDIR/helpers-testrepo.sh"
+
+  $ cd "$TESTDIR"/..
+  $ for f in `testrepohg files 'set:(**.c 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
+  > done
diff --git a/contrib/clang-format-blacklist b/contrib/clang-format-blacklist
new file mode 100644
--- /dev/null
+++ b/contrib/clang-format-blacklist
@@ -0,0 +1,70 @@ 
+# Files that just need to be migrated to the formatter.
+# Do not add new files here!
+contrib/chg/chg.c
+contrib/chg/hgclient.c
+contrib/chg/hgclient.h
+contrib/chg/procutil.c
+contrib/chg/procutil.h
+contrib/chg/util.c
+contrib/chg/util.h
+contrib/hgsh/hgsh.c
+mercurial/cext/base85.c
+mercurial/cext/bdiff.c
+mercurial/cext/charencode.c
+mercurial/cext/charencode.h
+mercurial/cext/diffhelpers.c
+mercurial/cext/dirs.c
+mercurial/cext/manifest.c
+mercurial/cext/mpatch.c
+mercurial/cext/osutil.c
+mercurial/cext/parsers.c
+mercurial/cext/pathencode.c
+mercurial/cext/revlog.c
+# Vendored code that we should never format:
+contrib/python-zstandard/c-ext/bufferutil.c
+contrib/python-zstandard/c-ext/compressiondict.c
+contrib/python-zstandard/c-ext/compressionparams.c
+contrib/python-zstandard/c-ext/compressionwriter.c
+contrib/python-zstandard/c-ext/compressobj.c
+contrib/python-zstandard/c-ext/compressor.c
+contrib/python-zstandard/c-ext/compressoriterator.c
+contrib/python-zstandard/c-ext/constants.c
+contrib/python-zstandard/c-ext/decompressionwriter.c
+contrib/python-zstandard/c-ext/decompressobj.c
+contrib/python-zstandard/c-ext/decompressor.c
+contrib/python-zstandard/c-ext/decompressoriterator.c
+contrib/python-zstandard/c-ext/frameparams.c
+contrib/python-zstandard/c-ext/python-zstandard.h
+contrib/python-zstandard/zstd.c
+contrib/python-zstandard/zstd/common/bitstream.h
+contrib/python-zstandard/zstd/common/entropy_common.c
+contrib/python-zstandard/zstd/common/error_private.c
+contrib/python-zstandard/zstd/common/error_private.h
+contrib/python-zstandard/zstd/common/fse.h
+contrib/python-zstandard/zstd/common/fse_decompress.c
+contrib/python-zstandard/zstd/common/huf.h
+contrib/python-zstandard/zstd/common/mem.h
+contrib/python-zstandard/zstd/common/pool.c
+contrib/python-zstandard/zstd/common/pool.h
+contrib/python-zstandard/zstd/common/threading.c
+contrib/python-zstandard/zstd/common/threading.h
+contrib/python-zstandard/zstd/common/xxhash.c
+contrib/python-zstandard/zstd/common/xxhash.h
+contrib/python-zstandard/zstd/common/zstd_common.c
+contrib/python-zstandard/zstd/common/zstd_errors.h
+contrib/python-zstandard/zstd/common/zstd_internal.h
+contrib/python-zstandard/zstd/compress/fse_compress.c
+contrib/python-zstandard/zstd/compress/huf_compress.c
+contrib/python-zstandard/zstd/compress/zstd_compress.c
+contrib/python-zstandard/zstd/compress/zstd_opt.h
+contrib/python-zstandard/zstd/compress/zstdmt_compress.c
+contrib/python-zstandard/zstd/compress/zstdmt_compress.h
+contrib/python-zstandard/zstd/decompress/huf_decompress.c
+contrib/python-zstandard/zstd/decompress/zstd_decompress.c
+contrib/python-zstandard/zstd/dictBuilder/cover.c
+contrib/python-zstandard/zstd/dictBuilder/divsufsort.c
+contrib/python-zstandard/zstd/dictBuilder/divsufsort.h
+contrib/python-zstandard/zstd/dictBuilder/zdict.c
+contrib/python-zstandard/zstd/dictBuilder/zdict.h
+contrib/python-zstandard/zstd/zstd.h
+hgext/fsmonitor/pywatchman/bser.c