Skip to content

Commit 07a498f

Browse files
authored
Merge pull request #228 from jtsommers/master
Fix linter crash for missing ‘ruleId’ on parse errors
2 parents 00d29fb + 0012d1b commit 07a498f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

linter.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def find_errors(self, output):
6565
continue
6666

6767
column = match.get('column', None)
68+
ruleId = match.get('ruleId', '')
6869
if column is not None:
6970
# apply line_col_base manually
7071
column = column - 1
@@ -73,8 +74,8 @@ def find_errors(self, output):
7374
match,
7475
match['line'] - 1, # apply line_col_base manually
7576
column,
76-
match['ruleId'] if match['severity'] == 2 else '',
77-
match['ruleId'] if match['severity'] == 1 else '',
77+
ruleId if match['severity'] == 2 else '',
78+
ruleId if match['severity'] == 1 else '',
7879
match['message'],
7980
None # near
8081
)

0 commit comments

Comments
 (0)