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

Do not allow any wildcard import in code style ktlint_official #1852

Merged
merged 5 commits into from
Mar 12, 2023

Conversation

paul-dingemans
Copy link
Collaborator

Description

For the new code style ktlint_official, do not allow wildcard imports java.util and kotlinx.android.synthetic by default.

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.

Also, set ij_kotlin_packages_to_use_import_on_demand to unset in the KtLint project .editorconfig itself to comply with this new default and resolve lint violation.

Closes #1797

Checklist

  • PR description added
  • tests are added
  • KtLint has been applied on source code itself and violations are fixed
  • documentation is updated
  • CHANGELOG.md is updated

In case of adding a new rule:

…ts `java.util` and `kotlinx.android.synthetic` by default

* 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.
@paul-dingemans paul-dingemans added this to the 0.49.0 milestone Mar 12, 2023
@paul-dingemans paul-dingemans merged commit 7087585 into master Mar 12, 2023
@paul-dingemans paul-dingemans deleted the 1797-no-wildcard-imports-default branch March 12, 2023 20:15
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.

Remove default for allowed wildcard imports in ktlint_official codestyle
1 participant