Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,15 @@ def find_errors(self, output):
if match['message'].startswith('File ignored'):
continue

column = match.get('column', None)
if column is not None:
# apply line_col_base manually
column = column - 1

yield (
match,
match['line'] - 1, # apply line_col_base manually
match['column'] - 1,
column,
match['ruleId'] if match['severity'] == 2 else '',
match['ruleId'] if match['severity'] == 1 else '',
match['message'],
Expand All @@ -76,9 +81,12 @@ def find_errors(self, output):

def reposition_match(self, line, col, m, vv):
match = m.match
if match.get('fatal', False): # parse error
if (
col is None or
match.get('fatal', False) # parse error
):
text = vv.select_line(line)
return line, 0, len(text) # select whole line?
return line, 0, len(text) # select whole line
return super().reposition_match(line, col, m, vv)

# apply line_col_base manually
Expand Down