nowinandroid icon indicating copy to clipboard operation
nowinandroid copied to clipboard

Apply Android Studio Code Styles Ktlint

Open Jaehwa-Noh opened this issue 1 year ago • 3 comments

What I have done and why

Set Ktlint style android_studio to follow Google’s Android coding standards for source code Remove editorConfigOverride and set ktlint_code_style android_studio in editorconfig.

  • Move editorConfigOverride android (deprecated) to editorconfig.

-a or --android: Turn on Android Kotlin Style Guide compatibility. This flag is most likely to be removed in a future version. Use .editorconfig ktlint_code_style.

  • Set ktlint_code_style android_studio link
  • Add root=true in .editorconfig. link

root: special property that should be specified at the top of the file outside of any sections. Set to true to stop .editorconfig files search on current file.

Need to discussion about:

  • rule: standard:max-line-length link
  • import alphabetic ordering link

Android Studio style ktlint was set max-line-length(100) and alphabetic ordering imports as default value. If you don't agree with these two rules. Kindly leave your comment.

If it is fine, merge it!

Fix #1362

How I'm testing it

Choose at least one:

  • Unit tests
  • UI tests
  • Screenshot tests
  • [x] N/A (provide justification)

Jaehwa-Noh avatar Mar 31 '24 05:03 Jaehwa-Noh

This PR has many conflicts due to the updated style. This is likely going to cause cascading issues with existing contributors that use the existing code style. Let's hold off updating and merging this for now.

@dturner FYI

keyboardsurfer avatar Dec 09 '24 12:12 keyboardsurfer

It makes sense to use the android_studio code style so I'm happy for us to merge this once the conflicts have been resolved.

@Jaehwa-Noh are you happy to do that?

dturner avatar Dec 19 '24 13:12 dturner

@dturner Yes, I'm very welcome to do that.

Jaehwa-Noh avatar Dec 20 '24 05:12 Jaehwa-Noh