Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ruff in place of black and reorder-python-imports #239

Merged
merged 3 commits into from Jan 30, 2024

Conversation

nicoddemus
Copy link
Member

Unfortunately black and reorder-python-imports are no longer compatible between each other:

asottile/reorder-python-imports#367
asottile/reorder-python-imports#366
psf/black#4175

Take this opportunity to try out ruff.

Closes #231.

Unfortunately black and reorder-python-imports are no longer compatible between each other:

asottile/reorder-python-imports#367
asottile/reorder-python-imports#366
psf/black#4175

Take this opportunity to try out ruff.
@nicoddemus
Copy link
Member Author

I realized later that ruff does not reorder imports. Will try out with isort later.

@bluetech
Copy link
Member

I realized later that ruff does not reorder imports. Will try out with isort later.

Ruff does implement isort but it needs to be enabled:

Rule: https://docs.astral.sh/ruff/rules/unsorted-imports/
Settings: https://docs.astral.sh/ruff/settings/#isort

@nicoddemus
Copy link
Member Author

Thanks @bluetech, even better then! 👍

@nicoddemus nicoddemus merged commit 907e87a into pytest-dev:master Jan 30, 2024
13 checks passed
@nicoddemus nicoddemus deleted the use-ruff branch January 30, 2024 16:05
@bluetech
Copy link
Member

I haven't checked myself, but are you sure the isort part works? The I001 is not in the default rules set so needs to be selected

[tool.ruff.lint]
extend-select = ["I001"]

(extend-select extends the default set, can use select to replace the default entirely)

@nicoddemus
Copy link
Member Author

I haven't checked myself, but are you sure the isort part works?

TBH no, I will double check later, thanks for raising it.

nicoddemus added a commit to nicoddemus/execnet that referenced this pull request Jan 30, 2024
As brought up in pytest-dev#239 (comment), the isort settings for ruff were not being applied.
nicoddemus added a commit that referenced this pull request Jan 30, 2024
As brought up in #239 (comment), the isort settings for ruff were not being applied.
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.

None yet

3 participants