Skip to content

Commit

Permalink
🐛 Problem may not always contain a location.
Browse files Browse the repository at this point in the history
  • Loading branch information
hybloid authored and tiulpin committed Dec 13, 2023
1 parent bdfc818 commit e5e5181
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scan/src/annotations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ export interface Rule {
export interface Annotation {
title: string
path: string
start_line: number
end_line: number
start_line: number | undefined
end_line: number | undefined
annotation_level: 'failure' | 'warning' | 'notice'
message: string
start_column: number | undefined
Expand All @@ -118,12 +118,12 @@ function parseResult(
message: result.message.markdown ?? result.message.text!!,
title: rules.get(result.ruleId!!)?.shortDescription!!,
path: location.artifactLocation!!.uri!!,
start_line: region.startLine!!,
end_line: region.endLine || region.startLine!!,
start_line: region?.startLine,
end_line: region?.endLine || region?.startLine,
start_column:
region.startLine === region.endColumn ? region.startColumn : undefined,
region?.startLine === region?.endColumn ? region?.startColumn : undefined,
end_column:
region.startLine === region.endColumn ? region.endColumn : undefined,
region?.startLine === region?.endColumn ? region?.endColumn : undefined,
annotation_level: (() => {
switch (result.level) {
case 'error':
Expand Down

0 comments on commit e5e5181

Please sign in to comment.