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 17be9eb
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 < 1:

Check failure on line 87 in tested/languages/bash/linter.py

View workflow job for this annotation

GitHub Actions / types

Operator "<" not supported for "None" (reportOptionalOperand)
cols = 1
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 17be9eb

Please sign in to comment.