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

(rule):allow wildcard imports via editorconfig #61

Closed
wants to merge 5 commits into from

Conversation

aem
Copy link

@aem aem commented Jun 29, 2017

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.

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.
@aem
Copy link
Author

aem commented Jun 29, 2017

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.

@liangfenxiaodao
Copy link

When will this pull request get merged?

Android Studio cannot auto-import static functions, so wildcard import would be very convenient at this stage.

@shyiko
Copy link
Collaborator

shyiko commented Aug 28, 2017

@jackylimel

imageedit_2_7341367885

peek 2017-08-28 05-46

@liangfenxiaodao
Copy link

It's very interesting that none of the Mockito static methods, like when, or verify, can be auto-imported..

@liangfenxiaodao
Copy link

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

@shyiko
Copy link
Collaborator

shyiko commented Aug 30, 2017

(unrelated to PR)

@jackylimel https://github.com/shyiko/ktlint#-with-intellij-idea contains info on how to turn

IDE will auto convert the imports to wildcard import

off (either manually or in completely automated fashion (ktlint --apply-to-idea)).

@liangfenxiaodao
Copy link

I still don't understand why you have a strong opinion again this PR.

@shyiko
Copy link
Collaborator

shyiko commented Aug 30, 2017

@jackylimel #48 (comment)

@henrik242
Copy link

+1

import kotlinx.android.synthetic.main.layout_name.*
""".trimIndent(),
mapOf("allow_wildcard_imports" to "true")
)).isEqualTo(listOf<LintError>())

Choose a reason for hiding this comment

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

What about using "emptyList()"?

bradmcmanus and others added 2 commits January 3, 2018 13:00
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"
@sebastienrouif
Copy link

@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

@aem
Copy link
Author

aem commented Jan 9, 2018

@sebastienrouif sure, i'll resolve conflicts and update later today.

@aem
Copy link
Author

aem commented Jan 11, 2018

@sebastienrouif @shyiko updated to latest master

@neworld
Copy link

neworld commented Jun 20, 2018

Any news?

@iTomkinas
Copy link

@aem how is it going with this?

@aem
Copy link
Author

aem commented Sep 19, 2018

@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.

@aem
Copy link
Author

aem commented Dec 3, 2018

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.

@aem aem closed this Dec 3, 2018
@aem aem deleted the aem/patch/allow-wildcard branch December 3, 2018 14:30
@shashachu shashachu mentioned this pull request May 22, 2019
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.

9 participants