-
Notifications
You must be signed in to change notification settings - Fork 28
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
fix: migrate to 0.49.0 #40
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.
Thanks for your contribution. Did you try the changes on some repository?
else | ||
export ANDROID="--code-style=intellij_idea" | ||
fi |
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.
Is this the default value? Does it make sense to remove this branch completely?
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.
It depends... Right now, it is a real default value. But later they will make another by default - their own ruleset, something like a mix of Kotlin and Android conventions. So it will break interoperability. To prevent that, I have specified the current default for future updates
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.
Paragraph "'Ktlint Official` code style and renaming of existing code styles" in ktlint changelog you can find in PR desc.
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.
Alright... we can only hope that they don't come up with more breaking changes.
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.
@berhram @ghaiszaher Unfortunately that breaks code styling for android. Apparently --code-style=android_studio
is incorrect and it should still be --android
Edit: Thanks @ghaiszaher for suggestion of checking .editorconfig configuration - will verify and get back
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.
Thanks @berhram ! In fact that was problem in our editorconfig. We did not specify ktlint_code_style
in .editorconfig
at all and relied only on --android
parameter (which seemed to work fine pre 0.49.0).
Now after adding
[*.{kt, kts}]
// ...
ktlint_code_style = android_studio
it is totally fine
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.
@berhram trying locally with version 0.49.0, it seems that the flag --code-style=android_studio
is ineffective and it only works if .editorconfig
is modified with ktlint_code_style = android_studio
(then the flag --code-style
is not needed at all). Do you know what's up with that?
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.
Preparing a revert: #41
--android
seems to be working fine with latest version.
Update: raising an issue pinterest/ktlint#1982
This reverts commit cc99a1f.
Tried to do migration to new version of ktlint сonsidering backward compatibility
https://github.com/pinterest/ktlint/releases/tag/0.49.0