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

Add UseIfEmptyOrIfBlank rule #3186

Merged
merged 7 commits into from
Nov 4, 2020
Merged

Add UseIfEmptyOrIfBlank rule #3186

merged 7 commits into from
Nov 4, 2020

Conversation

t-kameyama
Copy link
Contributor

Fixes #2840

@codecov
Copy link

codecov bot commented Oct 30, 2020

Codecov Report

Merging #3186 into master will increase coverage by 0.27%.
The diff coverage is 88.13%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3186      +/-   ##
============================================
+ Coverage     79.55%   79.83%   +0.27%     
+ Complexity     2631     2630       -1     
============================================
  Files           440      440              
  Lines          7964     8010      +46     
  Branches       1521     1538      +17     
============================================
+ Hits           6336     6395      +59     
+ Misses          818      791      -27     
- Partials        810      824      +14     
Impacted Files Coverage Δ Complexity Δ
...otlin/io/gitlab/arturbosch/detekt/core/Analyzer.kt 67.64% <ø> (ø) 6.00 <0.00> (ø)
...b/arturbosch/detekt/core/config/CompositeConfig.kt 66.66% <ø> (ø) 5.00 <0.00> (?)
...ab/arturbosch/detekt/core/config/Configurations.kt 83.33% <ø> (ø) 0.00 <0.00> (ø)
...lab/arturbosch/detekt/core/config/DefaultConfig.kt 100.00% <ø> (ø) 2.00 <0.00> (ø)
...kt/core/config/DefaultPropertiesConfigValidator.kt 100.00% <ø> (ø) 1.00 <0.00> (ø)
...ch/detekt/core/config/DisabledAutoCorrectConfig.kt 44.44% <ø> (ø) 5.00 <0.00> (?)
...ab/arturbosch/detekt/core/config/FailFastConfig.kt 36.36% <ø> (ø) 5.00 <0.00> (?)
...sch/detekt/core/config/ValidatableConfiguration.kt 96.87% <ø> (ø) 0.00 <0.00> (?)
...gitlab/arturbosch/detekt/core/config/YamlConfig.kt 76.00% <ø> (ø) 9.00 <0.00> (?)
...etekt/rules/coroutines/RedundantSuspendModifier.kt 59.09% <ø> (ø) 20.00 <0.00> (ø)
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update da6259a...9aa30b5. Read the comment docs.

Copy link
Member

@BraisGabin BraisGabin left a comment

Choose a reason for hiding this comment

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

Nice!

Copy link
Member

@cortinico cortinico left a comment

Choose a reason for hiding this comment

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

Great addition 🚀

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.

Great PR! Thank you very much! 🙂
Please allow me to have a few questions. Please see my attached comments.

@t-kameyama t-kameyama requested a review from schalkms October 31, 2020 22:40
@schalkms
Copy link
Member

schalkms commented Nov 2, 2020

The compile-test-snippets pre-merge check fails. This weird error can be mitigated by using different class or package names for the test-snippets.

@arturbosch arturbosch added this to the 1.15.0 milestone Nov 2, 2020
@t-kameyama t-kameyama force-pushed the issue_2840 branch 5 times, most recently from aef9ea9 to 52b48e7 Compare November 2, 2020 23:54
@t-kameyama
Copy link
Contributor Author

The compile-test-snippets pre-merge check fails. This weird error can be mitigated by using different class or package names for the test-snippets.

Fixed in 9aa30b5.

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.

Thanks

@schalkms schalkms merged commit f0cb1aa into detekt:master Nov 4, 2020
@t-kameyama t-kameyama deleted the issue_2840 branch November 4, 2020 11:10
sowmyav24 pushed a commit to sowmyav24/detekt that referenced this pull request Nov 8, 2020
* Add UseIfEmptyOrIfBlank rule

* Fix typo

* Fix description

* Fix code style

* Add tests

* Report even if condition has  negate operator

* Fix SpacingBetweenPackageAndImportsSpec
arturbosch pushed a commit that referenced this pull request Nov 15, 2020
* Add UseIfEmptyOrIfBlank rule

* Fix typo

* Fix description

* Fix code style

* Add tests

* Report even if condition has  negate operator

* Fix SpacingBetweenPackageAndImportsSpec
arturbosch pushed a commit that referenced this pull request Dec 21, 2020
* Add UseIfEmptyOrIfBlank rule

* Fix typo

* Fix description

* Fix code style

* Add tests

* Report even if condition has  negate operator

* Fix SpacingBetweenPackageAndImportsSpec
arturbosch pushed a commit that referenced this pull request Jan 16, 2021
* Add UseIfEmptyOrIfBlank rule

* Fix typo

* Fix description

* Fix code style

* Add tests

* Report even if condition has  negate operator

* Fix SpacingBetweenPackageAndImportsSpec
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.

Add a rule to flag places where ifBlank and ifEmpty can be used
5 participants