Skip to content

Commit 306d918

Browse files
authored
Enable ruff C4 checks. NFC (#24209)
1 parent 81054ef commit 306d918

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

emrun.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ def get_browser_build_date(filename):
967967
info = plistlib.readPlist(plistfile)
968968
# Data in Info.plists is a bit odd, this check combo gives best information on each browser.
969969
if 'firefox' in filename.lower():
970-
return '20' + '-'.join(map((lambda x: x.zfill(2)), info['CFBundleVersion'][2:].split('.')))
970+
return '20' + '-'.join(x.zfill(2) for x in info['CFBundleVersion'][2:].split('.'))
971971
except Exception as e:
972972
logv(e)
973973

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ lint.select = [
1919
"ARG",
2020
"ASYNC",
2121
"B",
22+
"C4",
2223
"C90",
2324
"COM",
2425
"E",

site/source/get_api_items.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# if you change here, change everywhere.
2323
api_item_filename = 'api_items.py'
2424

25-
api_reference_items = dict()
25+
api_reference_items = {}
2626

2727

2828
def parseFiles():
@@ -78,9 +78,7 @@ def exportItems():
7878
# write function lead in
7979
infile.write("# Auto-generated file (see get_api_items.py)\n\ndef get_mapped_items():\n mapped_wiki_inline_code = dict()\n")
8080

81-
items = list((key, value) for key, value in api_reference_items.items())
82-
items.sort()
83-
for key, value in items:
81+
for key, value in sorted(api_reference_items.items()):
8482
# Write out each API item to add
8583
infile.write(" mapped_wiki_inline_code['%s'] = '%s'\n" % (key, value))
8684

test/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,7 @@ def tearDown(self):
12831283
]
12841284

12851285
left_over_files = set(temp_files_after_run) - set(self.temp_files_before_run)
1286-
left_over_files = [f for f in left_over_files if not any([f.startswith(prefix) for prefix in ignorable_file_prefixes])]
1286+
left_over_files = [f for f in left_over_files if not any(f.startswith(p) for p in ignorable_file_prefixes)]
12871287
if len(left_over_files):
12881288
print('ERROR: After running test, there are ' + str(len(left_over_files)) + ' new temporary files/directories left behind:', file=sys.stderr)
12891289
for f in left_over_files:

test/parallel_testsuite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def reversed_tests(self):
8181
8282
Future work: measure slowness of tests and sort accordingly.
8383
"""
84-
return reversed(sorted(self, key=str))
84+
return sorted(self, key=str, reverse=True)
8585

8686
def combine_results(self, result, buffered_results):
8787
print()

0 commit comments

Comments
 (0)