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

Implement new rule ImplictUnitReturnTypet #2781

Merged
merged 4 commits into from
Jun 23, 2020

Conversation

arturbosch
Copy link
Member

@arturbosch arturbosch commented Jun 8, 2020

This rule suggests to use block statements for functions when the return type is of type Unit.

@arturbosch arturbosch force-pushed the new-rule-prefer-block-statement-for-unit branch 2 times, most recently from 11a8c4b to 135cdba Compare June 8, 2020 10:41
@arturbosch arturbosch changed the title Implement rule ExpressionFunctionReturnsUnit Implement new rule ExpressionFunctionReturnsUnit Jun 8, 2020
@codecov
Copy link

codecov bot commented Jun 8, 2020

Codecov Report

Merging #2781 into master will increase coverage by 0.11%.
The diff coverage is 89.65%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2781      +/-   ##
============================================
+ Coverage     80.52%   80.64%   +0.11%     
- Complexity     2335     2350      +15     
============================================
  Files           387      388       +1     
  Lines          6993     7026      +33     
  Branches       1269     1281      +12     
============================================
+ Hits           5631     5666      +35     
+ Misses          726      716      -10     
- Partials        636      644       +8     
Impacted Files Coverage Δ Complexity Δ
...rbosch/detekt/rules/bugs/ImplicitUnitReturnType.kt 88.88% <88.88%> (ø) 11.00 <11.00> (?)
...sch/detekt/rules/providers/PotentialBugProvider.kt 100.00% <100.00%> (ø) 2.00 <0.00> (ø)
...b/arturbosch/detekt/rules/complexity/LongMethod.kt 88.63% <0.00%> (-5.65%) 16.00% <0.00%> (+4.00%) ⬇️
.../main/kotlin/io/gitlab/arturbosch/detekt/Detekt.kt 28.57% <0.00%> (-1.70%) 16.00% <0.00%> (ø%)
...tlab/arturbosch/detekt/DetektCreateBaselineTask.kt 0.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
...tlab/arturbosch/detekt/DetektGenerateConfigTask.kt 0.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
...tlab/arturbosch/detekt/extensions/DetektReports.kt 35.71% <0.00%> (ø) 1.00% <0.00%> (ø%)
...arturbosch/detekt/extensions/CustomDetektReport.kt 0.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
...o/gitlab/arturbosch/detekt/invoke/DetektInvoker.kt 9.67% <0.00%> (+9.67%) 0.00% <0.00%> (ø%)
... and 1 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 82108b7...a226c55. Read the comment docs.

@arturbosch arturbosch force-pushed the new-rule-prefer-block-statement-for-unit branch from e2e136d to cf4b7d3 Compare June 21, 2020 09:54
@arturbosch arturbosch added this to the 1.10.0 milestone Jun 21, 2020
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.

LGTM, just a couple of minor nits

arturbosch and others added 2 commits June 23, 2020 09:42
…/bugs/ImplicitUnitReturnTypeSpec.kt

Co-authored-by: Nicola Corti <corti.nico@gmail.com>
…/bugs/ImplicitUnitReturnTypeSpec.kt

Co-authored-by: Nicola Corti <corti.nico@gmail.com>
@arturbosch arturbosch changed the title Implement new rule ExpressionFunctionReturnsUnit Implement new rule ImplictUnitReturnTypet Jun 23, 2020
@arturbosch arturbosch merged commit dbb5ed1 into master Jun 23, 2020
@arturbosch arturbosch deleted the new-rule-prefer-block-statement-for-unit branch June 23, 2020 08:12
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.

3 participants