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

Less noisy output for detekt with Type solving #4423

Merged
merged 2 commits into from Jan 5, 2022
Merged

Less noisy output for detekt with Type solving #4423

merged 2 commits into from Jan 5, 2022

Conversation

BraisGabin
Copy link
Member

@BraisGabin BraisGabin commented Dec 29, 2021

This PR changes this output:

> Task :detekt-parser:detektTest
//Users/brais.gabin/Workspace/detekt/detekt-parser/src/test/kotlin/io/github/detekt/parser/KotlinEnvironmentUtilsSpec.kt:23:50: error: cannot access 'getKotlinLanguageVersion': it is internal in 'io.github.detekt.parser'
            val languageVersion = classpathFiles.getKotlinLanguageVersion()
                                                 ^
//Users/brais.gabin/Workspace/detekt/detekt-parser/src/test/kotlin/io/github/detekt/parser/KtCompilerSpec.kt:82:33: error: cannot access 'determineLineSeparator': it is internal in 'io.github.detekt.parser'
            assertThat("1\r\n2".determineLineSeparator()).isEqualTo("\r\n")
                                ^
//Users/brais.gabin/Workspace/detekt/detekt-parser/src/test/kotlin/io/github/detekt/parser/KtCompilerSpec.kt:86:31: error: cannot access 'determineLineSeparator': it is internal in 'io.github.detekt.parser'
            assertThat("1\n2".determineLineSeparator()).isEqualTo("\n")
                              ^
//Users/brais.gabin/Workspace/detekt/detekt-parser/src/test/kotlin/io/github/detekt/parser/KtCompilerSpec.kt:90:31: error: cannot access 'determineLineSeparator': it is internal in 'io.github.detekt.parser'
            assertThat("1\r2".determineLineSeparator()).isEqualTo("\r")
                              ^

To this one:

> Task :detekt-parser:detektTest
The BindingContext was created with 4 issues. Run detekt with --debug to see the error messages.

It isn't a real fix. We shouldn't have those compilation errors, but at least now they are hidden behind --debug

Any idea to improve this message is more than welcome:

The BindingContext was created with 4 issues. Run detekt with --debug to see the error messages.

closes #3684

@BraisGabin BraisGabin added the notable changes Marker for notable changes in the changelog label Dec 29, 2021
@BraisGabin BraisGabin added this to the 1.20.0 milestone Dec 29, 2021
@codecov
Copy link

codecov bot commented Dec 29, 2021

Codecov Report

Merging #4423 (b0ab4c1) into main (eb0f1cf) will decrease coverage by 0.02%.
The diff coverage is 61.11%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #4423      +/-   ##
============================================
- Coverage     84.32%   84.30%   -0.03%     
  Complexity     3293     3293              
============================================
  Files           472      472              
  Lines         10522    10531       +9     
  Branches       1885     1886       +1     
============================================
+ Hits           8873     8878       +5     
- Misses          671      675       +4     
  Partials        978      978              
Impacted Files Coverage Δ
...io/gitlab/arturbosch/detekt/core/BindingContext.kt 41.17% <58.82%> (+5.17%) ⬆️
...gitlab/arturbosch/detekt/core/tooling/Lifecycle.kt 100.00% <100.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 eb0f1cf...b0ab4c1. 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.

Nice fix! This problem really annoyed users when debugging detekt or any other console output. Please see my comment regarding tests. Otherwise, this PR looks great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notable changes Marker for notable changes in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Noisy output of detekt on type solving mode
3 participants