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:
Tim Abbott 2018-08-04 20:05:15 -07:00
parent 2cdcf4b88f
commit 78a93b8d9e
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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