Skip to content

Commit

Permalink
Apply new ruff 0.9 formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
DaanDeMeyer authored and behrmann committed Jan 9, 2025
1 parent de07a89 commit 5e8c6d6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
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

0 comments on commit 5e8c6d6

Please sign in to comment.