Skip to content

Commit

Permalink
Fix/Disable Pylint R0917
Browse files Browse the repository at this point in the history
Two ways of fixing this:
- Ignore R0917 for internal functions such as __int__
- Fix the positional arguments with *

Testing against Pylint stable.
Source of Pylint 3.3.1 docs
https://pylint.readthedocs.io/en/stable/user_guide/messages/refactor/too-many-positional-arguments.html

Signed-off-by: Nicola Sella <[email protected]>
  • Loading branch information
inknos committed Sep 24, 2024
1 parent e998990 commit 77455e2
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 8 deletions.
8 changes: 7 additions & 1 deletion podman/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def __init__(
use_ssh_client=True,
max_pool_size=None,
**kwargs,
): # pylint: disable=unused-argument
): # pylint: disable=unused-argument,too-many-positional-arguments
"""Instantiate APIClient object.
Args:
Expand Down Expand Up @@ -199,6 +199,7 @@ def _normalize_url(base_url: str) -> urllib.parse.ParseResult:
def delete(
self,
path: Union[str, bytes],
*,
params: Union[None, bytes, Mapping[str, str]] = None,
headers: Optional[Mapping[str, str]] = None,
timeout: _Timeout = None,
Expand Down Expand Up @@ -233,6 +234,7 @@ def delete(
def get(
self,
path: Union[str, bytes],
*,
params: Union[None, bytes, Mapping[str, List[str]]] = None,
headers: Optional[Mapping[str, str]] = None,
timeout: _Timeout = None,
Expand Down Expand Up @@ -267,6 +269,7 @@ def get(
def head(
self,
path: Union[str, bytes],
*,
params: Union[None, bytes, Mapping[str, str]] = None,
headers: Optional[Mapping[str, str]] = None,
timeout: _Timeout = None,
Expand Down Expand Up @@ -301,6 +304,7 @@ def head(
def post(
self,
path: Union[str, bytes],
*,
params: Union[None, bytes, Mapping[str, str]] = None,
data: _Data = None,
headers: Optional[Mapping[str, str]] = None,
Expand Down Expand Up @@ -338,6 +342,7 @@ def post(
def put(
self,
path: Union[str, bytes],
*,
params: Union[None, bytes, Mapping[str, str]] = None,
data: _Data = None,
headers: Optional[Mapping[str, str]] = None,
Expand Down Expand Up @@ -376,6 +381,7 @@ def _request(
self,
method: str,
path: Union[str, bytes],
*,
data: _Data = None,
params: Union[None, bytes, Mapping[str, str]] = None,
headers: Optional[Mapping[str, str]] = None,
Expand Down
2 changes: 1 addition & 1 deletion podman/api/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def __init__(
max_retries: int = DEFAULT_RETRIES,
pool_block: int = DEFAULT_POOLBLOCK,
**kwargs,
):
): # pylint: disable=too-many-positional-arguments
"""Initialize SSHAdapter.
Args:
Expand Down
2 changes: 1 addition & 1 deletion podman/api/uds.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def __init__(
max_retries=DEFAULT_RETRIES,
pool_block=DEFAULT_POOLBLOCK,
**kwargs,
):
): # pylint: disable=too-many-positional-arguments
"""Initialize UDSAdapter.
Args:
Expand Down
1 change: 1 addition & 0 deletions podman/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def __exit__(self, exc_type, exc_value, traceback) -> None:
@classmethod
def from_env(
cls,
*,
version: str = "auto",
timeout: Optional[int] = None,
max_pool_size: Optional[int] = None,
Expand Down
7 changes: 4 additions & 3 deletions podman/domain/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,20 @@ def diff(self) -> List[Dict[str, int]]:
response.raise_for_status()
return response.json()

# pylint: disable=too-many-arguments,unused-argument
# pylint: disable=too-many-arguments
def exec_run(
self,
cmd: Union[str, List[str]],
*,
stdout: bool = True,
stderr: bool = True,
stdin: bool = False,
tty: bool = False,
privileged: bool = False,
user=None,
detach: bool = False,
stream: bool = False,
socket: bool = False,
stream: bool = False, # pylint: disable=unused-argument
socket: bool = False, # pylint: disable=unused-argument
environment: Union[Mapping[str, str], List[str]] = None,
workdir: str = None,
demux: bool = False,
Expand Down
1 change: 1 addition & 0 deletions podman/domain/containers_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class RunMixin: # pylint: disable=too-few-public-methods
def run(
self,
image: Union[str, Image],
*,
command: Union[str, List[str], None] = None,
stdout=True,
stderr=False,
Expand Down
2 changes: 1 addition & 1 deletion podman/domain/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def info(self, *_, **__) -> Dict[str, Any]:
response.raise_for_status()
return response.json()

def login(
def login( # pylint: disable=too-many-arguments,too-many-positional-arguments,unused-argument
self,
username: str,
password: Optional[str] = None,
Expand Down
2 changes: 1 addition & 1 deletion podman/errors/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def __init__(
command: Union[str, List[str]],
image: str,
stderr: Optional[Iterable[str]] = None,
):
): # pylint: disable=too-many-positional-arguments
"""Initialize ContainerError.
Args:
Expand Down

0 comments on commit 77455e2

Please sign in to comment.