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 allowElseExpression configuration for MissingWhenCase rule #3187

Merged
merged 6 commits into from
Nov 1, 2020

Conversation

sowmyav24
Copy link
Contributor

Fixes #3176

  • Add allowElseExpression and default it to true.
  • Refactor report generation
  • Added tests

@codecov
Copy link

codecov bot commented Oct 31, 2020

Codecov Report

Merging #3187 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #3187   +/-   ##
=========================================
  Coverage     79.55%   79.56%           
- Complexity     2631     2632    +1     
=========================================
  Files           440      440           
  Lines          7964     7967    +3     
  Branches       1521     1520    -1     
=========================================
+ Hits           6336     6339    +3     
  Misses          818      818           
  Partials        810      810           
Impacted Files Coverage Δ Complexity Δ
...ab/arturbosch/detekt/rules/bugs/MissingWhenCase.kt 90.62% <100.00%> (+0.96%) 11.00 <4.00> (+1.00)

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...8d88081. 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 work.

@arturbosch arturbosch added this to the 1.15.0 milestone Oct 31, 2020
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 for this PR! Please see my attached comments, which only remarks the formatting of a few lines.

@schalkms schalkms merged commit 8001c0a into detekt:master Nov 1, 2020
arturbosch pushed a commit that referenced this pull request Nov 15, 2020
* Add allowElseExpression configuration for MissingWhenCase rule

* Add test for non enum, sealed when cases

* Update function name to report missing cases

Co-authored-by: Nicola Corti <corti.nico@gmail.com>

* Update documentation and remove redundant variable

* Fix discrepency while commiting from github

* Fix formatting issues in test classes

Co-authored-by: Nicola Corti <corti.nico@gmail.com>
arturbosch pushed a commit that referenced this pull request Dec 21, 2020
* Add allowElseExpression configuration for MissingWhenCase rule

* Add test for non enum, sealed when cases

* Update function name to report missing cases

Co-authored-by: Nicola Corti <corti.nico@gmail.com>

* Update documentation and remove redundant variable

* Fix discrepency while commiting from github

* Fix formatting issues in test classes

Co-authored-by: Nicola Corti <corti.nico@gmail.com>
arturbosch pushed a commit that referenced this pull request Jan 16, 2021
* Add allowElseExpression configuration for MissingWhenCase rule

* Add test for non enum, sealed when cases

* Update function name to report missing cases

Co-authored-by: Nicola Corti <corti.nico@gmail.com>

* Update documentation and remove redundant variable

* Fix discrepency while commiting from github

* Fix formatting issues in test classes

Co-authored-by: Nicola Corti <corti.nico@gmail.com>
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.

ListAllWhenCases new rule
5 participants