tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

pyproject.toml (5299B)


      1 [tool.ruff]
      2 line-length = 88
      3 target-version = "py38"
      4 # See https://beta.ruff.rs/docs/rules/ for a full list of rules.
      5 lint.select = [
      6  "E", "W",    # pycodestyle
      7  "F",         # pyflakes
      8  "I",         # isort
      9  "PL",        # pylint
     10  "UP",        # pyupgrade
     11 ]
     12 lint.ignore = [
     13  # These should be triaged and either fixed or moved to the list below.
     14  "E713", "E714",
     15 
     16  # These are intentionally ignored.
     17  "E741",      # ambiguous-variable-name
     18  "PLR09",     # too-many-return-statements, too-many-branches, too-many-arguments, too-many-statements
     19  "PLR2004",   # magic-value-comparison
     20  "PLC0206",   # dict-index-missing-items
     21  "PLC0415",   # `import` should be at the top-level of a file
     22 
     23  # These are handled by ruff format.
     24  "E1", "E4", "E5", "W1", "W2", "W5",
     25 ]
     26 builtins = ["gdb"]
     27 extend-include = ["*.configure"]
     28 exclude = [
     29  # These paths should be triaged and either fixed or moved to the list below.
     30  "devtools/shared",
     31  "dom/bindings/Codegen.py",
     32  "dom/bindings/parser/WebIDL.py",
     33  "dom/bindings/parser/tests/test_arraybuffer.py",
     34  "dom/bindings/parser/tests/test_securecontext_extended_attribute.py",
     35  "gfx/tests",
     36  "ipc/ipdl/ipdl",
     37  "layout/base/tests/marionette",
     38  "layout/reftests/border-image",
     39  "layout/reftests/fonts",
     40  "layout/reftests/w3c-css",
     41  "layout/style",
     42  "media/libdav1d/generate_source.py",
     43  "netwerk/dns/prepare_tlds.py",
     44  "netwerk/protocol/http/make_incoming_tables.py",
     45  "python/l10n/fluent_migrations",
     46  "security/manager/ssl/tests/unit",
     47  "servo/components/style",
     48  "testing/condprofile/condprof/android.py",
     49  "testing/condprofile/condprof/creator.py",
     50  "testing/condprofile/condprof/desktop.py",
     51  "testing/condprofile/condprof/runner.py",
     52  "testing/condprofile/condprof/scenarii/heavy.py",
     53  "testing/condprofile/condprof/scenarii/settled.py",
     54  "testing/condprofile/condprof/scenarii/synced.p",
     55  "testing/condprofile/condprof/helpers.py",
     56  "testing/jsshell/benchmark.py",
     57  "testing/marionette/mach_commands.py",
     58  "testing/mozharness/docs",
     59  "testing/mozharness/examples",
     60  "testing/mozharness/external_tools",
     61  "testing/mozharness/mach_commands.py",
     62  "testing/mozharness/manifestparser",
     63  "testing/mozharness/mozprocess",
     64  "testing/mozharness/setup.py",
     65  "testing/parse_build_tests_ccov.py",
     66  "testing/runtimes/writeruntimes.py",
     67  "testing/tools/iceserver/iceserver.py",
     68  "testing/tools/websocketprocessbridge/websocketprocessbridge.py",
     69  "toolkit/content/tests/chrome/file_about_networking_wsh.py",
     70  "toolkit/library/build/dependentlibs.py",
     71  "toolkit/mozapps",
     72  "toolkit/moz.configure",
     73  "toolkit/nss.configure",
     74 
     75  # Can be removed once remaining CI workers updated past Python 3.8
     76  "python/mozbuild/mozbuild/action/tooltool.py",
     77 
     78  # mako files are not really python files
     79  "*.mako.py",
     80 
     81  # These paths are intentionally excluded (not necessarily for good reason).
     82  "build/moz.configure/*.configure",
     83  "build/pymake/",
     84  "browser/extensions/mortar/ppapi/",
     85  "browser/moz.configure",
     86  "dom/canvas/test/webgl-conf/checkout/closure-library/",
     87  "editor/libeditor/tests/browserscope/",
     88  "intl/icu/",
     89  "ipc/chromium/src/third_party/",
     90  "js/*.configure",
     91  "gfx/angle/",
     92  "gfx/harfbuzz",
     93  "gfx/skia/",
     94  "memory/moz.configure",
     95  "mobile/android/*.configure",
     96  "node_modules",
     97  "python/mozbuild/mozbuild/test/configure/data",
     98  "security/nss/",
     99  "testing/marionette/harness/marionette_harness/runner/mixins",
    100  "testing/marionette/harness/marionette_harness/tests",
    101  "testing/mochitest/pywebsocket3",
    102  "testing/mozharness/configs/test/test_malformed.py",
    103  "testing/web-platform/tests",
    104  "tools/lint/test/files",
    105  "tools/crashreporter/*.configure",
    106  ".ycm_extra_conf.py",
    107 ]
    108 
    109 [tool.ruff.lint.per-file-ignores]
    110 # These paths are intentionally excluded.
    111 "dom/bindings/Configuration.py" = ["PLC3002"]
    112 "ipc/ipdl/*" = ["F403", "F405"]
    113 "layout/tools/reftest/selftest/conftest.py" = ["F811"]
    114 # cpp_eclipse has a lot of multi-line embedded XML which exceeds line length
    115 "python/mozbuild/mozbuild/backend/cpp_eclipse.py" = ["E501"]
    116 "testing/firefox-ui/**/__init__.py" = ["F401"]
    117 "testing/marionette/**/__init__.py" = ["F401"]
    118 "testing/mochitest/tests/python/conftest.py" = ["F811"]
    119 "testing/mozbase/manifestparser/tests/test_filters.py" = ["E731"]
    120 "testing/mozbase/mozinfo/mozinfo/mozinfo.py" = ["PLE0605"]
    121 "testing/mozbase/mozlog/tests/test_formatters.py" = ["E501"]
    122 "testing/mozharness/configs/*" = ["E501"]
    123 "**/*.configure" = ["F821"]
    124 # These paths contain Python-2 only syntax.
    125 "build/compare-mozconfig/compare-mozconfigs.py" = ["F821"]
    126 "build/midl.py" = ["F821"]
    127 "build/pgo/genpgocert.py" = ["F821"]
    128 "config/MozZipFile.py" = ["F821"]
    129 "config/check_source_count.py" = ["F821"]
    130 "config/tests/unitMozZipFile.py" = ["F821"]
    131 "ipc/pull-chromium.py" = ["F633"]
    132 "js/src/**" = ["F633", "F821"]
    133 "python/mozbuild/mozbuild/action/dump_env.py" = ["F821"]
    134 "python/mozbuild/mozbuild/dotproperties.py" = ["F821"]
    135 "python/mozbuild/mozbuild/testing.py" = ["F821"]
    136 "python/mozbuild/mozbuild/util.py" = ["F821"]
    137 "testing/mozharness/mozharness/mozilla/testing/android.py" = ["F821"]
    138 "testing/mochitest/runtests.py" = ["F821"]
    139 
    140 [tool.ruff.format]
    141 # Enable preview mode for --output-format=json to get improved line/column reporting.
    142 # TODO: Remove preview once these features are in the stable release.
    143 preview = true