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

Apply Android Studio Code Styles Ktlint #1350

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

Jaehwa-Noh
Copy link
Contributor

@Jaehwa-Noh Jaehwa-Noh commented Mar 31, 2024

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
  • N/A (provide justification)

Change-Id: I62af44804812e55876cbec4e49898a22ebc376a6
Change-Id: I1a67953a63cda462ddaa3a36e5194f2f3196c9ba
Change-Id: Id0c411f2f592ba0f30bd4c10370129ecc10b4c43
Change-Id: Ia9b44fcd6242ba4c85814f88326e06b88f310d6b
Change-Id: I148afca4a4521021a0f881614e4e2e46b05f6e63
Change-Id: I893dd5f7f4967d8d7752484453e37637c08e862c
@Jaehwa-Noh Jaehwa-Noh changed the title Remove editorConfigOverride and set ktlint_code_style android_studio in editorconfig. Apply Android Studio Code Styles Ktlint Apr 2, 2024
Change-Id: If6c285b4ee4c4a5b1464d0439afa2f014947f932
Change-Id: If8d885f5d5a9561dcb57621d1ab0d957618230bf
Change-Id: I949188a967b213598a8f4e3d4a34ac295788ab56

# Conflicts:
#	app/src/main/kotlin/com/google/samples/apps/nowinandroid/ui/interests2pane/InterestsListDetailScreen.kt
Change-Id: Ib7b0ede9a43540a035f804c0d5aa8ae1760cd5e4
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

Successfully merging this pull request may close these issues.

[Bug]: Current project is not applied android_studio style ktlint
1 participant