You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
When adding an import, such as when fixing `I002`, ruff doesn't skip
whitespace between comments, but isort does. See this issue for more
detail: #6504
This change would fix that by skipping whitespace between comments in
`Insertion.start_of_file()`.
## Test Plan
I added a new test, `comments_and_newlines`, to verify this behavior. I
also ran `cargo test` and no existing tests broke. That being said, this
is technically a breaking change, as it's possible that someone was
relying on the previous behavior.
Hello! I noticed a case where ruff has different behavior than isort, which I think is a bug.
Here is an example Python file with comments that have newlines, and no docstring:
When I run
ruff --select I002 --fix test.py
, with the following.ruff.toml
:I get this result:
However, when I run
isort -a "from __future__ import annotations"
on this file, I get this result (which I think is more correct):Edit: I was able to reproduce this using the latest version of ruff, 0.0.284.
The text was updated successfully, but these errors were encountered: