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

Exit process with specific code when detekt finds code issues #1508

Merged
merged 1 commit into from
Feb 27, 2019

Conversation

3flex
Copy link
Member

@3flex 3flex commented Feb 23, 2019

Closes #1493

detekt will exit with one of the following exit codes:

Exit code Description
0 detekt ran normally and maxIssues or failThreshold count was not reached in BuildFailureReport.
1 An unexpected error occurred
2 maxIssues or failThreshold count was reached in BuildFailureReport.

Copy link
Contributor

@vanniktech vanniktech left a comment

Choose a reason for hiding this comment

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

No unit tets?

@codecov-io
Copy link

codecov-io commented Feb 23, 2019

Codecov Report

Merging #1508 into master will decrease coverage by 0.08%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1508      +/-   ##
============================================
- Coverage     74.81%   74.72%   -0.09%     
  Complexity     1737     1737              
============================================
  Files           328      328              
  Lines          5280     5286       +6     
  Branches        961      961              
============================================
  Hits           3950     3950              
- Misses          805      811       +6     
  Partials        525      525
Impacted Files Coverage Δ Complexity Δ
...ain/kotlin/io/gitlab/arturbosch/detekt/cli/Main.kt 0% <0%> (ø) 0 <0> (ø) ⬇️
...tlin/io/gitlab/arturbosch/detekt/cli/JCommander.kt 0% <0%> (ø) 0 <0> (ø) ⬇️

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 4a08c7c...5d86f0b. Read the comment docs.

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.

I think the error description should also be added to the documentation.

@3flex
Copy link
Member Author

3flex commented Feb 24, 2019

I looked into testing but it's a little tricky: https://stackoverflow.com/questions/309396/java-how-to-test-methods-that-call-system-exit

I'll be working on #1435 next and integration tests will cover the exit codes 1 & 2.

Will update comments and docs according to your suggestions, thanks!

@arturbosch arturbosch merged commit aaaabb1 into detekt:master Feb 27, 2019
@arturbosch arturbosch added this to the RC15 milestone Feb 27, 2019
@3flex 3flex deleted the 1493-fix branch February 27, 2019 23:51
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.

5 participants