Patchwork D7619: fix: convert clang-format-ignorelist to use wildcards

login
register
mail settings
Submitter phabricator
Date Dec. 12, 2019, 10:42 p.m.
Message ID <differential-rev-PHID-DREV-wtlbvnwnnquq3warorbv-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43760/
State Superseded
Headers show

Comments

phabricator - Dec. 12, 2019, 10:42 p.m.
spectral created this revision.
Herald added subscribers: mercurial-devel, mjpieters.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  It's very brittle to specify the exact filenames for these vendored/thirdparty
  libraries; when there's an upgrade, it's likely not going to be updated.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  contrib/clang-format-ignorelist

CHANGE DETAILS




To: spectral, #hg-reviewers
Cc: mjpieters, mercurial-devel
phabricator - Dec. 20, 2019, 12:25 p.m.
pulkit added inline comments.

INLINE COMMENTS

> clang-format-ignorelist:6
>  # Vendored code that we should never format:
> -contrib/python-zstandard/c-ext/bufferutil.c
> -contrib/python-zstandard/c-ext/compressionchunker.c
> -contrib/python-zstandard/c-ext/compressiondict.c
> -contrib/python-zstandard/c-ext/compressionparams.c
> -contrib/python-zstandard/c-ext/compressionreader.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/decompressionreader.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/compiler.h
> -contrib/python-zstandard/zstd/common/cpu.h
> -contrib/python-zstandard/zstd/common/debug.c
> -contrib/python-zstandard/zstd/common/debug.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_decompress.c
> -contrib/python-zstandard/zstd/common/fse.h
> -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/hist.c
> -contrib/python-zstandard/zstd/compress/hist.h
> -contrib/python-zstandard/zstd/compress/huf_compress.c
> -contrib/python-zstandard/zstd/compress/zstd_compress.c
> -contrib/python-zstandard/zstd/compress/zstd_compress_internal.h
> -contrib/python-zstandard/zstd/compress/zstd_compress_literals.c
> -contrib/python-zstandard/zstd/compress/zstd_compress_literals.h
> -contrib/python-zstandard/zstd/compress/zstd_compress_sequences.c
> -contrib/python-zstandard/zstd/compress/zstd_compress_sequences.h
> -contrib/python-zstandard/zstd/compress/zstd_double_fast.c
> -contrib/python-zstandard/zstd/compress/zstd_double_fast.h
> -contrib/python-zstandard/zstd/compress/zstd_fast.c
> -contrib/python-zstandard/zstd/compress/zstd_fast.h
> -contrib/python-zstandard/zstd/compress/zstd_lazy.c
> -contrib/python-zstandard/zstd/compress/zstd_lazy.h
> -contrib/python-zstandard/zstd/compress/zstd_ldm.c
> -contrib/python-zstandard/zstd/compress/zstd_ldm.h
> -contrib/python-zstandard/zstd/compress/zstdmt_compress.c
> -contrib/python-zstandard/zstd/compress/zstdmt_compress.h
> -contrib/python-zstandard/zstd/compress/zstd_opt.c
> -contrib/python-zstandard/zstd/compress/zstd_opt.h
> -contrib/python-zstandard/zstd/decompress/huf_decompress.c
> -contrib/python-zstandard/zstd/decompress/zstd_ddict.c
> -contrib/python-zstandard/zstd/decompress/zstd_ddict.h
> -contrib/python-zstandard/zstd/decompress/zstd_decompress_block.c
> -contrib/python-zstandard/zstd/decompress/zstd_decompress_block.h
> -contrib/python-zstandard/zstd/decompress/zstd_decompress_internal.h
> -contrib/python-zstandard/zstd/decompress/zstd_decompress.c
> -contrib/python-zstandard/zstd/deprecated/zbuff_common.c
> -contrib/python-zstandard/zstd/deprecated/zbuff_compress.c
> -contrib/python-zstandard/zstd/deprecated/zbuff_decompress.c
> -contrib/python-zstandard/zstd/deprecated/zbuff.h
> -contrib/python-zstandard/zstd/dictBuilder/cover.c
> -contrib/python-zstandard/zstd/dictBuilder/cover.h
> -contrib/python-zstandard/zstd/dictBuilder/divsufsort.c
> -contrib/python-zstandard/zstd/dictBuilder/divsufsort.h
> -contrib/python-zstandard/zstd/dictBuilder/fastcover.c
> -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
> -mercurial/thirdparty/xdiff/xdiff.h
> -mercurial/thirdparty/xdiff/xdiffi.c
> -mercurial/thirdparty/xdiff/xdiffi.h
> -mercurial/thirdparty/xdiff/xemit.c
> -mercurial/thirdparty/xdiff/xemit.h
> -mercurial/thirdparty/xdiff/xhistogram.c
> -mercurial/thirdparty/xdiff/xinclude.h
> -mercurial/thirdparty/xdiff/xmacros.h
> -mercurial/thirdparty/xdiff/xmerge.c
> -mercurial/thirdparty/xdiff/xpatience.c
> -mercurial/thirdparty/xdiff/xprepare.c
> -mercurial/thirdparty/xdiff/xprepare.h
> -mercurial/thirdparty/xdiff/xtypes.h
> -mercurial/thirdparty/xdiff/xutils.c
> -mercurial/thirdparty/xdiff/xutils.h
> -mercurial/thirdparty/zope/interface/_zope_interface_coptimizations.c
> +syntax: glob
> +contrib/python-zstandard/**.c

I learned from first patch in this series that this should be `rootglob` instead ;)

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7619/new/

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

To: spectral, #hg-reviewers
Cc: pulkit, mjpieters, mercurial-devel

Patch

diff --git a/contrib/clang-format-ignorelist b/contrib/clang-format-ignorelist
--- a/contrib/clang-format-ignorelist
+++ b/contrib/clang-format-ignorelist
@@ -3,100 +3,9 @@ 
 mercurial/cext/manifest.c
 mercurial/cext/osutil.c
 # Vendored code that we should never format:
-contrib/python-zstandard/c-ext/bufferutil.c
-contrib/python-zstandard/c-ext/compressionchunker.c
-contrib/python-zstandard/c-ext/compressiondict.c
-contrib/python-zstandard/c-ext/compressionparams.c
-contrib/python-zstandard/c-ext/compressionreader.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/decompressionreader.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/compiler.h
-contrib/python-zstandard/zstd/common/cpu.h
-contrib/python-zstandard/zstd/common/debug.c
-contrib/python-zstandard/zstd/common/debug.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_decompress.c
-contrib/python-zstandard/zstd/common/fse.h
-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/hist.c
-contrib/python-zstandard/zstd/compress/hist.h
-contrib/python-zstandard/zstd/compress/huf_compress.c
-contrib/python-zstandard/zstd/compress/zstd_compress.c
-contrib/python-zstandard/zstd/compress/zstd_compress_internal.h
-contrib/python-zstandard/zstd/compress/zstd_compress_literals.c
-contrib/python-zstandard/zstd/compress/zstd_compress_literals.h
-contrib/python-zstandard/zstd/compress/zstd_compress_sequences.c
-contrib/python-zstandard/zstd/compress/zstd_compress_sequences.h
-contrib/python-zstandard/zstd/compress/zstd_double_fast.c
-contrib/python-zstandard/zstd/compress/zstd_double_fast.h
-contrib/python-zstandard/zstd/compress/zstd_fast.c
-contrib/python-zstandard/zstd/compress/zstd_fast.h
-contrib/python-zstandard/zstd/compress/zstd_lazy.c
-contrib/python-zstandard/zstd/compress/zstd_lazy.h
-contrib/python-zstandard/zstd/compress/zstd_ldm.c
-contrib/python-zstandard/zstd/compress/zstd_ldm.h
-contrib/python-zstandard/zstd/compress/zstdmt_compress.c
-contrib/python-zstandard/zstd/compress/zstdmt_compress.h
-contrib/python-zstandard/zstd/compress/zstd_opt.c
-contrib/python-zstandard/zstd/compress/zstd_opt.h
-contrib/python-zstandard/zstd/decompress/huf_decompress.c
-contrib/python-zstandard/zstd/decompress/zstd_ddict.c
-contrib/python-zstandard/zstd/decompress/zstd_ddict.h
-contrib/python-zstandard/zstd/decompress/zstd_decompress_block.c
-contrib/python-zstandard/zstd/decompress/zstd_decompress_block.h
-contrib/python-zstandard/zstd/decompress/zstd_decompress_internal.h
-contrib/python-zstandard/zstd/decompress/zstd_decompress.c
-contrib/python-zstandard/zstd/deprecated/zbuff_common.c
-contrib/python-zstandard/zstd/deprecated/zbuff_compress.c
-contrib/python-zstandard/zstd/deprecated/zbuff_decompress.c
-contrib/python-zstandard/zstd/deprecated/zbuff.h
-contrib/python-zstandard/zstd/dictBuilder/cover.c
-contrib/python-zstandard/zstd/dictBuilder/cover.h
-contrib/python-zstandard/zstd/dictBuilder/divsufsort.c
-contrib/python-zstandard/zstd/dictBuilder/divsufsort.h
-contrib/python-zstandard/zstd/dictBuilder/fastcover.c
-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
-mercurial/thirdparty/xdiff/xdiff.h
-mercurial/thirdparty/xdiff/xdiffi.c
-mercurial/thirdparty/xdiff/xdiffi.h
-mercurial/thirdparty/xdiff/xemit.c
-mercurial/thirdparty/xdiff/xemit.h
-mercurial/thirdparty/xdiff/xhistogram.c
-mercurial/thirdparty/xdiff/xinclude.h
-mercurial/thirdparty/xdiff/xmacros.h
-mercurial/thirdparty/xdiff/xmerge.c
-mercurial/thirdparty/xdiff/xpatience.c
-mercurial/thirdparty/xdiff/xprepare.c
-mercurial/thirdparty/xdiff/xprepare.h
-mercurial/thirdparty/xdiff/xtypes.h
-mercurial/thirdparty/xdiff/xutils.c
-mercurial/thirdparty/xdiff/xutils.h
-mercurial/thirdparty/zope/interface/_zope_interface_coptimizations.c
+syntax: glob
+contrib/python-zstandard/**.c
+contrib/python-zstandard/**.h
+hgext/fsmonitor/pywatchman/**.c
+mercurial/thirdparty/**.c
+mercurial/thirdparty/**.h