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

ruff format check lines-after-imports options but not respect it #13364

Closed
trim21 opened this issue Sep 16, 2024 · 1 comment
Closed

ruff format check lines-after-imports options but not respect it #13364

trim21 opened this issue Sep 16, 2024 · 1 comment
Labels
isort Related to import sorting question Asking for support or clarification

Comments

@trim21
Copy link
Contributor

trim21 commented Sep 16, 2024

I'm using ruff 0.6.5 (8558126df 2024-09-13) with config tool.ruff.lint.isort.lines-after-imports = 2

ruff format warns about lines-after-imports are not -1,1,2 but did't add 2 empty lines after last import

for example, not changes for this file:

import io

with io.StringIO() as f:
    print("ok", file=f)
@MichaReiser MichaReiser added question Asking for support or clarification isort Related to import sorting labels Sep 16, 2024
@MichaReiser
Copy link
Member

The lines-after-imports setting is a isort setting and isort runs as part of ruff check and not ruff format.

Can you try to run

ruff check --fix --select I

It should add the two empty lines. We hope to integrate format into ruff check in the long-term and possibly move isort to format to reduce the confusion (see #8232)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
isort Related to import sorting question Asking for support or clarification
Projects
None yet
Development

No branches or pull requests

2 participants