Skip to content

Commit a99d380

Browse files
committed
Maintenance: fix static validation issues for updated validators
* move part of tools configuration to the pyproject.toml
1 parent 0784a47 commit a99d380

31 files changed

+604
-575
lines changed

.pydocstyle.ini

Lines changed: 0 additions & 11 deletions
This file was deleted.

.pylintrc

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ limit-inference-results=100
2929
# List of plugins (as comma separated values of python modules names) to load,
3030
# usually to register additional checkers.
3131
load-plugins=pylint.extensions.docstyle,
32+
pylint.extensions.docparams,
3233
pylint.extensions.overlapping_exceptions,
3334
pylint.extensions.emptystring,
3435
pylint.extensions.comparetozero,
3536
pylint.extensions.check_elif,
37+
pylint.extensions.for_any_all,
3638
pylint.extensions.code_style,
3739
pylint.extensions.redefined_variable_type,
3840
pylint.extensions.typing,
@@ -84,7 +86,6 @@ disable=locally-disabled,
8486
too-many-statements,
8587
too-many-instance-attributes,
8688
too-many-lines,
87-
misplaced-comparison-constant,
8889
broad-except,
8990
logging-fstring-interpolation,
9091
logging-format-interpolation
@@ -298,13 +299,6 @@ max-line-length=120
298299
# Maximum number of lines in a module.
299300
max-module-lines=1000
300301

301-
# List of optional constructs for which whitespace checking is disabled. `dict-
302-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
303-
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
304-
# `empty-line` allows space-only lines.
305-
no-space-check=trailing-comma,
306-
dict-separator
307-
308302
# Allow the body of a class to be on the same line as the declaration if body
309303
# contains single statement.
310304
single-line-class-stmt=no

exec_helpers/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2018 - 2021 Alexey Stepanov aka penguinolog.
1+
# Copyright 2018 - 2022 Alexey Stepanov aka penguinolog.
22

33
# Licensed under the Apache License, Version 2.0 (the "License"); you may
44
# not use this file except in compliance with the License. You may obtain
@@ -27,6 +27,10 @@
2727
except ImportError:
2828
pass
2929

30+
if typing.TYPE_CHECKING:
31+
# Standard Library
32+
from collections.abc import Sequence
33+
3034
# noinspection PyUnresolvedReferences
3135
__all__ = (
3236
# pylint: disable=undefined-all-variable
@@ -58,7 +62,7 @@
5862

5963
__locals: dict[str, typing.Any] = locals() # use mutable access for pure lazy loading
6064

61-
__lazy_load_modules: typing.Sequence[str] = (
65+
__lazy_load_modules: Sequence[str] = (
6266
"async_api",
6367
"exceptions",
6468
"exec_result",

exec_helpers/_helpers.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
import shlex
99
import typing
1010

11+
if typing.TYPE_CHECKING:
12+
# Standard Library
13+
from collections.abc import Iterable
14+
1115

1216
def string_bytes_bytearray_as_bytes(src: str | bytes | bytearray) -> bytes:
1317
"""Get bytes string from string/bytes/bytearray union.
@@ -64,11 +68,11 @@ def mask_command(text: str, *rules: str | None) -> str:
6468
return functools.reduce(_mask_command, (rule for rule in rules if rule is not None), text)
6569

6670

67-
def cmd_to_string(command: str | typing.Iterable[str]) -> str:
71+
def cmd_to_string(command: str | Iterable[str]) -> str:
6872
"""Convert command to string for usage with shell.
6973
7074
:param command: original command.
71-
:type command: typing.Union[str, typing.Iterable[str]]
75+
:type command: str | Iterable[str]
7276
:return: command as single string
7377
:rtype: str
7478
"""
@@ -83,7 +87,7 @@ def chroot_command(command: str, chroot_path: str | None = None) -> str:
8387
:param command: original command.
8488
:type command: str
8589
:param chroot_path: chroot path
86-
:type chroot_path: typing.Optional[str]
90+
:type chroot_path: str | None
8791
:return: command to be executed with chroot rules if applicable
8892
:rtype: str
8993
"""

exec_helpers/_log_templates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2018 - 2021 Alexey Stepanov aka penguinolog.
1+
# Copyright 2018 - 2022 Alexey Stepanov aka penguinolog.
22

33
# Copyright 2017 Mirantis, Inc.
44

0 commit comments

Comments
 (0)