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

Normalize leading blank lines when moving imports #163

Open
amyreese opened this issue May 26, 2022 · 1 comment
Open

Normalize leading blank lines when moving imports #163

amyreese opened this issue May 26, 2022 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@amyreese
Copy link
Member

Running µsort on this sort of input does what I would consider to be the "wrong thing":

import re

import usort
import trailrunner

print("hello")

This gets sorted into:

import re

import trailrunner

import usort

print("hello")

Ie, the leading blank line above import usort is kept when moving usort below trailrunner, even though they are in the same category.

@amyreese amyreese added the bug Something isn't working label May 26, 2022
@amyreese amyreese added this to the 1.1 milestone May 26, 2022
@amyreese amyreese self-assigned this May 26, 2022
@pmeier
Copy link
Contributor

pmeier commented Aug 24, 2022

I stumbled over this behavior today. The documentation only mentions:

  1. Normalize whitespace between imports as needed

That is quite nondescript. Maybe we can add a paragraph what this actually means when the behavior is no longer the "wrong thing"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants