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
Hi, after updating to 0.16.0 i noticed that I001 is failing with any import, even if everything is properly configured. Example (AWS Lambda Python code):
This can be fixed by adding an extra blank line below import json. See playground.
Thank you, i was able to verify that it is fixed - but the Ruff documentation didn't mention anything about spaces? I also noticed that Ruff isn't explaining what exacly is wrong with this configuration:
Thanks for the report! I see how this is confusing. As @calumy said, isort and Ruff's I001 rule require additional blank lines between imports and function and class definitions. The single blank line is allowed between imports and other kinds of statements. You can adjust this with the lines-after-imports setting.
Looking at this today, I was a bit surprised that our docs for I001 are so short. I think it would be a good idea to expand them, especially now that the rule is enabled by default.
Thanks! I’d be happy to work on this as a documentation-only change.
I’ll expand the I001 rule documentation to explain import sections and the blank-line requirements after an import block, with links to the relevant lines-after-imports and import-classification settings.
Activity
calumy commentedon Jul 28, 2026
This can be fixed by adding an extra blank line below
import json. See playground.r-heimann commentedon Jul 28, 2026
Thank you, i was able to verify that it is fixed - but the Ruff documentation didn't mention anything about spaces? I also noticed that Ruff isn't explaining what exacly is wrong with this configuration:
After talking to a LLM i saw that 3rd party modules should be separated by an extra space:
The new rule set doesn't seem to properly explain these kinds of issues.
r-heimann commentedon Jul 28, 2026
I also just noticed that doing this ignores the 2 spaces at the end of the imports:
Incredibly confusing, but i am not a Python Expert - so i may be stumbling upon something that is already known.
ntBre commentedon Jul 28, 2026
Thanks for the report! I see how this is confusing. As @calumy said, isort and Ruff's
I001rule require additional blank lines between imports and function and class definitions. The single blank line is allowed between imports and other kinds of statements. You can adjust this with the lines-after-imports setting.Looking at this today, I was a bit surprised that our docs for
I001are so short. I think it would be a good idea to expand them, especially now that the rule is enabled by default.[-]0.16.0: I001 - Fails with any import[/-][+]I001 - Fails with any import[/+]roian6 commentedon Jul 28, 2026
Thanks! I’d be happy to work on this as a documentation-only change.
I’ll expand the I001 rule documentation to explain import sections and the blank-line requirements after an import block, with links to the relevant
lines-after-importsand import-classification settings.jonathandung commentedon Jul 31, 2026
Maybe change the issue title?
[-]I001 - Fails with any import[/-][+]Expand `I001` documentation[/+]halcyon-past commentedon Oct 30, 2026
I'd like to work on this issue!
[`isort`] Expand `I001` documentation
[`isort`] Expand `I001` documentation (astral-sh#29843)