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

Disable wildcard imports #344

Merged
merged 1 commit into from
Dec 23, 2021
Merged

Conversation

nielsvanvelzen
Copy link
Member

I remember not doing this before because the editorconfig didn't work in IntelliJ/Android Studio. It works now though. I think it's because of the ij_kotlin_packages_to_use_import_on_demand rule.

  • Enable Detekt WildcardImport rule
  • Update .editorconfig to "disable" automatic wildcard imports in IntelliJ based editors
    • Uses a value of 1000 imports from the same package, which should hopefully never be reached in a single file
    • Set the packages to always use wildcard imports to an empty string
  • Updated all project imports to remove wildcards

Copy link
Member

@Maxr1998 Maxr1998 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's pretty nice, I didn't know about the ij_kotlin_packages_to_use_import_on_demand rule. Have to use that in my own projects 👀

@Maxr1998 Maxr1998 merged commit 012f76f into jellyfin:master Dec 23, 2021
@nielsvanvelzen
Copy link
Member Author

Yeah it took some time to figure those out, there's not much documentation about Intellij's rules unfortunately.

@nielsvanvelzen nielsvanvelzen deleted the import-wildcard branch December 23, 2021 12:42
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.

2 participants