Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply new ruff 0.9 formatting #3337

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions mkosi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1844,7 +1844,7 @@ def install_type1(
)

for initrd in initrds:
f.write(f'initrd /{initrd.relative_to(context.root / "boot")}\n')
f.write(f"initrd /{initrd.relative_to(context.root / 'boot')}\n")

if want_grub_efi(context) or want_grub_bios(context, partitions):
config = prepare_grub_config(context)
Expand Down Expand Up @@ -2588,8 +2588,7 @@ def check_tools(config: Config, verb: Verb) -> None:
version="257~devel",
reason="build unified kernel image profiles",
hint=(
"Use ToolsTree=default to download most required tools including ukify "
"automatically"
"Use ToolsTree=default to download most required tools including ukify automatically"
),
)
elif config.unified_kernel_images == ConfigFeature.enabled:
Expand Down
6 changes: 3 additions & 3 deletions mkosi/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4691,11 +4691,11 @@ def line_join_list(array: Iterable[object]) -> str:

def format_bytes(num_bytes: int) -> str:
if num_bytes >= 1024**3:
return f"{num_bytes/1024**3 :0.1f}G"
return f"{num_bytes / 1024**3:0.1f}G"
if num_bytes >= 1024**2:
return f"{num_bytes/1024**2 :0.1f}M"
return f"{num_bytes / 1024**2:0.1f}M"
if num_bytes >= 1024:
return f"{num_bytes/1024 :0.1f}K"
return f"{num_bytes / 1024:0.1f}K"

return f"{num_bytes}B"

Expand Down
2 changes: 1 addition & 1 deletion mkosi/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,5 @@ def write_package_report(self, out: IO[str]) -> None:
out.write(f"Size: {sum(p.size for p in self.packages)}")

for package in self.source_packages.values():
out.write(f"\n{80*'-'}\n")
out.write(f"\n{80 * '-'}\n")
out.write(package.report())
3 changes: 1 addition & 2 deletions mkosi/vmspawn.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ def run_vmspawn(args: Args, config: Config) -> None:
if not kernel.exists():
die(
f"Kernel or UKI not found at {kernel}",
hint="Please install a kernel in the image or provide a --linux"
" argument to mkosi vmspawn",
hint="Please install a kernel in the image or provide a --linux argument to mkosi vmspawn",
)

cmdline: list[PathString] = [
Expand Down
2 changes: 1 addition & 1 deletion tests/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_args(path: Optional[Path]) -> None:
"DebugSandbox": false,
"DebugShell": false,
"DebugWorkspace": false,
"Directory": {f'"{os.fspath(path)}"' if path is not None else 'null'},
"Directory": {f'"{os.fspath(path)}"' if path is not None else "null"},
"DocFormat": "auto",
"Force": 9001,
"GenkeyCommonName": "test",
Expand Down
Loading