Skip to content

Commit 68fde69

Browse files
committed
Applied DRYer. Made python lint happy.
1 parent bdffb35 commit 68fde69

File tree

4 files changed

+414
-431
lines changed

4 files changed

+414
-431
lines changed

benchmark/scripts/generate_harness/generate_harness.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
args = parser.parse_args()
3131
output_dir = args.output_dir
3232

33+
3334
def all_files(directory, extension): # matching: [directory]/**/*[extension]
3435
return [
3536
os.path.join(root, f)
@@ -47,9 +48,9 @@ def will_write(filename): # ensure path to file exists before writing
4748

4849
if __name__ == '__main__':
4950
# Generate Your Boilerplate
50-
gyb_files = all_files(perf_dir, '.gyb')
51-
# FIXME make sure longer paths are done first,
52-
# as CMakeLists and main.swift depend on the other gybs being generated first!
51+
# Make sure longer paths are done first as CMakeLists.txt and main.swift
52+
# depend on the other gybs being generated first.
53+
gyb_files = sorted(all_files(perf_dir, '.gyb'), key=len, reverse=True)
5354
for f in gyb_files:
5455
relative_path = os.path.relpath(f[:-4], perf_dir)
5556
out_file = os.path.join(output_dir, relative_path)

0 commit comments

Comments
 (0)