Skip to content

Commit 508980c

Browse files
author
Thomas Preud'homme
committed
Fix whitespaces flake8 errors and warnings
- fix E302 errors (2 blank lines before class/functions) - fix E305 errors (2 blank lines after class/functions) - fix W293 warnings (blank line contains whitespace) Reviewed By: cmatthews Differential Revision: https://reviews.llvm.org/D94722
1 parent 0dafa58 commit 508980c

File tree

12 files changed

+32
-5
lines changed

12 files changed

+32
-5
lines changed

lnt/server/reporting/analysis.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
# Minimal percentage difference that is visible in reports
1919
MIN_PERCENTAGE_CHANGE = .01
2020

21+
2122
def absmin_diff(current, prevs):
2223
"""Min of differences between current sample and all previous samples.
2324
Given more than one min, use the last one detected which is probably a

lnt/server/reporting/report.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88

99
OrderAndHistory = namedtuple('OrderAndHistory', ['max_order', 'recent_orders'])
1010

11+
1112
def pairs(l):
1213
"""Make an iterable of all pairs of consecutive elements in l."""
1314
return zip(l[:-1], l[1:])
1415

16+
1517
# The hash color palette avoids green and red as these colours are already used
1618
# in quite a few places to indicate "good" or "bad".
1719
_hash_color_palette = (
@@ -23,6 +25,7 @@ def pairs(l):
2325
colorsys.hsv_to_rgb(h=180. / 360, s=0.3, v=0.9999), # mid cyan
2426
)
2527

28+
2629
def _clamp(v, minVal, maxVal):
2730
return min(max(v, minVal), maxVal)
2831

@@ -55,6 +58,7 @@ def _get_rgb_colors_for_hashes(hash_strings):
5558
result.append(_toColorString(rgb))
5659
return result
5760

61+
5862
# Helper classes to make the sparkline chart construction easier in the jinja
5963
# template.
6064
class RunResult:
@@ -65,6 +69,7 @@ def __init__(self, comparisonResult):
6569
if self.samples is None:
6670
self.samples = []
6771

72+
6873
class RunResults:
6974
"""
7075
RunResults contains pre-processed data to easily construct the HTML for
@@ -113,6 +118,7 @@ def complete(self):
113118
if dr is not None:
114119
dr.hash_rgb_color = rgb_colors[i]
115120

121+
116122
# Compute static CSS styles for elements. We use the style directly on
117123
# elements instead of via a stylesheet to support major email clients
118124
# (like Gmail) which can't deal with embedded style sheets.

lnt/server/reporting/runs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ def prioritize_buckets(test_results):
216216

217217

218218
BucketEntry = namedtuple('BucketEntry', ['name', 'cr', 'test_id'])
219+
220+
219221
def _get_changes_by_type(ts, run_a, run_b, metric_fields, test_names,
220222
num_comparison_runs, sri):
221223
comparison_results = {}

lnt/server/ui/globals.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ def v4_url_available(*args, **kwargs):
3333
except Exception:
3434
return False
3535

36+
3637
class fixed_location_response(Response):
3738
autocorrect_location_header = False
3839

40+
3941
def v4_redirect(*args, **kwargs):
4042
"""
4143
Like redirect but can be used to allow relative URL redirection.
@@ -48,6 +50,7 @@ def v4_redirect(*args, **kwargs):
4850
"""
4951
return flask.redirect(*args, Response=fixed_location_response, **kwargs)
5052

53+
5154
def register(env):
5255
# Add some normal Python builtins which can be useful in templates.
5356
env.globals.update(zip=zip)

lnt/server/ui/views.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,6 +1517,7 @@ def to_key(name):
15171517
config=config, all_machines=all_machines,
15181518
all_orders=all_orders, **ts_data(ts))
15191519

