-
Notifications
You must be signed in to change notification settings - Fork 503
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
Remove default for allowed wildcard imports in ktlint_official
codestyle
#1797
Comments
The feature to respect setting ij_kotlin_packages_to_use_import_on_demand was implemented not too long ago in ktlint 0.45.x via #1272. The reason for adding the default values is that they seems to be hard-coded in IntelliJ IDEA as well (https://github.com/JetBrains/kotlin/blob/ffdab473e28d0d872136b910eb2e0f4beea2e19c/idea/formatter/src/org/jetbrains/kotlin/idea/core/formatter/KotlinCodeStyleSettings.java#L81-L82). If the property is not set explicitly, IntelliJ IDEA allows imports java.util.* and kotlinx.android.synthetic.*. If ktlint would not do the same, this would result in a conclict between ktlint and IntelliJ IDEA. Lots of users of ktlint dislike that. In the new codestyle |
Removing the default value for code To keep KtLint and IntelliJ IDEA formatter in sync, it is needed to set
|
* For the new code style `ktlint_official`, do not allow wildcard imports `java.util` and `kotlinx.android.synthetic` by default * Fix propagation of CODE_STYLE_PROPERTY to the EditorConfig so that the correct default can be determined * Set 'ij_kotlin_packages_to_use_import_on_demand' to 'unset' to comply with this new default and resolve lint violation. * When generating the '.editorconfig' file generate value "unset" for property 'ij_kotlin_packages_to_use_import_on_demand' in case the list of on demand imports is empty. * Closes #1797
Originally posted by @greg-patterson in #1792 (comment)
The text was updated successfully, but these errors were encountered: