From 9ba6f7349cadcf33c22e0d4842f20751384c173c Mon Sep 17 00:00:00 2001 From: Benjamin Thomas Schwertfeger Date: Wed, 6 Dec 2023 17:49:08 +0100 Subject: [PATCH] tryna make pre-commit happy --- .pre-commit-config.yaml | 11 ++++------- kraken/base_api/__init__.py | 2 +- kraken/futures/trade.py | 4 ++-- kraken/spot/funding.py | 4 ++-- kraken/spot/trade.py | 6 +++--- kraken/spot/websocket_v1.py | 4 ++-- 6 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7126f2b9..1b31bfec 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,12 +3,9 @@ # GitHub: https://github.com/btschwertfeger # -default_language_version: - python: "3.11" - repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-yaml - id: check-json @@ -55,7 +52,7 @@ repos: args: - --profile=black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.1 + rev: v0.1.7 hooks: - id: ruff args: @@ -71,7 +68,7 @@ repos: - --show-source - --statistics - repo: https://github.com/pycqa/pylint - rev: v2.17.7 + rev: v3.0.1 hooks: - id: pylint name: pylint @@ -81,7 +78,7 @@ repos: - --rcfile=pyproject.toml - -d=R0801 # ignore duplicate code - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.5.1 + rev: v1.7.1 hooks: - id: mypy name: mypy diff --git a/kraken/base_api/__init__.py b/kraken/base_api/__init__.py index 47749e3f..8e9de817 100644 --- a/kraken/base_api/__init__.py +++ b/kraken/base_api/__init__.py @@ -468,7 +468,7 @@ def _request( # noqa: PLR0913 # pylint: disable=too-many-arguments *, auth: bool = True, return_raw: bool = False, - extra_params: Optional[dict] = None, + extra_params: Optional[str | dict] = None, ) -> dict[str, Any] | list[dict[str, Any]] | list[str] | requests.Response: """ Handles the requested requests, by sending the request, handling the diff --git a/kraken/futures/trade.py b/kraken/futures/trade.py index ab7c174e..449171e0 100644 --- a/kraken/futures/trade.py +++ b/kraken/futures/trade.py @@ -511,7 +511,7 @@ def get_orders_status( extra_params=extra_params, ) - def create_order( # pylint: disable=too-many-arguments # noqa: PLR0913 + def create_order( # pylint: disable=too-many-arguments # noqa: PLR0913, PLR0917 self: Trade, orderType: str, size: str | float, @@ -519,7 +519,7 @@ def create_order( # pylint: disable=too-many-arguments # noqa: PLR0913 side: str, cliOrdId: Optional[str] = None, limitPrice: Optional[str | float] = None, - reduceOnly: Optional[bool] = None, + reduceOnly: Optional[bool] = None, # noqa: FBT001 stopPrice: Optional[str | float] = None, triggerSignal: Optional[str] = None, trailingStopDeviationUnit: Optional[str] = None, diff --git a/kraken/spot/funding.py b/kraken/spot/funding.py index 90bca2de..92aff317 100644 --- a/kraken/spot/funding.py +++ b/kraken/spot/funding.py @@ -161,7 +161,7 @@ def get_recent_deposits_status( method: Optional[str] = None, start: Optional[str] = None, end: Optional[str] = None, - cursor: bool | str = False, # noqa: FBT002 + cursor: bool | str = False, # noqa: FBT001, FBT002 *, extra_params: Optional[dict] = None, ) -> list[dict] | dict: @@ -537,7 +537,7 @@ def withdraw_addresses( aclass: Optional[str] = None, method: Optional[str] = None, key: Optional[str] = None, - verified: Optional[bool] = None, + verified: Optional[bool] = None, # noqa: FBT001 *, extra_params: Optional[dict] = None, ) -> dict: diff --git a/kraken/spot/trade.py b/kraken/spot/trade.py index c240fe70..738b5d38 100644 --- a/kraken/spot/trade.py +++ b/kraken/spot/trade.py @@ -64,7 +64,7 @@ def __enter__(self: Self) -> Self: return self @ensure_string("oflags") - def create_order( # pylint: disable=too-many-branches,too-many-arguments # noqa: PLR0913 PLR0912 + def create_order( # pylint: disable=too-many-branches,too-many-arguments # noqa: PLR0912, PLR0913, PLR0917 self: Trade, ordertype: str, side: str, @@ -443,7 +443,7 @@ def create_order_batch( ) @ensure_string("oflags") - def edit_order( # pylint: disable=too-many-arguments # noqa: PLR0913 + def edit_order( # pylint: disable=too-many-arguments # noqa: PLR0913, PLR0917 self: Trade, txid: str, pair: str, @@ -452,7 +452,7 @@ def edit_order( # pylint: disable=too-many-arguments # noqa: PLR0913 price2: Optional[str | float] = None, oflags: Optional[str] = None, deadline: Optional[str] = None, - cancel_response: Optional[bool] = None, + cancel_response: Optional[bool] = None, # noqa: FBT001 userref: Optional[int] = None, *, truncate: bool = False, diff --git a/kraken/spot/websocket_v1.py b/kraken/spot/websocket_v1.py index 2421c256..7a9f825b 100644 --- a/kraken/spot/websocket_v1.py +++ b/kraken/spot/websocket_v1.py @@ -380,7 +380,7 @@ def private_channel_names(self: KrakenSpotWSClientV1) -> list[str]: return ["ownTrades", "openOrders"] @ensure_string("oflags") - async def create_order( # pylint: disable=too-many-arguments # noqa: PLR0913 + async def create_order( # pylint: disable=too-many-arguments # noqa: PLR0913, PLR0917 self: KrakenSpotWSClientV1, ordertype: str, side: str, @@ -547,7 +547,7 @@ async def create_order( # pylint: disable=too-many-arguments # noqa: PLR0913 await self.send_message(message=payload, private=True) @ensure_string("oflags") - async def edit_order( # pylint: disable=too-many-arguments # noqa: PLR0913 + async def edit_order( # pylint: disable=too-many-arguments # noqa: PLR0913, PLR0917 self: KrakenSpotWSClientV1, orderid: str, reqid: Optional[str | int] = None,