refactor: Check for empty list with `len(X) == 0` instead of `not X`.

This commit is contained in:
Elliott Jin 2017-03-19 13:09:54 -07:00 committed by Tim Abbott
parent 750769f637
commit 5ada385b91
1 changed files with 3 additions and 3 deletions

View File

@ -45,7 +45,7 @@ def bright_red_output():
def check_pyflakes(options, by_lang):
# type: (Any, Dict[str, List[str]]) -> bool
if not by_lang['py']:
if len(by_lang['py']) == 0:
return False
failed = False
pyflakes = subprocess.Popen(['pyflakes'] + by_lang['py'],
@ -671,7 +671,7 @@ def run():
@lint
def css():
# type: () -> int
if not by_lang['css']:
if len(by_lang['css']) == 0:
return 0
result = subprocess.call(['tools/check-css'] + by_lang['css'])
return result
@ -688,7 +688,7 @@ def run():
@lint
def puppet():
# type: () -> int
if not by_lang['pp']:
if len(by_lang['pp']) == 0:
return 0
result = subprocess.call(['puppet', 'parser', 'validate'] + by_lang['pp'])
return result