diff --git a/.github/renovate.json b/.github/renovate.json index 0fdb8fc..ea7b1cc 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -28,5 +28,8 @@ "automerge": true } ], + "pre-commit": { + "enabled": true + }, "rebaseWhen": "behind-base-branch" } diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 097d6f1..81e6e92 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ --- repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.4 + rev: v0.14.5 hooks: - id: ruff name: 🐶 Ruff lint @@ -13,7 +13,7 @@ repos: name: 🐶 Ruff format - repo: https://github.com/asottile/pyupgrade - rev: v3.17.0 + rev: v3.21.1 hooks: - id: pyupgrade name: ⬆️ Upgrade Python syntax @@ -21,7 +21,7 @@ repos: - --py312-plus - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v6.0.0 hooks: - id: check-added-large-files name: 🗜️ Check for added large files @@ -86,20 +86,20 @@ repos: - id: trailing-whitespace name: ✄ Trim trailing whitespace - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.1.0 + - repo: https://github.com/rbubley/mirrors-prettier + rev: v3.6.2 hooks: - id: prettier name: 💄 Ensuring files are prettier additional_dependencies: - - prettier@3.3.3 - - prettier-plugin-sort-json@3.1.0 + - prettier@3.6.2 + - prettier-plugin-sort-json@4.1.1 exclude_types: - python exclude: ^uv.lock$ - repo: https://github.com/adrienverge/yamllint.git - rev: v1.35.1 + rev: v1.37.1 hooks: - id: yamllint name: 🎗 Check YAML files with yamllint diff --git a/go2rtc_client/exceptions.py b/go2rtc_client/exceptions.py index 2539ee5..17cade7 100644 --- a/go2rtc_client/exceptions.py +++ b/go2rtc_client/exceptions.py @@ -45,13 +45,13 @@ def __str__(self) -> str: ) -def handle_error[**_P, _R]( - func: Callable[_P, Coroutine[Any, Any, _R]], -) -> Callable[_P, Coroutine[Any, Any, _R]]: +def handle_error[**P, R]( + func: Callable[P, Coroutine[Any, Any, R]], +) -> Callable[P, Coroutine[Any, Any, R]]: """Wrap aiohttp and mashumaro errors.""" @wraps(func) - async def _func(*args: _P.args, **kwargs: _P.kwargs) -> _R: + async def _func(*args: P.args, **kwargs: P.kwargs) -> R: try: return await func(*args, **kwargs) except ( diff --git a/go2rtc_client/ws/__init__.py b/go2rtc_client/ws/__init__.py index 4143f45..b3c74ae 100644 --- a/go2rtc_client/ws/__init__.py +++ b/go2rtc_client/ws/__init__.py @@ -11,11 +11,11 @@ ) __all__ = [ + "Go2RtcWsClient", "ReceiveMessages", "SendMessages", - "Go2RtcWsClient", + "WebRTCAnswer", "WebRTCCandidate", "WebRTCOffer", - "WebRTCAnswer", "WsError", ] diff --git a/go2rtc_client/ws/messages.py b/go2rtc_client/ws/messages.py index 5142f1c..e3f7b89 100644 --- a/go2rtc_client/ws/messages.py +++ b/go2rtc_client/ws/messages.py @@ -10,7 +10,7 @@ from mashumaro.mixins.orjson import DataClassORJSONMixin from mashumaro.types import Discriminator from webrtc_models import ( - RTCIceServer, # noqa: TCH002 # Mashumaro needs the import to generate the correct code + RTCIceServer, # noqa: TC002 # Mashumaro needs the import to generate the correct code ) diff --git a/pyproject.toml b/pyproject.toml index 40f28bc..9e510dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -162,8 +162,6 @@ asyncio_mode = "auto" [tool.ruff.lint] ignore = [ - "ANN101", # Self... explanatory - "ANN102", # cls... just as useless "ANN401", # Opinioated warning on disallowing dynamically typed expressions "COM812", # Recommended to disable due conflicts with ruff format "D203", # Conflicts with other rules