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

Clarify WildcardImport rule configuration #1888

Merged
merged 3 commits into from
Sep 4, 2019
Merged

Clarify WildcardImport rule configuration #1888

merged 3 commits into from
Sep 4, 2019

Conversation

AlexCzar
Copy link
Contributor

@AlexCzar AlexCzar commented Sep 2, 2019

Add information about conflict between formatting: NoWildcardImports and style: WildcardImport rules.

There is a conflict between formatting: NoWildcardImports and style: WildcardImport , effectively the latter and its configuration do not matter when former is enabled. This PR adds a note about the fact to the documentation.

Add information about conflict between `formatting:``NoWildcardImports` and `style:``WildcardImport` rules.
@@ -1410,6 +1410,11 @@ Library updates can introduce naming clashes with your own classes which might r
Define a whitelist of package names that should be allowed to be imported
with wildcard imports.

**NOTE:** This rule conflicts with `NoWildcardImports` formatting rule.
Copy link
Member

Choose a reason for hiding this comment

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

I do believe that conflicts here is probably not the best term.

I would rephrase with something like:

Suggested change
**NOTE:** This rule conflicts with `NoWildcardImports` formatting rule.
**NOTE:** This rule is similar to the `NoWildcardImports` formatting rule (a wrapper of a KtLint rule).
If you need to specify a `excludeImports` configuration, please consider disabling the other rule.

Or something like that.

Copy link
Contributor Author

@AlexCzar AlexCzar Sep 2, 2019

Choose a reason for hiding this comment

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

I like the wrapper clarification suggestion.
Regarding conflict/similarity: this pull request was born exactly because of the conflict between these two rules and confusion surrounding it. Yes they are indeed similar, but they are also in conflict and the most restrictive one wins.
I have adjusted the wording a bit based on @cortinico 's comment.

Copy link
Member

@schalkms schalkms left a comment

Choose a reason for hiding this comment

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

@AlexCzar We are really thankful for this doc improvement. Can you please checkout the source file of the WildcardImportRule and add this to the documentation there?
We generate the Markdown documentation for our website based on these source files. This means you need to execute gradle build once on your local machine.

A bit of a language adjustment for the rule clash description.
@schalkms schalkms merged commit 4acd9ef into detekt:master Sep 4, 2019
@arturbosch arturbosch added this to the 1.0.2 milestone Sep 6, 2019
sowmyav24 pushed a commit to sowmyav24/detekt that referenced this pull request Sep 17, 2019
* Clarify `WildcardImport` rule configuration

Add information about conflict between `formatting:``NoWildcardImports` and `style:``WildcardImport` rules.

* NoWildcardImports/WildcardImport clash wording

A bit of a language adjustment for the rule clash description.

* Regenerate rules documentation (style.md)
sowmyav24 pushed a commit to sowmyav24/detekt that referenced this pull request Sep 17, 2019
* Clarify `WildcardImport` rule configuration

Add information about conflict between `formatting:``NoWildcardImports` and `style:``WildcardImport` rules.

* NoWildcardImports/WildcardImport clash wording

A bit of a language adjustment for the rule clash description.

* Regenerate rules documentation (style.md)
@arturbosch arturbosch modified the milestones: 1.0.2, 1.1.0 Sep 17, 2019
smyachenkov pushed a commit to smyachenkov/detekt that referenced this pull request Dec 9, 2019
* Clarify `WildcardImport` rule configuration

Add information about conflict between `formatting:``NoWildcardImports` and `style:``WildcardImport` rules.

* NoWildcardImports/WildcardImport clash wording

A bit of a language adjustment for the rule clash description.

* Regenerate rules documentation (style.md)
smyachenkov pushed a commit to smyachenkov/detekt that referenced this pull request Dec 9, 2019
* Clarify `WildcardImport` rule configuration

Add information about conflict between `formatting:``NoWildcardImports` and `style:``WildcardImport` rules.

* NoWildcardImports/WildcardImport clash wording

A bit of a language adjustment for the rule clash description.

* Regenerate rules documentation (style.md)
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.

4 participants