1520+
15201521
@v4_route("/latest_runs_report")
15211522
def v4_latest_runs_report():
15221523
session = request.session
@@ -1535,6 +1536,7 @@ def v4_latest_runs_report():
15351536
analysis=lnt.server.reporting.analysis,
15361537
**ts_data(ts))
15371538

1539+
15381540
@db_route("/summary_report")
15391541
def v4_summary_report():
15401542
session = request.session

tests/SharedInputs/FakeCompilers/fakecompiler.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ def print_verbose_info(self):
118118
"%s" "-cc1" "-E" ... more boring stuff here ...""" % (
119119
g_program,), file=sys.stderr)
120120

121+
121122
# Monorepo clang build with some extra stuff after the version string
122123
class Clang_monorepo2(LLVMCompiler):
123124
compiler_name = "clang-monorepo2"
@@ -131,6 +132,7 @@ def print_verbose_info(self):
131132
"%s" "-cc1" "-E" ... more boring stuff here ...""" % (
132133
g_program,), file=sys.stderr)
133134

135+
134136
class AppleClang_138_1(LLVMCompiler):
135137
compiler_name = "apple-clang-138.1"
136138

tests/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
import lit.discovery
33

4+
45
def test_all():
56
return lit.discovery.load_test_suite([os.path.dirname(__file__)])

tests/server/db/Migrations.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def sanity_check_instance(instance_path):
4646
overview = client.get(os.path.join("/", link))
4747
assert "LNT : %s - Recent Activity" % (name,) in overview.data
4848

49+
4950
def check_instance(instance_path, temp_path):
5051
logging.info("checking instance: %r", instance_path)
5152

@@ -66,6 +67,7 @@ def check_instance(instance_path, temp_path):
6667
# Sanity check that the update instance works correctly.
6768
sanity_check_instance(instance_temp_path)
6869

70+
6971
def main():
7072
_, temp_path = sys.argv
7173

@@ -86,5 +88,6 @@ def main():
8688
# Otherwise, we have a test instance. Check migration of it.
8789
check_instance(input_path, temp_path)
8890

91+
8992
if __name__ == '__main__':
9093
main()

tests/server/db/search.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def test_default_order(self):
105105
('machine3', '6512'),
106106
('machine3', '65')
107107
])
108-
108+
109109
def test_default_machine(self):
110110
session = self.session
111111
ts = self.db.testsuite.get('nts')
@@ -116,6 +116,7 @@ def test_default_machine(self):
116116
('machine2', '6512')
117117
])
118118

119+
119120
if __name__ == '__main__':
120121
if len(sys.argv) > 1:
121122
base_path = sys.argv[1]

tests/testing/cPerf.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
import os
66
import tempfile
77
from lnt.testing.profile.perf import LinuxPerfProfile
8-
8+
9+
910
class CPerfTest(unittest.TestCase):
1011
def setUp(self):
1112
self.inputs = os.path.join(os.path.dirname(os.path.abspath(__file__)),
@@ -118,7 +119,7 @@ def setUp(self):
118119
[{},
119120
4196092,
120121
u'\td65f03c0 \tret']]}}}}
121-
122+
122123
def _getNm(self, perf_data_fname, non_dynamic=False):
123124
stub = perf_data_fname.rsplit('.perf_data', 1)[0]
124125
s = 'python %s/fake-nm.py %s.nm.out' % (self.inputs, stub)
@@ -132,7 +133,7 @@ def _getObjdump(self, perf_data_fname):
132133

133134
def _getInput(self, fname):
134135
return os.path.join(self.inputs, fname)
135-
136+
136137
def test_check_file(self):
137138
self.assertTrue(LinuxPerfProfile.checkFile(self._getInput('fib-aarch64.perf_data')))
138139

@@ -183,5 +184,6 @@ def test_random_guff2(self):
183184
LinuxPerfProfile.deserialize(open(fd.name),
184185
propagateExceptions=True)
185186

187+
186188
if __name__ == '__main__':
187189
unittest.main(argv=[sys.argv[0], ])

0 commit comments

Comments
 (0)