Change classmethods to staticmethods (#4114)

This commit is contained in:
codefiles 2026-01-11 01:40:43 -05:00 committed by GitHub
parent 43509d8ce1
commit b1290672bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 15 deletions

View File

@ -101,13 +101,8 @@ class Fido2:
return cls._cryptenroll_devices
@classmethod
def fido2_enroll(
cls,
hsm_device: Fido2Device,
dev_path: Path,
password: Password,
) -> None:
@staticmethod
def fido2_enroll(hsm_device: Fido2Device, dev_path: Path, password: Password) -> None:
worker = SysCommandWorker(f'systemd-cryptenroll --fido2-device={hsm_device.path} {dev_path}', peek_output=True)
pw_inputted = False
pin_inputted = False

View File

@ -1495,9 +1495,8 @@ class DiskEncryption:
return obj
@classmethod
@staticmethod
def validate_enc(
cls,
modifications: list[DeviceModification],
lvm_config: LvmConfiguration | None = None,
) -> bool:

View File

@ -266,8 +266,8 @@ class WifiConfiguredNetwork:
return networks
@classmethod
def _extract_flags(cls, flag_string: str) -> list[str]:
@staticmethod
def _extract_flags(flag_string: str) -> list[str]:
pattern = r'\[([^\]]+)\]'
extracted_values = re.findall(pattern, flag_string)

View File

@ -15,9 +15,8 @@ if TYPE_CHECKING:
class FormattedOutput:
@classmethod
@staticmethod
def _get_values(
cls,
o: 'DataclassInstance',
class_formatter: str | Callable | None = None, # type: ignore[type-arg]
filter_list: list[str] = [],
@ -110,8 +109,8 @@ class FormattedOutput:
return output
@classmethod
def as_columns(cls, entries: list[str], cols: int) -> str:
@staticmethod
def as_columns(entries: list[str], cols: int) -> str:
"""
Will format a list into a given number of columns
"""