*: nix fmt

This commit is contained in:
lassulus
2024-12-02 15:14:40 +01:00
parent fcb1f44ac9
commit 79a2283c71
7 changed files with 33 additions and 27 deletions

View File

@@ -57,17 +57,20 @@
};
in
{
expr = slib.parseOptions (lib.evalModules {
modules = [
{
freeformType = with lib.types; attrsOf int;
options = {
enable = lib.mkEnableOption "enable this";
};
}
default
];
}).options { };
expr =
slib.parseOptions
(lib.evalModules {
modules = [
{
freeformType = with lib.types; attrsOf int;
options = {
enable = lib.mkEnableOption "enable this";
};
}
default
];
}).options
{ };
expected = {
"$schema" = "http://json-schema.org/draft-07/schema#";
"$exportedModuleInfo" = {

View File

@@ -4,9 +4,12 @@
}:
{
imports = [
(lib.mkRenamedOptionModule [ "clanCore" ] [
"clan"
"core"
])
(lib.mkRenamedOptionModule
[ "clanCore" ]
[
"clan"
"core"
]
)
];
}

View File

@@ -11,7 +11,7 @@ from .arg_actions import AppendOptionAction
from .clan import show, update
# API endpoints that are not used in the cli.
__all__ = ["directory", "mdns_discovery", "modules", "update", "disk", "admin", "iwd"]
__all__ = ["admin", "directory", "disk", "iwd", "mdns_discovery", "modules", "update"]
from . import (
backups,

View File

@@ -13,7 +13,7 @@ from typing import (
from .serde import dataclass_to_dict, from_dict, sanitize_string
__all__ = ["from_dict", "dataclass_to_dict", "sanitize_string"]
__all__ = ["dataclass_to_dict", "from_dict", "sanitize_string"]
from clan_cli.errors import ClanError

View File

@@ -72,7 +72,7 @@ class ClanURI:
@classmethod
def from_str(
cls, # noqa
cls,
url: str,
machine_name: str | None = None,
) -> "ClanURI":

View File

@@ -36,13 +36,13 @@ from .classes import (
# Re export classes here
# This allows to renaming of classes in the generated code
__all__ = [
"from_dict",
"dataclass_to_dict",
"Service",
"Machine",
"Meta",
"Inventory",
"Machine",
"MachineDeploy",
"Meta",
"Service",
"dataclass_to_dict",
"from_dict",
]

View File

@@ -29,7 +29,7 @@ class KeyType(enum.Enum):
PGP = enum.auto()
@classmethod
def validate(cls, value: str | None) -> "KeyType | None": # noqa: ANN102
def validate(cls, value: str | None) -> "KeyType | None":
if value:
return cls.__members__.get(value.upper())
return None
@@ -114,14 +114,14 @@ class SopsKey:
}
@classmethod
def load_dir(cls, folder: Path) -> "SopsKey": # noqa: ANN102
def load_dir(cls, folder: Path) -> "SopsKey":
"""Load from the file named `keys.json` in the given directory."""
pubkey, key_type = read_key(folder)
username = ""
return cls(pubkey, username, key_type)
@classmethod
def collect_public_keys(cls) -> Sequence["SopsKey"]: # noqa: ANN102
def collect_public_keys(cls) -> Sequence["SopsKey"]:
return [
cls(pubkey=key, username="", key_type=key_type)
for key_type in KeyType
@@ -159,7 +159,7 @@ class ExitStatus(enum.IntEnum): # see: cmd/sops/codes/codes.go
FILE_ALREADY_ENCRYPTED = 203
@classmethod
def parse(cls, code: int) -> "ExitStatus | None": # noqa: ANN102
def parse(cls, code: int) -> "ExitStatus | None":
return ExitStatus(code) if code in ExitStatus else None