Skip to content

Add UseIfEmptyOrIfBlank rule#3186

Merged
schalkms merged 7 commits into
detekt:masterfrom
t-kameyama:issue_2840
Nov 4, 2020
Merged

Add UseIfEmptyOrIfBlank rule#3186
schalkms merged 7 commits into
detekt:masterfrom
t-kameyama:issue_2840

Conversation

@t-kameyama

Copy link
Copy Markdown
Contributor

Fixes #2840

@codecov

codecov Bot commented Oct 30, 2020

Copy link
Copy Markdown

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.

@BraisGabin BraisGabin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice!

@cortinico cortinico left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great addition 🚀

@schalkms schalkms left a comment

Copy link
Copy Markdown
Member

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.

Comment thread docs/pages/documentation/style.md Outdated
@t-kameyama t-kameyama requested a review from schalkms October 31, 2020 22:40
@schalkms

schalkms commented Nov 2, 2020

Copy link
Copy Markdown
Member

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
Copy Markdown
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.

@schalkms schalkms left a comment

Copy link
Copy Markdown
Member

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