Skip to content

Commit

Permalink
Merge pull request #79 from SublimeLinter/cleanup4
Browse files Browse the repository at this point in the history
clean up several features now handled in core:
  • Loading branch information
braver authored Feb 13, 2018
2 parents 13ffec2 + c6c2e72 commit 8512f90
Showing 1 changed file with 1 addition and 37 deletions.
38 changes: 1 addition & 37 deletions linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Flake8(PythonLinter):
"""Provides an interface to the flake8 python module/script."""

syntax = ('python', 'python3')
cmd = ('flake8', '--format', 'default', '*', '-')
cmd = ('flake8', '--format', 'default', '${args}', '-')

# The following regex marks these pyflakes and pep8 codes as errors.
# All other codes are marked as warnings.
Expand Down Expand Up @@ -47,39 +47,3 @@ class Flake8(PythonLinter):
r'(?P<message>\'(.*\.)?(?P<near>.+)\' imported but unused|.*)'
)
multiline = True
defaults = {
'--select=,': '',
'--ignore=,': '',
'--builtins=,': '',
'--max-line-length=': '',
'--max-complexity=': '',
'--jobs=': '',
'show-code': False,
'executable': ''
}
inline_settings = ('max-line-length', 'max-complexity')
inline_overrides = ('select', 'ignore', 'builtins')

# ST will not show error marks in whitespace errors, so bump the column by one
# e.g. `E203 whitespace before ':'`
increment_col = ('E203',)

def split_match(self, match):
"""
Extract and return values from match.
We override this method because sometimes we capture near,
and a column will always override near.
"""
match, line, col, error, warning, message, near = super().split_match(match)

if near:
col = None

if col and any(c in self.increment_col for c in (error, warning)):
col += 1

if self.get_view_settings().get('show-code'):
message = ' '.join([error or warning or '', message])
return match, line, col, error, warning, message, near

0 comments on commit 8512f90

Please sign in to comment.