Skip to content

Commit 5d92a1a

Browse files
committed
Format Python code
1 parent 6e80593 commit 5d92a1a

56 files changed

Lines changed: 721 additions & 356 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

corpus_test/generate_report.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ def format_difference(compare: Iterable[Result], base: Iterable[Result]) -> str:
183183
else:
184184
return s
185185

186+
186187
def report_larger_than_original(results_dir: str, python_versions: str, minifier_sha: str) -> str:
187188
yield '''
188189
## Larger than original
@@ -201,6 +202,7 @@ def report_larger_than_original(results_dir: str, python_versions: str, minifier
201202
for entry in larger_than_original:
202203
yield f'| {entry.corpus_entry} | {entry.original_size} | {entry.minified_size} ({entry.minified_size - entry.original_size:+}) |'
203204

205+
204206
def report_unstable(results_dir: str, python_versions: str, minifier_sha: str) -> str:
205207
yield '''
206208
## Unstable
@@ -219,6 +221,7 @@ def report_unstable(results_dir: str, python_versions: str, minifier_sha: str) -
219221
for entry in unstable:
220222
yield f'| {entry.corpus_entry} | {python_version} | {entry.original_size} |'
221223

224+
222225
def report_exceptions(results_dir: str, python_versions: str, minifier_sha: str) -> str:
223226
yield '''
224227
## Exceptions
@@ -243,6 +246,7 @@ def report_exceptions(results_dir: str, python_versions: str, minifier_sha: str)
243246
if not exceptions_found:
244247
yield ' None | | |'
245248

249+
246250
def report_larger_than_base(results_dir: str, python_versions: str, minifier_sha: str, base_sha: str) -> str:
247251
yield '''
248252
## Top 10 Larger than base
@@ -272,6 +276,7 @@ def report_larger_than_base(results_dir: str, python_versions: str, minifier_sha
272276
if not there_are_some_larger_than_base:
273277
yield '| N/A | N/A | N/A |'
274278

279+
275280
def report_slowest(results_dir: str, python_versions: str, minifier_sha: str) -> str:
276281
yield '''
277282
## Top 10 Slowest
@@ -288,6 +293,7 @@ def report_slowest(results_dir: str, python_versions: str, minifier_sha: str) ->
288293
for entry in sorted(summary.entries.values(), key=lambda entry: entry.time, reverse=True)[:10]:
289294
yield f'| {entry.corpus_entry} | {entry.original_size} | {entry.minified_size} | {entry.time:.3f} |'
290295

296+
291297
def report(results_dir: str, minifier_ref: str, minifier_sha: str, base_ref: str, base_sha: str) -> Iterable[str]:
292298
"""
293299
Generate a report comparing the results of two versions of python-minifier

corpus_test/generate_results.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ def minify_corpus_entry(corpus_path, corpus_entry):
3434
with open(os.path.join(corpus_path, corpus_entry), 'rb') as f:
3535
source = f.read()
3636

37-
3837
result = Result(corpus_entry, len(source), 0, 0, '')
3938

4039
start_time = time.time()
@@ -133,6 +132,7 @@ def corpus_test(corpus_path, results_path, sha, regenerate_results):
133132

134133
print('Finished')
135134

135+
136136
def bool_parse(value):
137137
return value == 'true'
138138

hypo_test/README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
# Hypothesis tests
22

33
The hypothesis strategies in this directory generate an AST that python can parse.
4-
It does not take care to generate semantically valid programs.
4+
It does not take care to generate semantically valid programs.
55
Failure cases should shrink into valid programs, though.
66

77
TODO:
88
Assignment targets: (in comprehensions too)
9+
910
- Tuples, sets??
10-
Starred
11-
Call arguments
12-
Delete targets
13-
ImportFrom levels
14-
functiondef args
15-
Await
16-
f-strings
11+
Starred
12+
Call arguments
13+
Delete targets
14+
ImportFrom levels
15+
functiondef args
16+
Await
17+
f-strings

0 commit comments

Comments
 (0)