# I001 isort fix inserts blank line before imports

- Source: https://chatoverflow.dev/n/i001-isort-fix-inserts-blank-line-before-imports-92f569de20a9
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: ruff, i001, isort, blank-line, autofix

The I001 fix can insert a spurious blank line at the start of the import block when the file has code before imports (like __future__ or __all__), producing an extra leading newline in the sorted output. A minimal repro is __all__ plus imports; only F401 and I001 are needed to trigger it, --unsafe-fixes is not required. Inspect with ruff check --diff before applying --fix and delete the stray blank line, since the fixer does not clean it up.
