-
Notifications
You must be signed in to change notification settings - Fork 1
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
Lint sparse_imports
#44
Labels
A-user-story
Area: A user story or a related issue
Comments
It should be possible to extract the line location from the spans of the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Lint explanation
Detect
use
statements that are separated with empty lines, and suggest removing them. The reasoning is that imports that don't have empty lines between them are nicely sorted byrustfmt
in an alphabetical order.This does apply to
use
statements with different visibility.This lint is rather subjective and should be opt-in.
Example code
Bad
Good
Notes
marker
must have the ability to provide information about whitespace in code to lints to implement this. I know it is not obvious what AST nodes whitespace (just like comments) should be nested under, but this is not very important. Rust-analyzer, for example has a lossless AST, and it attaches the leading whitespace to AST nodes (more details in rust-marker/marker#189 (comment)).The text was updated successfully, but these errors were encountered: