D404: fix
This commit is contained in:
@@ -133,11 +133,11 @@ def init_git(monkeypatch: pytest.MonkeyPatch, flake: Path) -> None:
|
||||
|
||||
|
||||
class ClanFlake:
|
||||
"""This class holds all attributes for generating a clan flake.
|
||||
"""Holds all attributes for generating a clan flake.
|
||||
For example, inventory and machine configs can be set via self.inventory and self.machines["my_machine"] = {...}.
|
||||
Whenever a flake's configuration is changed, it needs to be re-generated by calling refresh().
|
||||
|
||||
This class can also be used for managing templates.
|
||||
Can also be used for managing templates.
|
||||
Once initialized, all its settings including all generated files, if any, can be copied using the copy() method.
|
||||
This avoids expensive re-computation, like for example creating the flake.lock over and over again.
|
||||
"""
|
||||
|
||||
@@ -119,7 +119,7 @@ def load_dataclass_from_file(
|
||||
|
||||
|
||||
def test_all_dataclasses() -> None:
|
||||
"""This Test ensures that all dataclasses are compatible with the API.
|
||||
"""Ensures that all dataclasses are compatible with the API.
|
||||
|
||||
It will load all dataclasses from the clan_cli directory and
|
||||
generate a JSON schema for each of them.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""This module provides utility functions for serialization and deserialization of data classes.
|
||||
"""Provides utility functions for serialization and deserialization of data classes.
|
||||
|
||||
Functions:
|
||||
- sanitize_string(s: str) -> str: Ensures a string is properly escaped for json serializing.
|
||||
|
||||
@@ -61,7 +61,7 @@ class AsyncResult[R]:
|
||||
|
||||
@dataclass
|
||||
class AsyncContext:
|
||||
"""This class stores thread-local data."""
|
||||
"""Stores thread-local data."""
|
||||
|
||||
prefix: str | None = None # prefix for logging
|
||||
stdout: IO[bytes] | None = None # stdout of subprocesses
|
||||
|
||||
@@ -231,8 +231,8 @@ def terminate_process(process: subprocess.Popen) -> Iterator[None]:
|
||||
|
||||
|
||||
class TimeTable:
|
||||
"""This class is used to store the time taken by each command
|
||||
and print it at the end of the program if env CLAN_CLI_PERF=1 is set.
|
||||
"""Stores the time taken by each command
|
||||
and prints it at the end of the program if env CLAN_CLI_PERF=1 is set.
|
||||
"""
|
||||
|
||||
def __init__(self) -> None:
|
||||
@@ -297,7 +297,7 @@ class RunOpts:
|
||||
|
||||
|
||||
def cmd_with_root(cmd: list[str], graphical: bool = False) -> list[str]:
|
||||
"""This function returns a wrapped command that will be run with root permissions.
|
||||
"""Returns a wrapped command that will be run with root permissions.
|
||||
It will use sudo if graphical is False, otherwise it will use run0 or pkexec.
|
||||
"""
|
||||
if os.geteuid() == 0:
|
||||
|
||||
@@ -99,7 +99,7 @@ class SetSelectorType(str, Enum):
|
||||
|
||||
@dataclass
|
||||
class SetSelector:
|
||||
"""This class represents a selector used in a set.
|
||||
"""Represents a selector used in a set.
|
||||
type: SetSelectorType = SetSelectorType.STR
|
||||
value: str = ""
|
||||
|
||||
@@ -783,7 +783,7 @@ class FlakeCache:
|
||||
|
||||
@dataclass
|
||||
class Flake:
|
||||
"""This class represents a flake, and is used to interact with it.
|
||||
"""Represents a flake, and is used to interact with it.
|
||||
values can be accessed using the select method, which will fetch the value from the cache if it is present.
|
||||
"""
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ from clan_lib.jsonrpc import ClanJSONEncoder
|
||||
|
||||
@contextmanager
|
||||
def locked_open(filename: Path, mode: str = "r") -> Generator:
|
||||
"""This is a context manager that provides an advisory write lock on the file specified by `filename` when entering the context, and releases the lock when leaving the context. The lock is acquired using the `fcntl` module's `LOCK_EX` flag, which applies an exclusive write lock to the file."""
|
||||
"""Context manager that provides an advisory write lock on the file specified by `filename` when entering the context, and releases the lock when leaving the context. The lock is acquired using the `fcntl` module's `LOCK_EX` flag, which applies an exclusive write lock to the file."""
|
||||
with filename.open(mode) as fd:
|
||||
fcntl.flock(fd, fcntl.LOCK_EX)
|
||||
yield fd
|
||||
|
||||
@@ -23,7 +23,7 @@ log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class MainApplication(Adw.Application):
|
||||
"""This class is initialized every time the app is started
|
||||
"""Initialized every time the app is started.
|
||||
Only the Adw.ApplicationWindow is a singleton.
|
||||
So don't use any singletons in the Adw.Application class.
|
||||
"""
|
||||
|
||||
@@ -46,7 +46,7 @@ class JoinValue(GObject.Object):
|
||||
|
||||
|
||||
class JoinList:
|
||||
"""This is a singleton.
|
||||
"""Singleton class.
|
||||
It is initialized with the first call of use()
|
||||
"""
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ from gi.repository import Adw
|
||||
|
||||
|
||||
class ViewStack:
|
||||
"""This is a singleton.
|
||||
"""Singleton class.
|
||||
It is initialized with the first call of use()
|
||||
|
||||
Usage:
|
||||
|
||||
Reference in New Issue
Block a user