From f5f6d99cd7423f87f2f1c042ac691d968e8197d9 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 19 Dec 2017 15:40:11 -0600 Subject: [PATCH] make file list function names clearer since they return sets rather than lists, don't use 'list' in the name --- script/cpplint.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/script/cpplint.py b/script/cpplint.py index 59b639527f78..c1f6deae2afc 100755 --- a/script/cpplint.py +++ b/script/cpplint.py @@ -71,17 +71,17 @@ def main(): enable_verbose_mode() os.chdir(SOURCE_ROOT) - files = list_files('atom', + files = find_files('atom', ['app', 'browser', 'common', 'renderer', 'utility'], ['*.cc', '*.h']) - files += list_files('brightray', ['browser', 'common'], ['*.cc', '*.h']) + files += find_files('brightray', ['browser', 'common'], ['*.cc', '*.h']) files -= set(IGNORE_FILES) if args.only_changed: - files &= get_changed_files() + files &= find_changed_files() call_cpplint(list(files)) -def list_files(parent, directories, filters): +def find_files(parent, directories, filters): matches = set() for directory in directories: for root, _, filenames, in os.walk(os.path.join(parent, directory)): @@ -91,7 +91,7 @@ def list_files(parent, directories, filters): return matches -def get_changed_files(): +def find_changed_files(): return set(execute(['git', 'diff', '--name-only']).splitlines())