mirror of https://github.com/zulip/zulip.git
lint: Refactor pyflakes to use more consistent style.
In particular, we no longer pass in the full `by_lang` object and expect it to pull out the Python piece.
This commit is contained in:
parent
2cdcf4b88f
commit
78a93b8d9e
|
@ -115,7 +115,7 @@ def run():
|
||||||
@linter_config.lint
|
@linter_config.lint
|
||||||
def pyflakes():
|
def pyflakes():
|
||||||
# type: () -> int
|
# type: () -> int
|
||||||
failed = check_pyflakes(args, by_lang)
|
failed = check_pyflakes(by_lang['py'], args)
|
||||||
return 1 if failed else 0
|
return 1 if failed else 0
|
||||||
|
|
||||||
@linter_config.lint
|
@linter_config.lint
|
||||||
|
|
|
@ -31,13 +31,13 @@ def suppress_line(line: str) -> bool:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def check_pyflakes(options, by_lang):
|
def check_pyflakes(files, options):
|
||||||
# type: (Any, Dict[str, List[str]]) -> bool
|
# type: (List[str], Dict[str, Any]) -> bool
|
||||||
if len(by_lang['py']) == 0:
|
if len(files) == 0:
|
||||||
return False
|
return False
|
||||||
failed = False
|
failed = False
|
||||||
color = next(colors)
|
color = next(colors)
|
||||||
pyflakes = subprocess.Popen(['pyflakes'] + by_lang['py'],
|
pyflakes = subprocess.Popen(['pyflakes'] + files,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
assert pyflakes.stdout is not None # Implied by use of subprocess.PIPE
|
assert pyflakes.stdout is not None # Implied by use of subprocess.PIPE
|
||||||
|
|
Loading…
Reference in New Issue