-
-
Notifications
You must be signed in to change notification settings - Fork 250
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
Treewide codestyle cleanup #765
Conversation
f59fba9
to
a29db8e
Compare
@@ -20,7 +20,7 @@ | |||
|
|||
## :pencil: Checklist | |||
<!--- Put an `x` in the boxes that apply --> | |||
- [ ] I ran `./gradlew spotlessApply` before submitting the PR | |||
- [ ] I formatted the code with the IDE's reformat action (Ctrl + Shift + L/Cmd + Shift + L) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be better if we give directions to the UI element ?
IDE shortcuts may not be available if they are used by the system. (I had this issue on KDE)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No way to do that without making the entire thing very wordy. I'm trying to keep this as small as it can be. I intentionally used the wording IntelliJ uses so you can just plop this into a search engine and get the right results should there be a case as yours.
When I apply the code style to reproduce the reformat of the last commit, I get a non-trivial diff that consists entirely of empty lines after definitions. Is it possible that you have code styles set locally that are not part of the first commit? |
a29db8e
to
18ebef7
Compare
Pretty unlikely, I double checked my settings. As a test I did a manual export of the project settings and replaced the codestyle config in |
I think that this is caused by KEEP_* settings which make this not 100% reproducible. Maybe we should set BLANK_LINES_AFTER_CLASS_HEADER to 1 to explicitly insert a blank line after class definitions which are implicitly kept by KEEP_BLANK_LINES_IN_DECLARATIONS. Also I think that even though KEEP_BLANK_LINES_IN_CODE is set to 0 in the checked in settings, not all empty lines in the code have been deleted, e.g. . |
Hmm that's wrong yeah. I'll tweak this to make it all more reproducible. Thanks for looking into it! |
7579680
to
2b8efca
Compare
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Spotless wraps around ktlint for us which has not worked with IntelliJ/Android Studio formatting for over a year now. I am sick of waiting, so ktlint will not be making a return until that is fixed. Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
a0bb1bc
to
ebca21d
Compare
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
ebca21d
to
84f6bfe
Compare
Alright I *think* this is reproducible now. Wanna give it another try @FabianHenneke @Skrilltrax? |
Yes, this got rid of all the |
📢 Type of change
📜 Description
I've split the PR up in 3 commits to separate logical parts:
💡 Motivation and Context
The cycle of Write code in the IDE -> Run spotlessApply -> Go back to make a change -> Run spotlessApply again because import order changed got extremely tiring.
💚 How did you test it?
📝 Checklist
🔮 Next steps
There seems to be no other formatter available, so none. Might be worth exploring detekt for static analysis.
📸 Screenshots / GIFs