From bf7ab8d27731a497884a9b9e6477d1a958ff25c7 Mon Sep 17 00:00:00 2001 From: Harikrishnan Mulackal Date: Tue, 12 May 2020 13:00:29 +0530 Subject: [PATCH] Error ids only walk into a given set of directories --- scripts/correct_error_ids.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/scripts/correct_error_ids.py b/scripts/correct_error_ids.py index 8717dbf23..9fd3547f0 100644 --- a/scripts/correct_error_ids.py +++ b/scripts/correct_error_ids.py @@ -104,16 +104,14 @@ def find_source_files(top_dir): """Builds the list of .h and .cpp files in top_dir directory""" source_file_names = [] - black_set = { ".circleci", ".git", ".github", "build", "cmake", "CMakeFiles", "deps", "docs" } + dirs = ['libevmasm', 'liblangutil', 'libsolc', 'libsolidity', 'libsolutil', 'libyul', 'solc'] - for root, _, file_names in os.walk(top_dir, onerror=lambda e: exit(f"Walk error: {e}")): - path_elements = set(root.split(os.sep)) - if not black_set.isdisjoint(path_elements): - continue - for file_name in file_names: - _, ext = path.splitext(file_name) - if ext in [".h", ".cpp"]: - source_file_names.append(path.join(root, file_name)) + for dir in dirs: + for root, _, file_names in os.walk(os.path.join(top_dir, dir), onerror=lambda e: exit(f"Walk error: {e}")): + for file_name in file_names: + _, ext = path.splitext(file_name) + if ext in [".h", ".cpp"]: + source_file_names.append(path.join(root, file_name)) return source_file_names