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
|
||||
def pyflakes():
|
||||
# type: () -> int
|
||||
failed = check_pyflakes(args, by_lang)
|
||||
failed = check_pyflakes(by_lang['py'], args)
|
||||
return 1 if failed else 0
|
||||
|
||||
@linter_config.lint
|
||||
|
|
|
@ -31,13 +31,13 @@ def suppress_line(line: str) -> bool:
|
|||
return True
|
||||
return False
|
||||
|
||||
def check_pyflakes(options, by_lang):
|
||||
# type: (Any, Dict[str, List[str]]) -> bool
|
||||
if len(by_lang['py']) == 0:
|
||||
def check_pyflakes(files, options):
|
||||
# type: (List[str], Dict[str, Any]) -> bool
|
||||
if len(files) == 0:
|
||||
return False
|
||||
failed = False
|
||||
color = next(colors)
|
||||
pyflakes = subprocess.Popen(['pyflakes'] + by_lang['py'],
|
||||
pyflakes = subprocess.Popen(['pyflakes'] + files,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
assert pyflakes.stdout is not None # Implied by use of subprocess.PIPE
|
||||
|
|
Loading…
Reference in New Issue