Skip to content

Commit cb817d3

Browse files
authored
Extend "E501 line too long" match till end of line
Currently, positions of lints with E501 are handled by the PythonLinter base class. Since flake8 gives the column (like 80) as the hint, the base class extends the lint to the end of scope. This sometimes gives confusing results, like only outlining a single character (which would suggest that something is wrong with that char, rather than the line). This doesn't match the semantics of E501 - everything after that column is a part of the warning/error, so the outline should extend till the end of the line. Closes #119
1 parent 02066bb commit cb817d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

linter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def reposition_match(self, line, col, m, virtual_view):
102102
"""Reposition white-space errors."""
103103
code = m.error or m.warning
104104

105-
if code in ('W291', 'W293'):
105+
if code in ('W291', 'W293', 'E501'):
106106
txt = virtual_view.select_line(line).rstrip('\n')
107107
return (line, col, len(txt))
108108

0 commit comments

Comments
 (0)