Skip to content

Show code snippet erros in html reports #2209

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 3 commits into from
Dec 28, 2019
Merged

Show code snippet erros in html reports #2209

merged 3 commits into from
Dec 28, 2019

Conversation

BraisGabin
Copy link
Member

@BraisGabin BraisGabin commented Dec 28, 2019

This PR is realted with #2134

If an exception is found in the code snippet rendering instead to be too smart, or crash, or hide the error this code shows the error to the user like this:
Captura de pantalla 2019-12-28 a las 14 45 04

The link opens the github issue form with some pre-filled information:
Captura de pantalla 2019-12-28 a las 15 08 42

And github render that information like this:
Captura de pantalla 2019-12-28 a las 15 08 48


Problems in this PR:

  • I don't know how to get the detekt version to autofill it. Any idea?
  • What if the issue is related with a plugin and not with detekt itself? We are saying to the users to report it here. Should we care about this? If we see a spam of issues related with plugins we can remove the link. What do you think?

@codecov-io
Copy link

codecov-io commented Dec 28, 2019

Codecov Report

Merging #2209 into master will increase coverage by 0.21%.
The diff coverage is 95.65%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2209      +/-   ##
============================================
+ Coverage      81.2%   81.41%   +0.21%     
  Complexity     2064     2064              
============================================
  Files           340      340              
  Lines          5910     5934      +24     
  Branches       1076     1077       +1     
============================================
+ Hits           4799     4831      +32     
+ Misses          535      526       -9     
- Partials        576      577       +1
Impacted Files Coverage Δ Complexity Δ
...otlin/io/gitlab/arturbosch/detekt/core/Detektor.kt 48.78% <0%> (ø) 5 <0> (ø) ⬇️
...tlab/arturbosch/detekt/cli/out/HtmlOutputReport.kt 91.93% <100%> (ø) 17 <0> (ø) ⬇️
...lin/io/gitlab/arturbosch/detekt/core/DebugUtils.kt 58.33% <100%> (+58.33%) 0 <0> (ø) ⬇️
...n/io/gitlab/arturbosch/detekt/cli/out/HtmlUtils.kt 98.07% <97.67%> (+5.21%) 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 3d4ea24...ad5f29e. 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.

Cool, looks really good.

  1. In detekt-core we have whichDetekt() to get the version.
  2. Lets see what will be reported.

@BraisGabin
Copy link
Member Author

whichDetekt() was exactly what I needed. Done, ready to review :).

@arturbosch arturbosch added this to the 1.3.1 milestone Dec 28, 2019
@arturbosch arturbosch merged commit 5f3b47e into detekt:master Dec 28, 2019
@BraisGabin BraisGabin deleted the show-code-snippet-erros branch December 28, 2019 20:44
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