Bug 1411004 - ./mach clang-format: Better handling of relative paths r=mystor=mystor

For example, this is addressing the issue:
./mach clang-format -p ./mfbt/

MozReview-Commit-ID: Le8mPTOEfA7
This commit is contained in:
Sylvestre Ledru
2017-10-30 18:36:28 +01:00
parent a939b65745
commit 05a64e1166
2 changed files with 130 additions and 129 deletions

View File

@@ -1,136 +1,136 @@
# Uses the LLVM coding style # Uses the LLVM coding style
^build/clang-plugin/.* build/clang-plugin/.*
# The two templates cannot be formatted # The two templates cannot be formatted
^config/gcc-stl-wrapper.template.h config/gcc-stl-wrapper.template.h
^config/msvc-stl-wrapper.template.h config/msvc-stl-wrapper.template.h
^dom/base/test/.* dom/base/test/.*
^dom/bindings/test/.* dom/bindings/test/.*
^dom/media/gtest/.* dom/media/gtest/.*
^gfx/testsd/.* gfx/testsd/.*
^image/test/.* image/test/.*
^ipc/ipdl/test/.* ipc/ipdl/test/.*
^ipc/testshell/.* ipc/testshell/.*
^js/src/jsapi-tests/.* js/src/jsapi-tests/.*
# See bug 1395584 # See bug 1395584
^js/src/vm/Opcodes.h js/src/vm/Opcodes.h
# Ignored because of bug 1342657 # Ignored because of bug 1342657
^layout/style/nsCSSPropAliasList.h layout/style/nsCSSPropAliasList.h
# Ignored because of bug 1342657 # Ignored because of bug 1342657
^layout/style/nsCSSPropList.h layout/style/nsCSSPropList.h
^media/mtransport/test/.* media/mtransport/test/.*
^mfbt/tests/.* mfbt/tests/.*
^storage/test/.* storage/test/.*
^testing/gtest/.* testing/gtest/.*
^tools/profiler/tests/.* tools/profiler/tests/.*
^uriloader/exthandler/tests/.* uriloader/exthandler/tests/.*
# JNI code is generated # JNI code is generated
^widget/android/GeneratedJNINatives.h widget/android/GeneratedJNINatives.h
^widget/android/GeneratedJNIWrappers.cpp widget/android/GeneratedJNIWrappers.cpp
^widget/android/GeneratedJNIWrappers.h widget/android/GeneratedJNIWrappers.h
^widget/android/fennec/FennecJNINatives.h widget/android/fennec/FennecJNINatives.h
^widget/android/fennec/FennecJNIWrappers.cpp widget/android/fennec/FennecJNIWrappers.cpp
^widget/android/fennec/FennecJNIWrappers.h widget/android/fennec/FennecJNIWrappers.h
^widget/tests/.* widget/tests/.*
^xpcom/glue/tests/.* xpcom/glue/tests/.*
^xpcom/tests/.* xpcom/tests/.*
# Generated from ./tools/rewriting/ThirdPartyPaths.txt # Generated from ./tools/rewriting/ThirdPartyPaths.txt
# awk '{print "^"$1".*"}' ./tools/rewriting/ThirdPartyPaths.txt # awk '{print ""$1".*"}' ./tools/rewriting/ThirdPartyPaths.txt
^browser/components/translation/cld2/.* browser/components/translation/cld2/.*
^browser/extensions/mortar/ppapi/.* browser/extensions/mortar/ppapi/.*
^db/sqlite3/src/.* db/sqlite3/src/.*
^extensions/spellcheck/hunspell/src/.* extensions/spellcheck/hunspell/src/.*
^gfx/angle/.* gfx/angle/.*
^gfx/cairo/.* gfx/cairo/.*
^gfx/graphite2/.* gfx/graphite2/.*
^gfx/harfbuzz/.* gfx/harfbuzz/.*
^gfx/ots/.* gfx/ots/.*
^gfx/qcms/.* gfx/qcms/.*
^gfx/sfntly/.* gfx/sfntly/.*
^gfx/skia/.* gfx/skia/.*
^gfx/vr/openvr/.* gfx/vr/openvr/.*
^gfx/webrender.* gfx/webrender.*
^gfx/webrender_api.* gfx/webrender_api.*
^gfx/ycbcr/.* gfx/ycbcr/.*
^intl/hyphenation/hyphen/.* intl/hyphenation/hyphen/.*
^intl/icu/.* intl/icu/.*
^ipc/chromium/.* ipc/chromium/.*
^js/src/ctypes/libffi/.* js/src/ctypes/libffi/.*
^js/src/dtoa.c.* js/src/dtoa.c.*
^js/src/jit/arm64/vixl/.* js/src/jit/arm64/vixl/.*
^media/ffvpx/.* media/ffvpx/.*
^media/gmp-clearkey/0.1/openaes/.* media/gmp-clearkey/0.1/openaes/.*
^media/kiss_fft/.* media/kiss_fft/.*
^media/libav/.* media/libav/.*
^media/libcubeb/.* media/libcubeb/.*
^media/libjpeg/.* media/libjpeg/.*
^media/libmkv/.* media/libmkv/.*
^media/libnestegg/.* media/libnestegg/.*
^media/libogg/.* media/libogg/.*
^media/libopus/.* media/libopus/.*
^media/libpng/.* media/libpng/.*
^media/libsoundtouch/.* media/libsoundtouch/.*
^media/libspeex_resampler/.* media/libspeex_resampler/.*
^media/libstagefright/.* media/libstagefright/.*
^media/libtheora/.* media/libtheora/.*
^media/libtremor/.* media/libtremor/.*
^media/libvorbis/.* media/libvorbis/.*
^media/libvpx/.* media/libvpx/.*
^media/libyuv/.* media/libyuv/.*
^media/mtransport/third_party/.* media/mtransport/third_party/.*
^media/openmax_dl/.* media/openmax_dl/.*
^media/sphinxbase/.* media/sphinxbase/.*
^media/webrtc/signaling/src/sdp/sipcc/.* media/webrtc/signaling/src/sdp/sipcc/.*
^media/webrtc/trunk/.* media/webrtc/trunk/.*
^mfbt/decimal/.* mfbt/decimal/.*
^mfbt/double-conversion/double-conversion/.* mfbt/double-conversion/double-conversion/.*
^mobile/android/geckoview/src/thirdparty/.* mobile/android/geckoview/src/thirdparty/.*
^mobile/android/thirdparty/.* mobile/android/thirdparty/.*
^modules/brotli/.* modules/brotli/.*
^modules/fdlibm/.* modules/fdlibm/.*
^modules/freetype2/.* modules/freetype2/.*
^modules/libbz2/.* modules/libbz2/.*
^modules/libmar/.* modules/libmar/.*
^modules/pdfium/.* modules/pdfium/.*
^modules/woff2/.* modules/woff2/.*
^modules/zlib/.* modules/zlib/.*
^netwerk/sctp/src/.* netwerk/sctp/src/.*
^netwerk/srtp/src/.* netwerk/srtp/src/.*
^nsprpub/.* nsprpub/.*
^other-licenses/.* other-licenses/.*
^parser/expat/.* parser/expat/.*
^security/nss/.* security/nss/.*
^security/sandbox/chromium/.* security/sandbox/chromium/.*
^testing/gtest/gmock/.* testing/gtest/gmock/.*
^testing/gtest/gtest/.* testing/gtest/gtest/.*
^testing/talos/talos/tests/canvasmark/.* testing/talos/talos/tests/canvasmark/.*
^testing/talos/talos/tests/dromaeo/.* testing/talos/talos/tests/dromaeo/.*
^testing/talos/talos/tests/kraken/.* testing/talos/talos/tests/kraken/.*
^testing/talos/talos/tests/v8_7/.* testing/talos/talos/tests/v8_7/.*
^third_party/aom/.* third_party/aom/.*
^third_party/python/blessings/.* third_party/python/blessings/.*
^third_party/python/configobj/.* third_party/python/configobj/.*
^third_party/python/futures/.* third_party/python/futures/.*
^third_party/python/jsmin/.* third_party/python/jsmin/.*
^third_party/python/mock-*/.* third_party/python/mock-*/.*
^third_party/python/psutil/.* third_party/python/psutil/.*
^third_party/python/py/.* third_party/python/py/.*
^third_party/python/pyasn1/.* third_party/python/pyasn1/.*
^third_party/python/pyasn1-modules/.* third_party/python/pyasn1-modules/.*
^third_party/python/PyECC/.* third_party/python/PyECC/.*
^third_party/python/pytest/.* third_party/python/pytest/.*
^third_party/python/pytoml/.* third_party/python/pytoml/.*
^third_party/python/pyyaml/.* third_party/python/pyyaml/.*
^third_party/python/redo/.* third_party/python/redo/.*
^third_party/python/requests/.* third_party/python/requests/.*
^third_party/python/rsa/.* third_party/python/rsa/.*
^third_party/python/six/.* third_party/python/six/.*
^third_party/python/which/.* third_party/python/which/.*
^third_party/rust/.* third_party/rust/.*
^toolkit/components/jsoncpp/.* toolkit/components/jsoncpp/.*
^toolkit/components/lz4/.* toolkit/components/lz4/.*
^toolkit/components/protobuf/.* toolkit/components/protobuf/.*
^toolkit/components/url-classifier/chromium/.* toolkit/components/url-classifier/chromium/.*
^toolkit/components/url-classifier/protobuf/.* toolkit/components/url-classifier/protobuf/.*
^toolkit/crashreporter/google-breakpad/.* toolkit/crashreporter/google-breakpad/.*
^tools/fuzzing/libfuzzer.* tools/fuzzing/libfuzzer.*

View File

@@ -304,7 +304,8 @@ class FormatProvider(MachCommandBase):
# Remove comments and empty lines # Remove comments and empty lines
if line.startswith('#') or len(line.strip()) == 0: if line.startswith('#') or len(line.strip()) == 0:
continue continue
ignored_dir.append(line.rstrip()) # The regexp is to make sure we are managing relative paths
ignored_dir.append("^[\./]*" + line.rstrip())
# Generates the list of regexp # Generates the list of regexp
ignored_dir_re = '(%s)' % '|'.join(ignored_dir) ignored_dir_re = '(%s)' % '|'.join(ignored_dir)