diff --git a/craft_archives/os_release.py b/craft_archives/os_release.py index 4db4703..efe375f 100644 --- a/craft_archives/os_release.py +++ b/craft_archives/os_release.py @@ -33,9 +33,7 @@ class OsRelease: """A class to intelligently determine the OS on which we're running.""" - def __init__( - self, *, os_release_file: Path = Path("/etc/os-release") # noqa: B008 - ) -> None: + def __init__(self, *, os_release_file: Path = Path("/etc/os-release")) -> None: """Create a new OsRelease instance. :param str os_release_file: Path to os-release file to be parsed. diff --git a/craft_archives/repo/apt_sources_manager.py b/craft_archives/repo/apt_sources_manager.py index 4a70bf9..1fa744e 100644 --- a/craft_archives/repo/apt_sources_manager.py +++ b/craft_archives/repo/apt_sources_manager.py @@ -32,7 +32,7 @@ _DEFAULT_SOURCES_DIRECTORY = Path("/etc/apt/sources.list.d") -def _construct_deb822_source( +def _construct_deb822_source( # noqa: PLR0913 *, architectures: Optional[List[str]] = None, components: Optional[List[str]] = None, @@ -87,7 +87,7 @@ def __init__( self._sources_list_d = sources_list_d or _DEFAULT_SOURCES_DIRECTORY self._keyrings_dir = keyrings_dir or apt_key_manager.KEYRINGS_PATH - def _install_sources( + def _install_sources( # noqa: PLR0913 self, *, architectures: Optional[List[str]] = None, diff --git a/craft_archives/repo/package_repository.py b/craft_archives/repo/package_repository.py index 6aa0e68..88649d5 100644 --- a/craft_archives/repo/package_repository.py +++ b/craft_archives/repo/package_repository.py @@ -238,7 +238,7 @@ def name(self) -> str: def _path_non_empty( cls, path: Optional[str], values: Dict[str, Any] ) -> Optional[str]: - if path is not None and path == "": + if path is not None and not path: raise _create_validation_error( url=values.get("url"), message="Invalid path; Paths must be non-empty strings.", diff --git a/craft_archives/utils.py b/craft_archives/utils.py index c90a829..eca919a 100644 --- a/craft_archives/utils.py +++ b/craft_archives/utils.py @@ -62,7 +62,7 @@ def __str__(self) -> str: def get_os_platform( - filepath: Path = Path("/etc/os-release"), # noqa: B008 + filepath: Path = Path("/etc/os-release"), ) -> OSPlatform: """Determine a system/release combo for an OS using /etc/os-release if available.""" system = platform.system() diff --git a/pyproject.toml b/pyproject.toml index 7743db3..09bf9a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ dev = [ dev-lint = [ # Static linting environment dependencies "black==23.1.0", "codespell[tomli]==2.2.4", - "ruff==0.0.254", + "ruff==0.0.267", ] types = [ # Dependencies for typing. Both types packages and mypy itself. "mypy[reports]==1.1.1", @@ -190,7 +190,7 @@ extend-select = [ "S701", # jinja2 templates without autoescape "B0", # Common mistakes and typos. "RUF001", "RUF002", "RUF003", # Ambiguous unicode characters - "RUF004", # Keyword arguments must come after starred arguments + "B026", # Keyword arguments must come after starred arguments "RUF005", # Encourages unpacking rather than concatenation "RUF100", # #noqa directive that doesn't flag anything. ]