-
Notifications
You must be signed in to change notification settings - Fork 508
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
(rule):allow wildcard imports via editorconfig #61
Conversation
while some people might not like wildcard imports, importing things like an entire enum class via a wildcard is acceptable in most styleguides. this PR adds an editorconfig option to override the default wildcard functionality.
this is related to #48 while it's not up to this tool to be opinionated about IDEs, i think an override option is valid. |
When will this pull request get merged? Android Studio cannot auto-import static functions, so wildcard import would be very convenient at this stage. |
It's very interesting that none of the Mockito static methods, like |
but, anyway, JetBrains IDE can optimize imports on the fly, e.g. if there are many classes from the same package, IDE will auto convert the imports to wildcard import. It would be great to use the IDE feature, rather than import the classes one-by-one |
(unrelated to PR) @jackylimel https://github.com/shyiko/ktlint#-with-intellij-idea contains info on how to turn
off (either manually or in completely automated fashion ( |
I still don't understand why you have a strong opinion again this PR. |
@jackylimel #48 (comment) |
+1 |
import kotlinx.android.synthetic.main.layout_name.* | ||
""".trimIndent(), | ||
mapOf("allow_wildcard_imports" to "true") | ||
)).isEqualTo(listOf<LintError>()) |
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.
What about using "emptyList()"?
This reverts commit ed26117. As per discussion from the GitHub issue [1], the default continuation indent for Android should be 8 rather than 4. This matches the Android Kotlin style guide. [1] pinterest#120
…n-indent Revert "Changed continuation_indent_size to 4"
@aem could you catch up with master branch ? That would be very helpful to have an updated version of this branch and SHA1 to refer to in our local snapshot. I hope your branch gets merged one day |
@sebastienrouif sure, i'll resolve conflicts and update later today. |
@sebastienrouif @shyiko updated to latest master |
Any news? |
@aem how is it going with this? |
@iTomkinas please see the discussion in #48. Simply put, it's the maintainer's decision about whether or not this is a valid inclusion in the linter, and if it is valid whether an editorconfig line is the right way to implement it. I made my proposed solution and it seems like it's not the approach the maintainer would choose themselves. I've left the PR open in case that decision is reversed, or in case someone would like to fork the project and include this patch on their own. |
it was decided this isn't a valid lint rule. closing this PR to indicate that the issue has been thoroughly discussed and reached its natural conclusion. |
while some people might not like wildcard imports, importing things like
an entire enum class via a wildcard is acceptable in most styleguides.
this PR adds an editorconfig option to override the default wildcard
functionality.