Skip to content

Commit

Permalink
Fix negative columns in shellcheck output
Browse files Browse the repository at this point in the history
  • Loading branch information
niknetniko committed Nov 23, 2023
1 parent 5c8ae30 commit 8258a75
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tested/languages/bash/linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,15 @@ def run_shellcheck(
start_col = shellcheck_object.get("column", 1)
end_col = shellcheck_object.get("endColumn")
cols = end_col - start_col if end_col else None
if cols and cols < 1:
cols = 1

Check warning on line 88 in tested/languages/bash/linter.py

View check run for this annotation

Codecov / codecov/patch

tested/languages/bash/linter.py#L88

Added line #L88 was not covered by tests
annotations.append(
AnnotateCode(
row=start_row + config.source_offset,
rows=rows,
text=text,
externalUrl=external,
column=start_col,
column=start_col - 1,
columns=cols,
type=message_categories.get(
shellcheck_object.get("level", "warning"), Severity.WARNING
Expand Down

0 comments on commit 8258a75

Please sign in to comment.