Bug 1367092 - [flake8] Use a blacklist instead of a whitelist, r=egao
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Fri, 22 Feb 2019 21:25:50 +0000
changeset 460907 4624c850f711417ae3cc95f3e69ce4cb6c07f70b
parent 460906 41fdb372e22cf213eb76b966e357772f89a77710
child 460908 d5d53fd773ca40b1a5c5a7208cd4926007ef3516
push id35613
push usernerli@mozilla.com
push dateTue, 26 Feb 2019 03:52:35 +0000
treeherdermozilla-central@faec87a80ed1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersegao
bugs1367092
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1367092 - [flake8] Use a blacklist instead of a whitelist, r=egao This ensures that the default for new python files is to be linted by flake8. Depends on D20496 Differential Revision: https://phabricator.services.mozilla.com/D20497
.flake8
tools/lint/flake8.yml
--- a/.flake8
+++ b/.flake8
@@ -1,35 +1,88 @@
 [flake8]
 max-line-length = 99
 exclude =
+    # These paths should be triaged and either fixed or moved to the list below.
+    client.py,
+    devtools/shared,
+    dom/base,
+    dom/bindings,
+    dom/browser-element,
+    dom/canvas,
+    dom/encoding,
+    dom/imptests,
+    dom/security,
+    dom/websocket,
+    embedding/ios/moz.configure,
+    gfx/tests,
+    layout/base/tests/marionette,
+    layout/reftests/border-image,
+    layout/reftests/fonts,
+    layout/reftests/w3c-css,
+    layout/style,
+    media/libdav1d/generate_source.py,
+    moz.configure,
+    netwerk/dns/prepare_tlds.py,
+    netwerk/protocol/http/make_incoming_tables.py,
+    python/devtools/migrate-l10n/migrate/main.py,
+    python/l10n/fluent_migrations,
+    python/mozbuild,
+    servo/components/style,
+    testing/jsshell/benchmark.py,
+    testing/marionette/mach_commands.py,
+    testing/mozharness/docs,
+    testing/mozharness/examples,
+    testing/mozharness/external_tools,
+    testing/mozharness/mach_commands.py,
+    testing/mozharness/manifestparser,
+    testing/mozharness/mozprocess,
+    testing/mozharness/setup.py,
+    testing/parse_build_tests_ccov.py,
+    testing/runtimes/writeruntimes.py,
+    testing/tools/iceserver/iceserver.py,
+    testing/tools/view_gecko_profile/view_gecko_profile.py,
+    testing/tools/websocketprocessbridge/websocketprocessbridge.py,
+    testing/web-platform,
+    toolkit/components/featuregates,
+    toolkit/content/tests/chrome/file_about_networking_wsh.py,
+    toolkit/crashreporter/tools/symbolstore.py,
+    toolkit/crashreporter/tools/unit-symbolstore.py,
+    toolkit/library/dependentlibs.py,
+    toolkit/locales/generate_update_locale.py,
+    toolkit/mozapps,
+    toolkit/moz.configure,
+    toolkit/nss.configure,
+
+    # These paths are intentionally excluded (not necessarily for good reason).
     build/build-infer/build-infer.py,
     build/moz.configure/*.configure,
     build/pymake/,
     browser/extensions/mortar/ppapi/,
     browser/moz.configure,
     dom/canvas/test/webgl-conf/checkout/closure-library/,
     editor/libeditor/tests/browserscope/,
     intl/icu/,
     ipc/chromium/src/third_party/,
     js/*.configure,
     gfx/angle/,
     gfx/harfbuzz,
-    glx/skia/,
+    gfx/skia/,
     memory/moz.configure,
     mobile/android/*.configure,
     node_modules,
     security/nss/,
     testing/marionette/harness/marionette_harness/runner/mixins,
     testing/marionette/harness/marionette_harness/tests,
     testing/mochitest/pywebsocket,
     testing/mozharness/configs/test/test_malformed.py,
     tools/lint/test/files,
     tools/infer/test/*.configure,
     tools/crashreporter/*.configure,
+    .ycm_extra_conf.py,
 
 # See:
 #   - http://flake8.pycqa.org/en/latest/user/error-codes.html
 #   - http://pep8.readthedocs.io/en/latest/intro.html#configuration
 ignore =
     # These should be triaged and either fixed or moved to the list below.
     F632, F633, F811, E117, W504, W605, W606,
     # These are intentionally disabled (not necessarily for good reason).
--- a/tools/lint/flake8.yml
+++ b/tools/lint/flake8.yml
@@ -1,68 +1,12 @@
 ---
 flake8:
     description: Python linter
-    include:
-        - accessible/
-        - browser/
-        - build/
-        - config/
-        - configure.py
-        - gfx/gl/
-        - gfx/layers/
-        - intl/
-        - ipc/pull-chromium.py
-        - ipc/ipdl/
-        - js/
-        - memory/
-        - mobile/
-        - mozglue/
-        - layout/tools/reftest
-        - python/mach
-        - python/mach_commands.py
-        - python/mozboot
-        - python/mozbuild/mozpack/path.py
-        - python/mozlint
-        - python/mozrelease
-        - python/mozterm
-        - python/mozversioncontrol
-        - python/safety
-        - security/
-        - security/manager
-        - taskcluster
-        - testing/awsy
-        - testing/firefox-ui
-        - testing/geckodriver
-        - testing/gtest
-        - testing/mach_commands.py
-        - testing/marionette/client
-        - testing/marionette/harness
-        - testing/marionette/puppeteer
-        - testing/mochitest
-        - testing/mozbase
-        - testing/mozharness/configs
-        - testing/mozharness/mozfile
-        - testing/mozharness/mozharness
-        - testing/mozharness/mozharness/mozilla/tooltool.py
-        - testing/mozharness/mozinfo
-        - testing/mozharness/scripts
-        - testing/mozharness/test
-        - testing/raptor
-        - testing/remotecppunittests.py
-        - testing/runcppunittests.py
-        - testing/talos/
-        - testing/tps/
-        - testing/xpcshell
-        - toolkit/components/telemetry
-        - toolkit/crashreporter/tools/upload_symbols.py
-        - tools/
-        - xpcom/
-    # Excludes should be added to topsrcdir/.flake8 due to a bug in flake8 where
-    # specifying --exclude causes custom configuration files to be ignored.
+    # Excludes should be added to topsrcdir/.flake8.
     exclude: []
     # The configure option is used by the build system
     extensions: ['configure', 'py']
     support-files:
         - '**/.flake8'
         - 'tools/lint/python/flake8*'
     type: external
     payload: python.flake8:lint