Skip to content

Commit a72704f

Browse files
authored
Parse ignore arguments in flake8 to avoid issues with Atom (#824)
1 parent c57bf89 commit a72704f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pyls/plugins/flake8_lint.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from pyls import hookimpl, lsp
88

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

1112

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

0 commit comments

Comments
 (0)