Sort imports
Rewrite each named file's import block into three groups — runtime built-ins, third-party packages, local paths — and alphabetize within each group.
Steps
- Read the file and collect every import statement above the first non-import line.
- Classify each import into one of the three groups by its specifier.
- Rewrite the block in group order with one blank line between groups, changing nothing below the import block, because edits outside the block belong to other tools.
- Report the files you changed and any specifier you could not classify.