Skip to content

Commit 6a54bc2

Browse files
committed
Fixed Python style issues reported by python-lint
1 parent 54cfe0a commit 6a54bc2

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

benchmark/scripts/generate_harness/generate_harness.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@
1717
from __future__ import print_function
1818

1919
import argparse
20-
import jinja2
2120
import os
2221
import re
2322
import subprocess
2423

24+
import jinja2
25+
2526
script_dir = os.path.dirname(os.path.realpath(__file__))
2627
perf_dir = os.path.realpath(os.path.join(script_dir, '../..'))
27-
gyb_script = os.path.realpath(os.path.join(perf_dir, '../utils/gyb'))
28+
gyb = os.path.realpath(os.path.join(perf_dir, '../utils/gyb'))
2829
single_source_dir = os.path.join(perf_dir, 'single-source')
2930
multi_source_dir = os.path.join(perf_dir, 'multi-source')
3031
parser = argparse.ArgumentParser()
@@ -44,29 +45,33 @@
4445
template_env = jinja2.Environment(loader=template_loader, trim_blocks=True,
4546
lstrip_blocks=True)
4647

47-
def all_files(directory, extension): # matching: [directory]/**/*[extension]
48+
49+
def all_files(directory, extension): # matching: [directory]/**/*[extension]
4850
return [
4951
os.path.join(root, f)
5052
for root, _, files in os.walk(directory)
5153
for f in files if f.endswith(extension)
5254
]
5355

54-
def will_write(filename): # ensure path to file exists before writing
56+
57+
def will_write(filename): # ensure path to file exists before writing
5558
print(filename)
5659
output_path = os.path.split(filename)[0]
57-
if not os.path.exists(output_path): os.makedirs(output_path)
60+
if not os.path.exists(output_path):
61+
os.makedirs(output_path)
62+
5863

5964
if __name__ == '__main__':
6065
# Generate Your Boilerplate
61-
gyb_files = all_files(perf_dir, '.swift.gyb')
66+
gyb_files = all_files(perf_dir, '.gyb')
6267
for f in gyb_files:
6368
relative_path = os.path.relpath(f[:-4], perf_dir)
6469
out_file = os.path.join(output_dir, relative_path)
6570
will_write(out_file)
66-
subprocess.call([gyb_script, '--line-directive', '', '-o', out_file, f])
71+
subprocess.call([gyb, '--line-directive', '', '-o', out_file, f])
6772

6873
# CMakeList single-source
69-
test_files = all_files(single_source_dir,'.swift')
74+
test_files = all_files(single_source_dir, '.swift')
7075
tests = sorted(os.path.basename(x).split('.')[0] for x in test_files)
7176

7277
# CMakeList multi-source

0 commit comments

Comments
 (0)