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

Support guard clause exclusion for ThrowsCount rule #2025

Merged
merged 2 commits into from Oct 28, 2019
Merged

Support guard clause exclusion for ThrowsCount rule #2025

merged 2 commits into from Oct 28, 2019

Conversation

madhead
Copy link
Contributor

@madhead madhead commented Oct 16, 2019

PR for #2006.

@codecov-io
Copy link

codecov-io commented Oct 16, 2019

Codecov Report

Merging #2025 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master   #2025      +/-   ##
===========================================
+ Coverage     80.68%   80.7%   +0.02%     
- Complexity     1985    1991       +6     
===========================================
  Files           329     329              
  Lines          5591    5597       +6     
  Branches       1021    1022       +1     
===========================================
+ Hits           4511    4517       +6     
  Misses          539     539              
  Partials        541     541
Impacted Files Coverage Δ Complexity Δ
...itlab/arturbosch/detekt/rules/style/ThrowsCount.kt 100% <100%> (ø) 11 <3> (+6) ⬆️

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 d99550d...5447de8. Read the comment docs.

Copy link
Member

@arturbosch arturbosch left a comment

Choose a reason for hiding this comment

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

I like it, thanks!

val count = function
.collectDescendantsOfType<KtThrowExpression>()
.filterNot {
excludeGuardClauses && it.isGuardClause()
Copy link
Member

Choose a reason for hiding this comment

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

nit: can we put this line on the same as filterNot ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@arturbosch arturbosch added this to the 1.2.0 milestone Oct 28, 2019
@arturbosch arturbosch merged commit 12c7738 into detekt:master Oct 28, 2019
smyachenkov pushed a commit to smyachenkov/detekt that referenced this pull request Dec 9, 2019
* Support guard clause exclusion for ThrowsCount rule

* Fix feedback issues
smyachenkov pushed a commit to smyachenkov/detekt that referenced this pull request Dec 9, 2019
* Support guard clause exclusion for ThrowsCount rule

* Fix feedback issues
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.

None yet

3 participants