Skip to content

[backport] Migrate from autoflake, black, isort, pyupgrade, flake8 and pydocstyle, to ruff#11911

Merged
Pierre-Sassoulas merged 1 commit intopytest-dev:8.0.xfrom
Pierre-Sassoulas:backport-ruff-migration
Feb 2, 2024
Merged

[backport] Migrate from autoflake, black, isort, pyupgrade, flake8 and pydocstyle, to ruff#11911
Pierre-Sassoulas merged 1 commit intopytest-dev:8.0.xfrom
Pierre-Sassoulas:backport-ruff-migration

Conversation

@Pierre-Sassoulas
Copy link
Member

Backport of #11901. There was a large number of conflicts so I applied git restore . --ours and made pre-commit happy again.

…e, to ruff

ruff is faster and handle everything we had prior.

isort configuration done based on the indication from
astral-sh/ruff#4670, previousely based on
reorder-python-import (pytest-dev#11896)

flake8-docstrings was a wrapper around pydocstyle (now archived) that
explicitly asks to use ruff in PyCQA/pydocstyle#658.

flake8-typing-import is useful mainly for project that support python 3.7
and the one useful check will be implemented in astral-sh/ruff#2302

We need to keep blacken-doc because ruff does not handle detection
of python code inside .md and .rst. The direct link to the repo is
now used to avoid a redirection.

Manual fixes:
- Lines that became too long
- % formatting that was not done automatically
- type: ignore that were moved around
- noqa of hard to fix issues (UP031 generally)
- fmt: off and fmt: on that is not really identical
  between black and ruff
- autofix re-order in pre-commit from faster to slower

Co-authored-by: Ran Benita <ran@unusedvar.com>
@Pierre-Sassoulas Pierre-Sassoulas merged commit c11cdfa into pytest-dev:8.0.x Feb 2, 2024
@Pierre-Sassoulas Pierre-Sassoulas deleted the backport-ruff-migration branch February 2, 2024 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants