Skip to content

Commit 4a78340

Browse files
committed
Reformat some things
1 parent 1e30826 commit 4a78340

File tree

10 files changed

+29
-22
lines changed

10 files changed

+29
-22
lines changed

tests/circuitpython-manual/pwmio/code_extremes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
if time.monotonic() > freq_time:
8181
break
8282
t0 = freq_time
83-
print(f"({freq}, {i/freq_duration:.0f}), ", end="")
83+
print(f"({freq}, {i / freq_duration:.0f}), ", end="")
8484
print(")")
8585
print("done.")
8686
pwm.deinit()

tests/circuitpython-manual/pwmio/code_ramps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
if time.monotonic() > freq_time:
9797
break
9898
t0 = freq_time
99-
print(f"({freq}, {i/freq_duration:.0f}), ", end="")
99+
print(f"({freq}, {i / freq_duration:.0f}), ", end="")
100100
print(")")
101101
print("done.")
102102
pwm.deinit()

tests/circuitpython-manual/pwmio/duty.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def read(
107107
for duty in duty_labels:
108108
draw.text(
109109
(left - 10, y0 + (y1 - y0) * (1 - duty)),
110-
f"{int(100*duty):d}%",
110+
f"{int(100 * duty):d}%",
111111
duty_color,
112112
anchor="rm",
113113
)

tests/circuitpython/aes.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@
100100

101101
print("truncated-CTR-1")
102102
## Truncated CTR test case
103-
plaintext = unhexlify("6bc1bee22e409f96e93d7e117393172a" "ae2d")
103+
plaintext = unhexlify(
104+
"6bc1bee22e409f96e93d7e117393172a"
105+
"ae2d"
106+
) # fmt: skip
104107

105108
key = unhexlify("2b7e151628aed2a6abf7158809cf4f3c")
106109
counter = unhexlify("f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff")
@@ -122,7 +125,10 @@
122125

123126
print("truncated-CTR-2")
124127
## Truncated CTR test case #2
125-
plaintext = unhexlify("6bc1bee22e409f96e93d7e117393172a" "ae")
128+
plaintext = unhexlify(
129+
"6bc1bee22e409f96e93d7e117393172a"
130+
"ae"
131+
) # fmt: skip
126132

127133
key = unhexlify("2b7e151628aed2a6abf7158809cf4f3c")
128134
counter = unhexlify("f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff")

tests/cpydiff/core_fstring_concat.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
"""
77

88
x, y = 1, 2
9-
print("aa" f"{x}") # works
10-
print(f"{x}" "ab") # works
11-
print("a{}a" f"{x}") # fails
12-
print(f"{x}" "a{}b") # fails
13-
print(f"{x}" f"{y}") # fails
9+
# fmt: off
10+
print(f"aa{x}") # works
11+
print(f"{x}ab") # works
12+
print(f"a{{}}a{x}") # fails
13+
print(f"{x}a{{}}b") # fails
14+
print(f"{x}{y}") # fails

tests/cpydiff/core_fstring_parser.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
workaround: Always use balanced braces and brackets in expressions inside f-strings
66
"""
77

8-
print(f'{"hello { world"}')
9-
print(f'{"hello ] world"}')
8+
# fmt: off
9+
print(f"{'hello { world'}")
10+
print(f"{'hello ] world'}")

tools/board_stubs/build_board_specific_stubs/board_stub_builder.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,10 @@ def create_board_stubs(board_id, records, mappings, board_filename):
157157
boards_file.write("#\n")
158158
boards_file.write("# SPDX-License-Identifier: MIT\n")
159159
boards_file.write('"""\n')
160-
boards_file.write(f'Board stub for {mappings["board_name"]}\n')
161-
boards_file.write(f' - port: {mappings["port"]}\n')
160+
boards_file.write(f"Board stub for {mappings['board_name']}\n")
161+
boards_file.write(f" - port: {mappings['port']}\n")
162162
boards_file.write(f" - board_id: {board_id}\n")
163-
boards_file.write(f' - NVM size: {mappings["nvm_size"]}\n')
163+
boards_file.write(f" - NVM size: {mappings['nvm_size']}\n")
164164
boards_file.write(f" - Included modules: {included_modules}\n")
165165
boards_file.write(f" - Frozen libraries: {frozen_libraries}\n")
166166
boards_file.write('"""\n\n')
@@ -297,7 +297,7 @@ def build_stubs(circuitpython_dir, circuitpython_org_dir, export_dir, version="8
297297
else:
298298
lookup = board
299299

300-
port_path = f'{circuitpython_dir}ports/{board_data["port"]}/'
300+
port_path = f"{circuitpython_dir}ports/{board_data['port']}/"
301301
board_path = f"{port_path}boards/{lookup}/"
302302
pins_path = f"{board_path}pins.c"
303303
if not os.path.isfile(pins_path):

tools/ci_check_duplicate_usb_vid_pid.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ def check_vid_pid(files, clusterlist):
138138
cluster = set(clusterlist.get(key, []))
139139
if cluster != boards:
140140
if key == "":
141-
duplicates.append(f"- Non-USB:\n" f" Boards: {', '.join(sorted(boards))}")
141+
duplicates.append(f"- Non-USB:\n Boards: {', '.join(sorted(boards))}")
142142
else:
143-
duplicates.append(f"- VID/PID: {key}\n" f" Boards: {', '.join(sorted(boards))}")
143+
duplicates.append(f"- VID/PID: {key}\n Boards: {', '.join(sorted(boards))}")
144144

145145
if duplicates:
146146
duplicates = "\n".join(duplicates)

tools/pyboard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ def fs_listdir(self, src=""):
509509
def repr_consumer(b):
510510
buf.extend(b.replace(b"\x04", b""))
511511

512-
cmd = "import os\nfor f in os.ilistdir(%s):\n" " print(repr(f), end=',')" % (
512+
cmd = "import os\nfor f in os.ilistdir(%s):\n print(repr(f), end=',')" % (
513513
("'%s'" % src) if src else ""
514514
)
515515
try:

tools/pydfu.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,7 @@ def read_dfu_file(filename):
344344
# B uint8_t targets Number of targets
345345
dfu_prefix, data = consume("<5sBIB", data, "signature version size targets")
346346
print(
347-
" %(signature)s v%(version)d, image size: %(size)d, "
348-
"targets: %(targets)d" % dfu_prefix
347+
" %(signature)s v%(version)d, image size: %(size)d, targets: %(targets)d" % dfu_prefix
349348
)
350349
for target_idx in range(dfu_prefix["targets"]):
351350
# Decode the Image Prefix
@@ -359,7 +358,7 @@ def read_dfu_file(filename):
359358
# I uint32_t size Size of image (without prefix)
360359
# I uint32_t elements Number of elements in the image
361360
img_prefix, data = consume(
362-
"<6sBI255s2I", data, "signature altsetting named name " "size elements"
361+
"<6sBI255s2I", data, "signature altsetting named name size elements"
363362
)
364363
img_prefix["num"] = target_idx
365364
if img_prefix["named"]:

0 commit comments

Comments
 (0)