Skip to content

Commit a5ecf73

Browse files
committed
Selectively revert bdd0ce4
The trailing comma check is useful for iterables but not calls. Remove the trailing commas from calls and turn off the warning. Signed-off-by: Nathan Chancellor <nathan@kernel.org>
1 parent 54e6b62 commit a5ecf73

4 files changed

Lines changed: 11 additions & 14 deletions

File tree

boot-qemu.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,28 +75,28 @@ def parse_arguments():
7575
"--shell",
7676
action="store_true",
7777
help=
78-
"Instead of immediately shutting down the machine upon successful boot, pass 'rdinit=/bin/sh' on the kernel command line to allow interacting with the machine via a shell.",
78+
"Instead of immediately shutting down the machine upon successful boot, pass 'rdinit=/bin/sh' on the kernel command line to allow interacting with the machine via a shell."
7979
)
8080
parser.add_argument(
8181
"-k",
8282
"--kernel-location",
8383
required=True,
8484
type=str,
8585
help=
86-
"Path to kernel image or kernel build folder to search for image in. Can be an absolute or relative path.",
86+
"Path to kernel image or kernel build folder to search for image in. Can be an absolute or relative path."
8787
)
8888
parser.add_argument(
8989
"--no-kvm",
9090
action="store_true",
9191
help=
92-
"Do not use KVM for acceleration even when supported (only recommended for debugging).",
92+
"Do not use KVM for acceleration even when supported (only recommended for debugging)."
9393
)
9494
parser.add_argument(
9595
"-s",
9696
"--smp",
9797
type=int,
9898
help=
99-
"Number of processors for virtual machine. By default, only machines spawned with KVM will use multiple vCPUS.",
99+
"Number of processors for virtual machine. By default, only machines spawned with KVM will use multiple vCPUS."
100100
)
101101
parser.add_argument(
102102
"-t",
@@ -656,7 +656,7 @@ def get_qemu_args(cfg):
656656
dtb = kernel.parent.joinpath(dtb_dir, dtb)
657657
if not dtb.exists():
658658
utils.die(
659-
f"'{dtb.stem}' is required for booting but it could not be found at '{dtb}'",
659+
f"'{dtb.stem}' is required for booting but it could not be found at '{dtb}'"
660660
)
661661

662662
qemu_args += ["-dtb", dtb]

boot-uml.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ def parse_arguments():
2424
"--interactive",
2525
action="store_true",
2626
help=
27-
"Instead of immediately shutting down upon successful boot, pass 'init=/bin/sh' to the UML executable to allow interacting with UML via a shell.",
27+
"Instead of immediately shutting down upon successful boot, pass 'init=/bin/sh' to the UML executable to allow interacting with UML via a shell."
2828
)
2929
parser.add_argument(
3030
"-k",
3131
"--kernel-location",
3232
required=True,
3333
type=str,
3434
help=
35-
"Path to UML executable ('linux') or kernel build folder to search for executable in. Can be an absolute or relative path.",
35+
"Path to UML executable ('linux') or kernel build folder to search for executable in. Can be an absolute or relative path."
3636
)
3737

3838
return parser.parse_args()

ruff.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ select = [
44
'ARG', # flake8-unused-arguments
55
'B', # flake8-bugbear
66
'C4', # flake8-comprehensions
7-
'COM', # flake8-commas
87
'E', # pycodestyle
98
'F', # pyflakes
109
'PIE', # flake8-pie

utils.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ def check_cmd(cmd):
1414
cmd (str): External command name or path.
1515
"""
1616
if not shutil.which(cmd):
17-
die(
18-
f"The external command '{cmd}' is needed but it could not be found in PATH, please install it!",
19-
)
17+
die(f"The external command '{cmd}' is needed but it could not be found in PATH, please install it!"
18+
)
2019

2120

2221
def die(string):
@@ -58,9 +57,8 @@ def get_full_kernel_path(kernel_location, image, arch=None):
5857
# Otherwise, it is in the architecture's boot directory
5958
else:
6059
if not arch:
61-
die(
62-
f"Kernel image ('{image}') is in the arch/ directory but 'arch' was not provided!",
63-
)
60+
die(f"Kernel image ('{image}') is in the arch/ directory but 'arch' was not provided!"
61+
)
6462
kernel = kernel_location.joinpath("arch", arch, "boot", image)
6563

6664
if not kernel.exists():

0 commit comments

Comments
 (0)