-
Notifications
You must be signed in to change notification settings - Fork 726
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
Adds editorconfig for current code style #5727
Conversation
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.
LGTM
ij_properties_key_value_delimiter = equals | ||
ij_properties_spaces_around_key_value_delimiter = false | ||
|
||
[.editorconfig] |
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.
inception!
# From https://github.com/pinterest/ktlint#custom-ktlint-specific-editorconfig-properties | ||
# default IntelliJ IDEA style, same as alphabetical, but with "java", "javax", "kotlin" and alias imports in the end of the imports list | ||
ij_kotlin_imports_layout=*,java.**,javax.**,kotlin.**,^ | ||
[*] |
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.
what was the command to generate this file OOI?
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.
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.
TIL, thanks!
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.
LGTM
Draft for testing with the linter on the CI
Type of change
Content
Adds an
.editorconfig
file reflecting the current code styleMotivation and context
Closes #5729
In order to make incremental changes to our current code style, it's best for us to have an initial editorconfig that reflects our current code style that we then make changes to later.
An issue encountered when doing this is there are areas of the project that don't follow even the current code style for reasons such as indentation, wrapping, etc.
Instead of changing these files which would result in a massive diff, I opted for disabling these rules temporarily from the linter for the duration we undergo this code style change.
The editorconfig file found here is one extracted from Android Studio preferences reflecting the current code style. It includes settings for other languages too other than Kotlin. At first I thought we didn't need this and removed them but this resulted in a bug where XML files were unintentionally formatted differently so I decided to keep them all
Screenshots / GIFs
N/A
Tests
The main test here in that the linter passes. See that we have no changes to our autoformatter for different file types (kotlin, xml)
I also tested the app doesn't crash on boot
Tested devices
Checklist