*: nix fmt
This commit is contained in:
@@ -57,7 +57,9 @@
|
||||
};
|
||||
in
|
||||
{
|
||||
expr = slib.parseOptions (lib.evalModules {
|
||||
expr =
|
||||
slib.parseOptions
|
||||
(lib.evalModules {
|
||||
modules = [
|
||||
{
|
||||
freeformType = with lib.types; attrsOf int;
|
||||
@@ -67,7 +69,8 @@
|
||||
}
|
||||
default
|
||||
];
|
||||
}).options { };
|
||||
}).options
|
||||
{ };
|
||||
expected = {
|
||||
"$schema" = "http://json-schema.org/draft-07/schema#";
|
||||
"$exportedModuleInfo" = {
|
||||
|
||||
@@ -4,9 +4,12 @@
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
(lib.mkRenamedOptionModule [ "clanCore" ] [
|
||||
(lib.mkRenamedOptionModule
|
||||
[ "clanCore" ]
|
||||
[
|
||||
"clan"
|
||||
"core"
|
||||
])
|
||||
]
|
||||
)
|
||||
];
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ class ClanURI:
|
||||
|
||||
@classmethod
|
||||
def from_str(
|
||||
cls, # noqa
|
||||
cls,
|
||||
url: str,
|
||||
machine_name: str | None = None,
|
||||
) -> "ClanURI":
|
||||
|
||||
@@ -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",
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user