Skip to content

ThrowingExceptionInMain: fix #2248 and add tests #2240

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

Merged
merged 8 commits into from
Jan 12, 2020
Merged

ThrowingExceptionInMain: fix #2248 and add tests #2240

merged 8 commits into from
Jan 12, 2020

Conversation

schalkms
Copy link
Member

@schalkms schalkms commented Jan 10, 2020

Fixes #2248

This PR adds test cases for main functions inside classes w/o @JvmStatic annotation.
This PR adds test cases for main functions inside objects w/o @JvmStatic annotation.
@codecov-io
Copy link

codecov-io commented Jan 10, 2020

Codecov Report

Merging #2240 into master will increase coverage by 0.04%.
The diff coverage is 60%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2240      +/-   ##
============================================
+ Coverage     81.37%   81.41%   +0.04%     
- Complexity     2073     2077       +4     
============================================
  Files           343      345       +2     
  Lines          5981     5989       +8     
  Branches       1086     1084       -2     
============================================
+ Hits           4867     4876       +9     
  Misses          532      532              
+ Partials        582      581       -1
Impacted Files Coverage Δ Complexity Δ
...detekt/rules/exceptions/ThrowingExceptionInMain.kt 83.33% <50%> (+13.33%) 6 <4> (-4) ⬇️
.../gitlab/arturbosch/detekt/rules/MethodSignature.kt 50% <66.66%> (-10%) 0 <0> (ø)
...turbosch/detekt/rules/style/UnusedPrivateMember.kt 93.47% <0%> (ø) 5% <0%> (ø) ⬇️
...osch/detekt/rules/bugs/WrongEqualsTypeParameter.kt 100% <0%> (ø) 10% <0%> (+3%) ⬆️
...rmatting/wrappers/NoEmptyFirstLineInMethodBlock.kt 100% <0%> (ø) 2% <0%> (?)
...ch/detekt/formatting/wrappers/EnumEntryNameCase.kt 100% <0%> (ø) 2% <0%> (?)
...itlab/arturbosch/detekt/core/ProcessingSettings.kt 89.83% <0%> (+0.17%) 19% <0%> (+1%) ⬆️
...osch/detekt/api/internal/KotlinEnvironmentUtils.kt 86.27% <0%> (+0.27%) 0% <0%> (ø) ⬇️
.../io/gitlab/arturbosch/detekt/cli/runners/Runner.kt 87.23% <0%> (+0.27%) 10% <0%> (ø) ⬇️
...ab/arturbosch/detekt/formatting/KtLintMultiRule.kt 87.75% <0%> (+0.52%) 6% <0%> (ø) ⬇️
... 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 c44f8c2...b7f1b7c. Read the comment docs.

@BraisGabin
Copy link
Member

The test does not report top level main functions with a wrong signature has the same problem. I know that you didn't change it, but it would be good to fix it too,

@schalkms schalkms changed the title Add tests for ThrowingExceptionInMain rule ThrowingExceptionInMain: fix #2248 and add tests Jan 11, 2020
@3flex 3flex merged commit 5c0bdda into detekt:master Jan 12, 2020
@arturbosch arturbosch added this to the 1.4.0 milestone Jan 12, 2020
@schalkms schalkms deleted the tests-ThrowingExceptionInMain branch January 12, 2020 19:52
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.

ThrowingExceptionInMain rule should consider main() function with no parameters
5 participants