From 5ada385b918686610282732f658f317aff95a461 Mon Sep 17 00:00:00 2001 From: Elliott Jin Date: Sun, 19 Mar 2017 13:09:54 -0700 Subject: [PATCH] refactor: Check for empty list with `len(X) == 0` instead of `not X`. --- tools/lint-all | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/lint-all b/tools/lint-all index ba54c80479..b3ba59d6f0 100755 --- a/tools/lint-all +++ b/tools/lint-all @@ -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