ruff.rst (1340B)
1 Ruff 2 ==== 3 4 `Ruff <https://github.com/charliermarsh/ruff>`_ is an extremely fast Python 5 linter and formatter, written in Rust. It can process all of mozilla-central in 6 under a second, and implements rule sets from a large array of Python linters 7 and formatters, including: 8 9 * flake8 (pycodestyle, pyflakes and mccabe) 10 * isort 11 * pylint 12 * pyupgrade 13 * and many many more! 14 15 Run Locally 16 ----------- 17 18 The mozlint integration of ruff can be run using mach: 19 20 .. parsed-literal:: 21 22 $ mach lint --linter ruff <file paths> 23 24 25 Configuration 26 ------------- 27 28 Ruff is configured in the root `pyproject.toml`_ file. Additionally, ruff will 29 pick up any ``pyproject.toml`` or ``ruff.toml`` files in subdirectories. The 30 settings in these files will only apply to files contained within these 31 subdirs. For more details on configuration discovery, see the `configuration 32 documentation`_. 33 34 For a list of options, see the `settings documentation`_. 35 36 Sources 37 ------- 38 39 * `Configuration (YAML) <https://searchfox.org/mozilla-central/source/tools/lint/ruff.yml>`_ 40 * `Source <https://searchfox.org/mozilla-central/source/tools/lint/python/ruff.py>`_ 41 42 .. _pyproject.toml: https://searchfox.org/mozilla-central/source/pyproject.toml 43 .. _configuration documentation: https://beta.ruff.rs/docs/configuration/ 44 .. _settings documentation: https://beta.ruff.rs/docs/settings/