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

Alphabetical import ordering #236

Closed
JLLeitschuh opened this issue Jun 20, 2018 · 5 comments
Closed

Alphabetical import ordering #236

JLLeitschuh opened this issue Jun 20, 2018 · 5 comments

Comments

@JLLeitschuh
Copy link
Contributor

I just realized that Ktlint doesn't seem to care about the ordering of imports.
Should they be alphabetized by Ktlint?

@shyiko
Copy link
Collaborator

shyiko commented Jun 21, 2018

Hey Jonathan.
We have ImportOrderingRule but it's not enabled due to the https://github.com/shyiko/ktlint/blob/master/ktlint-ruleset-standard/src/main/kotlin/com/github/shyiko/ktlint/ruleset/standard/StandardRuleSetProvider.kt#L13. We need either to find a way to reconcile the differences (between the Intellij and AS) or move that rule into a separate ruleset.

@gabrielittner
Copy link
Contributor

Do you have an example of what exactly the difference is?

@shyiko
Copy link
Collaborator

shyiko commented Jun 21, 2018

I believe the order of (at least) static imports was different. I can't be certain though, I have to go back and recheck. If IntelliJ/AS's Ctrl+Alt+O ("Optimize Imports...") can be made to produce the same output - we can reconsider turning it back on.

@gabrielittner
Copy link
Contributor

The Android style guide says it should be a single ASCII sorted list. From what I can see that's what I get by using optimize imports in AS.

@shyiko
Copy link
Collaborator

shyiko commented Jun 23, 2018

Closing as a duplicate, #189.

@shyiko shyiko closed this as completed Jun 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants