Skip to content

Commit

Permalink
chore(pyproject: ruff): move pylint warnings from inlines to pyproject
Browse files Browse the repository at this point in the history
  • Loading branch information
actionless committed Sep 26, 2024
1 parent 1a89d15 commit d2cb8ac
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion pikaur/argparse_extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

class ArgumentParserWithUnknowns(ArgumentParser):

def _parse_known_args( # noqa: C901,PLR0914
def _parse_known_args( # noqa: C901
self, arg_strings: list[str], namespace: "Namespace",
) -> "tuple[Namespace, list[str]]":
# replace arg strings that are file references
Expand Down
4 changes: 2 additions & 2 deletions pikaur/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,14 +570,14 @@ def post_process_args(self) -> None:
self.interactive_package_select = True

def validate(self) -> None:
for operation, operation_depends in ARG_DEPENDS.items(): # noqa: PLR1702
for operation, operation_depends in ARG_DEPENDS.items():
if getattr(self, operation):
for arg_depend_on, dependant_args in operation_depends.items():
if not getattr(self, arg_depend_on):
for arg_name in dependant_args:
if getattr(self, arg_name):
raise MissingArgumentError(arg_depend_on, arg_name)
for operation, operation_conflicts in ARG_CONFLICTS.items(): # noqa: PLR1702
for operation, operation_conflicts in ARG_CONFLICTS.items():
if getattr(self, operation):
for args_conflicts, conflicting_args in operation_conflicts.items():
if getattr(self, args_conflicts):
Expand Down
2 changes: 1 addition & 1 deletion pikaur/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def copy_aur_repo(from_path: Path, to_path: Path) -> None:
raise RuntimeError(translate(f"Can't copy '{from_path}' to '{to_path}'."))


class PackageBuild(ComparableType): # noqa: PLR0904
class PackageBuild(ComparableType):
# pylint: disable=too-many-instance-attributes

clone: bool = False
Expand Down
2 changes: 1 addition & 1 deletion pikaur/conflicts.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def find_conflicting_with_new_pkgs(
"""
local_provided = PackageDB.get_local_provided_dict()
new_pkgs_conflicts: dict[str, list[str]] = {}
for conflict_line in new_pkg_conflicts_list: # noqa: PLR1702:
for conflict_line in new_pkg_conflicts_list:
conflict_version_matcher = VersionMatcher(conflict_line, is_pkg_deps=True)
conflict_pkg_name = conflict_version_matcher.pkg_name
if new_pkg_name != conflict_pkg_name:
Expand Down
2 changes: 1 addition & 1 deletion pikaur/info_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def _decorate_aur_info_output(output: str) -> str:
)


def cli_info_packages() -> None: # noqa: PLR0914
def cli_info_packages() -> None:
refresh_pkg_db_if_needed()

args = parse_args()
Expand Down
2 changes: 1 addition & 1 deletion pikaur/install_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def print_package_downgrading(package_name: str, downgrade_version: str) -> None
)


class InstallPackagesCLI: # noqa: PLR0904
class InstallPackagesCLI:

# User input
args: "PikaurArgs"
Expand Down
2 changes: 1 addition & 1 deletion pikaur/install_info_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
logger = create_logger("install_info_fetcher")


class InstallInfoFetcher(ComparableType): # noqa: PLR0904
class InstallInfoFetcher(ComparableType):

repo_packages_install_info: list[RepoInstallInfo]
new_repo_deps_install_info: list[RepoInstallInfo]
Expand Down
4 changes: 2 additions & 2 deletions pikaur/print_department.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def _bold_line(line: str) -> str:
tuple[int, str] | str
)

def pretty_format( # pylint:disable=R0912 # noqa: PLR0914
def pretty_format( # pylint:disable=R0912
pkg_update: "InstallInfo",
) -> tuple[str, type_sort_key]:
common_version, diff_weight = get_common_version(
Expand Down Expand Up @@ -785,7 +785,7 @@ def print_stable_version_upgrades(stable_versions_updates: dict[str, InstallInfo


# pylint:disable=too-many-statements,too-many-branches
def print_package_search_results( # noqa: PLR0914,C901
def print_package_search_results( # noqa: C901
repo_packages: "Iterable[pyalpm.Package]",
aur_packages: "Iterable[AURPackageInfo]",
local_pkgs_versions: dict[str, str],
Expand Down
2 changes: 1 addition & 1 deletion pikaur/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Provider:
saved_providers: ClassVar[dict[str, str]] = {}

@classmethod
def choose( # pylint: disable=too-many-return-statements # noqa: PLR0911
def choose( # pylint: disable=too-many-return-statements
cls,
dependency: str,
options: list[Package],
Expand Down
2 changes: 1 addition & 1 deletion pikaur/updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def find_aur_devel_updates(
return aur_updates


def find_aur_updates( # pylint: disable=too-many-branches # noqa: PLR0914
def find_aur_updates( # pylint: disable=too-many-branches
*, check_stable_versions_of_devel_pkgs: bool = False,
) -> tuple[list[AURInstallInfo], list[str], dict[str, InstallInfo]]:
args = parse_args()
Expand Down
2 changes: 1 addition & 1 deletion pikaur_static/pacman_fallback.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def parse_pacman_cli_info(
field: str | None
value: str | list[str] | dict[str, str | None] | None
field = value = None
for line in lines: # noqa: PLR1702
for line in lines:
if line == "": # noqa: PLC1901
if db_type == "local":
pkg.db = DBPlaceholder(name="local")
Expand Down
12 changes: 9 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,16 @@ select = [
ignore = [
# enable back later:
"ERA001", # commented out code

# already managed by pylint, mb replace completely to ruff later:
"PLR0912", # too many branches
"PLR0913", # too many arguments
"PLR0915", # too many statements
"PLR0904", # too-many-public-methods
"PLR0911", # too-many-return-statements
"PLR0912", # too-many-branches
"PLR0913", # too-many-arguments
"PLR0914", # too-many-locals
"PLR0915", # too-many-statements
"PLR0917", # too-many-positional-arguments
"PLR1702", # too-many-nested-blocks

"PLE1205", # pikaur is using non-default `logging`

Expand Down

0 comments on commit d2cb8ac

Please sign in to comment.