Skip to content

Commit

Permalink
Parse ignore arguments in flake8 to avoid issues with Atom (#824)
Browse files Browse the repository at this point in the history
  • Loading branch information
thodnev authored Jun 30, 2020
1 parent c57bf89 commit a72704f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyls/plugins/flake8_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from pyls import hookimpl, lsp

log = logging.getLogger(__name__)
FIX_IGNORES_RE = re.compile(r'([^a-zA-Z0-9_,]*;.*(\W+||$))')


@hookimpl
Expand Down Expand Up @@ -48,6 +49,9 @@ def run_flake8(args):
"""Run flake8 with the provided arguments, logs errors
from stderr if any.
"""
# a quick temporary fix to deal with Atom
args = [(i if not i.startswith('--ignore=') else FIX_IGNORES_RE.sub('', i))
for i in args if i is not None]
log.debug("Calling flake8 with args: '%s'", args)
try:
cmd = ['flake8']
Expand Down

0 comments on commit a72704f

Please sign in to comment.