Skip to content

Add severity to different md, html reports#9167

Merged
BraisGabin merged 2 commits into
detekt:mainfrom
atulgpt:fixes/9068/include-severity-cli
Mar 26, 2026
Merged

Add severity to different md, html reports#9167
BraisGabin merged 2 commits into
detekt:mainfrom
atulgpt:fixes/9068/include-severity-cli

Conversation

@atulgpt
Copy link
Copy Markdown
Contributor

@atulgpt atulgpt commented Mar 19, 2026

Fixes #9068

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.03%. Comparing base (135b0b2) to head (6d25ec8).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #9167   +/-   ##
=========================================
  Coverage     85.03%   85.03%           
  Complexity     4439     4439           
=========================================
  Files           571      571           
  Lines         12335    12335           
  Branches       2694     2694           
=========================================
  Hits          10489    10489           
  Misses          681      681           
  Partials       1165     1165           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Member

@BraisGabin BraisGabin left a comment

Choose a reason for hiding this comment

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

Can you modify the test issues so they have different severity so we test the different outputs?

Info,
}

fun Severity.prefix() =
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wouldn't add this to our public api. I would probably duplicate this.

span("location") {
text(
"$pathString:${issue.location.source.line}:${issue.location.source.column}"
"${issue.severity.prefix()}: $pathString:${issue.location.source.line}:${issue.location.source.column}"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shall detekt only show a one char prefix or something more descriptive?
CC @BraisGabin

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Error
Warn
Info

might be more understandable for new detekt users.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For html or md, sure. We have plenty of space. For that reason I think that the prefix function shouldn't be shared. Each report may want different wording

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated the logic as per this statement

@atulgpt atulgpt force-pushed the fixes/9068/include-severity-cli branch from 41d2ce9 to 0e3ce47 Compare March 26, 2026 10:37
@atulgpt atulgpt force-pushed the fixes/9068/include-severity-cli branch from 0e3ce47 to 6d25ec8 Compare March 26, 2026 10:41
@atulgpt
Copy link
Copy Markdown
Contributor Author

atulgpt commented Mar 26, 2026

Can you modify the test issues so they have different severity so we test the different outputs?

@BraisGabin Updated the TCs to include different severity

@atulgpt atulgpt requested review from BraisGabin and schalkms March 26, 2026 10:43
@BraisGabin BraisGabin merged commit ad9366c into detekt:main Mar 26, 2026
20 of 21 checks passed
@detekt-ci
Copy link
Copy Markdown
Collaborator

Warnings
⚠️ This PR is approved with no milestone set. If merged, it won't appear in the detekt release notes.

Generated by 🚫 dangerJS against 6d25ec8

@schalkms schalkms added this to the 2.0.0 milestone Mar 26, 2026
@atulgpt atulgpt deleted the fixes/9068/include-severity-cli branch March 26, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include severity in reports

4 participants