mirror of
https://github.com/nix-community/disko.git
synced 2026-11-30 21:13:28 +01:00
dev: Switch to ruff for python linting & formatting
It combines multiple tools and is much faster.
This commit is contained in:
1 parent
0d54c7ad3f
commit
da8a997397
6 files changed
+15
-16
No files matched your search
+1
-1
@@ -112,7 +112,7 @@ def parse_args() -> argparse.Namespace:
|
||||
add_common_apply_args(parser)
|
||||
|
||||
# Other commands
|
||||
generate_parser = mode_parsers.add_parser(
|
||||
_generate_parser = mode_parsers.add_parser(
|
||||
"generate",
|
||||
help=MODE_DESCRIPTION["generate"],
|
||||
)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import argparse
|
||||
import json
|
||||
from logging import info
|
||||
from typing import Any, assert_never
|
||||
|
||||
from disko_lib.ansi import Colors
|
||||
|
||||
@@ -2,7 +2,7 @@ import json
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
from disko_lib.logging import ReadableMessage
|
||||
from .colors import *
|
||||
from .colors import PLACEHOLDER, RESET, FLAG, COMMAND, INVALID, FILE, VALUE, EM, EM_WARN
|
||||
|
||||
ERR_ARGUMENTS_HELP_TXT = f"Provide either {PLACEHOLDER}disko_file{RESET} as the second argument or \
|
||||
{FLAG}--flake{RESET}/{FLAG}-f{RESET} {PLACEHOLDER}flake-uri{RESET}."
|
||||
@@ -12,7 +12,7 @@ def err_command_failed(*, command: str, exit_code: int, stderr: str) -> Readable
|
||||
return ReadableMessage(
|
||||
"error",
|
||||
f"""
|
||||
Command failed: {COMMAND}{command}{COMMAND}
|
||||
Command failed: {COMMAND}{command}{RESET}
|
||||
Exit code: {INVALID}{exit_code}{RESET}
|
||||
stderr: {stderr}
|
||||
""",
|
||||
@@ -20,7 +20,6 @@ def err_command_failed(*, command: str, exit_code: int, stderr: str) -> Readable
|
||||
|
||||
|
||||
def err_eval_config_failed(*, args: dict[str, Any], stderr: str) -> ReadableMessage:
|
||||
|
||||
return ReadableMessage(
|
||||
"error",
|
||||
f"""
|
||||
@@ -51,7 +50,7 @@ def err_missing_arguments() -> list[ReadableMessage]:
|
||||
return [
|
||||
ReadableMessage(
|
||||
"error",
|
||||
f"Missing arguments!",
|
||||
"Missing arguments!",
|
||||
),
|
||||
ReadableMessage("help", ERR_ARGUMENTS_HELP_TXT),
|
||||
]
|
||||
@@ -61,7 +60,7 @@ def err_too_many_arguments() -> list[ReadableMessage]:
|
||||
return [
|
||||
ReadableMessage(
|
||||
"error",
|
||||
f"Too many arguments!",
|
||||
"Too many arguments!",
|
||||
),
|
||||
ReadableMessage("help", ERR_ARGUMENTS_HELP_TXT),
|
||||
]
|
||||
|
||||
Reference in new issue
Block a user