Skip to content

Commit

Permalink
Merge pull request #3 from angelobernardi/feature/SeverityToConsoleOu…
Browse files Browse the repository at this point in the history
…tput

feat: add the issue severity to console messages.
  • Loading branch information
felipebz committed Mar 22, 2023
2 parents df1dcf5 + c07b7b7 commit f2c0027
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/kotlin/br/com/felipezorzo/zpa/cli/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,14 @@ class Main : CliktCommand(name = "zpa-cli") {
for (issue in fileIssues.sortedWith(compareBy({ it.primaryLocation.startLine() }, { it.primaryLocation.startLineOffset() }))) {
val startLine = issue.primaryLocation.startLine()
val startColumn = issue.primaryLocation.startLineOffset()
val activeRule = issue.check.activeRule
var severity = activeRule.severity

var positionFormatted = "$startLine"
if (startColumn != -1) {
positionFormatted += ":$startColumn"
}
println("${positionFormatted.padEnd(10)}${issue.primaryLocation.message()}")
println("${positionFormatted.padEnd(10)}${severity.padEnd(15)}${issue.primaryLocation.message()}")
}

println("")
Expand Down

0 comments on commit f2c0027

Please sign in to comment.