Bug 1811850 - [lint] Replace flake8 linter with ruff, r=linter-reviewers,sylvestre

Ruff is a very fast linter implemented in Rust and it can act as a drop-in
replacement for flake8. When running the same set of rules across all files
in mozilla-central (without mozlint), flake8 takes 900 seconds whereas ruff
takes 0.9 seconds.

Ruff also implements rules from other popular Python linters such as pylint,
isort and pyupgrade. There are even plans to implement feature parity with
black in the future. Ultimately, it can become our one stop shop for all Python
linting and formatting.

This stack will swap out all our Python lint tools for ruff (excluding black
for now).

Differential Revision: https://phabricator.services.mozilla.com/D172313
This commit is contained in:
Andrew Halberstadt
2023-03-20 13:06:27 +00:00
parent fbdbea3edf
commit 69b399c915
30 changed files with 472 additions and 633 deletions

View File

@@ -20,12 +20,12 @@ class GeckoPrettyPrinter(object):
return wrapped
import gdbpp.enumset # NOQA: F401
import gdbpp.linkedlist # NOQA: F401
import gdbpp.owningthread # NOQA: F401
import gdbpp.smartptr # NOQA: F401
import gdbpp.string # NOQA: F401
import gdbpp.tarray # NOQA: F401
import gdbpp.thashtable # NOQA: F401
import gdbpp.enumset # noqa: F401
import gdbpp.linkedlist # noqa: F401
import gdbpp.owningthread # noqa: F401
import gdbpp.smartptr # noqa: F401
import gdbpp.string # noqa: F401
import gdbpp.tarray # noqa: F401
import gdbpp.thashtable # noqa: F401
gdb.printing.register_pretty_printer(None, GeckoPrettyPrinter.pp)