Skip to content

Use Ruff for Python linting and formatting

Marco Clemencic requested to merge 298-switch-to-ruff into master

Ruff is a widely used, extremely fast re-implementation of a number of Python tools like flake8, isort and black.

As proposed in #298 (closed) I changed the pre-commit configuration to use Ruff instead of the combination of the 3 tools flake8, isort and black.

The main differences wrt the previous configuration are

Somehow Ruff reported a number of type-comparison (E721) violations that were not reported by flake8/pycodestyle, so I fixed them (as well as a few more that were not reported), but we may want to reconsider it (see https://github.com/astral-sh/ruff/issues/6465).

Closes #298 (closed)

Edited by Marco Clemencic

Merge request reports