diff --git a/pyproject.toml b/pyproject.toml index 3fb787e..e7e2726 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,8 +43,28 @@ exclude = ["alembic"] select = ["ALL"] ignore = ["D100", "D103", "TRY301"] -[tool.ruff.per-file-ignores] -"tests/**/*.py" = ["S101", "S105"] +[tool.ruff.lint.per-file-ignores] +"tests/**/*.py" = [ + "S101", # Use of assert detected + "S105", # Possible hardcoded password + "S106", # Possible hardcoded password + "ANN001", # Missing type annotation for function argument + "ANN003", # Missing type annotation for **kwargs + "ANN201", # Missing return type annotation for public function + "ANN202", # Missing return type annotation for private function + "ANN401", # Dynamically typed expressions (typing.Any) are disallowed + "ARG001", # Unused function argument + "ARG002", # Unused method argument + "ARG005", # Unused lambda argument + "BLE001", # Do not catch blind exception + "E501", # Line too long + "PLR2004", # Magic value used in comparison + "PLC0415", # `import` should be at top-level + "SLF001", # Private member accessed + "SIM117", # Use a single `if` statement + "PT011", # `pytest.raises()` is too broad + "PT012", # `pytest.raises()` block should contain a single simple statement +] [tool.pytest.ini_options] filterwarnings = [ diff --git a/tests/api/v1/test_api_token_endpoints.py b/tests/api/v1/test_api_token_endpoints.py index 282983e..8410407 100644 --- a/tests/api/v1/test_api_token_endpoints.py +++ b/tests/api/v1/test_api_token_endpoints.py @@ -1,5 +1,4 @@ """Tests for API token endpoints.""" -# ruff: noqa: ARG002, PLR2004, PLC0415, BLE001, E501 from datetime import UTC, datetime, timedelta from unittest.mock import patch diff --git a/tests/api/v1/test_auth_endpoints.py b/tests/api/v1/test_auth_endpoints.py index a837076..f9746ea 100644 --- a/tests/api/v1/test_auth_endpoints.py +++ b/tests/api/v1/test_auth_endpoints.py @@ -1,5 +1,4 @@ """Tests for authentication endpoints.""" -# ruff: noqa: ARG002, PLR2004, E501, PLC0415, ANN401 from typing import Any from unittest.mock import patch diff --git a/tests/api/v1/test_extraction_endpoints.py b/tests/api/v1/test_extraction_endpoints.py index 498a239..bef5d61 100644 --- a/tests/api/v1/test_extraction_endpoints.py +++ b/tests/api/v1/test_extraction_endpoints.py @@ -1,5 +1,4 @@ """Tests for extraction API endpoints.""" -# ruff: noqa: PLR2004, E501 import pytest diff --git a/tests/api/v1/test_player_endpoints.py b/tests/api/v1/test_player_endpoints.py index 82387a1..2be19c7 100644 --- a/tests/api/v1/test_player_endpoints.py +++ b/tests/api/v1/test_player_endpoints.py @@ -1,5 +1,4 @@ """Tests for player API endpoints.""" -# ruff: noqa: ARG002, PLR2004, ANN001, ANN201 from unittest.mock import AsyncMock, Mock, patch diff --git a/tests/api/v1/test_playlist_endpoints.py b/tests/api/v1/test_playlist_endpoints.py index d86065e..c47efd3 100644 --- a/tests/api/v1/test_playlist_endpoints.py +++ b/tests/api/v1/test_playlist_endpoints.py @@ -1,5 +1,4 @@ """Tests for playlist API endpoints.""" -# ruff: noqa: ARG002, PLR2004, E501, PLC0415 import pytest diff --git a/tests/api/v1/test_socket_endpoints.py b/tests/api/v1/test_socket_endpoints.py index e289e35..e0532bb 100644 --- a/tests/api/v1/test_socket_endpoints.py +++ b/tests/api/v1/test_socket_endpoints.py @@ -1,5 +1,4 @@ """Tests for socket API endpoints.""" -# ruff: noqa: ARG002, PLR2004, ANN001, ANN201 from unittest.mock import AsyncMock, patch diff --git a/tests/api/v1/test_sound_endpoints.py b/tests/api/v1/test_sound_endpoints.py index 236c428..2eb2032 100644 --- a/tests/api/v1/test_sound_endpoints.py +++ b/tests/api/v1/test_sound_endpoints.py @@ -1,5 +1,4 @@ """Tests for sound API endpoints.""" -# ruff: noqa: ARG002, PLR2004, E501, PLC0415, ANN001, ANN202 from typing import TYPE_CHECKING from unittest.mock import patch diff --git a/tests/api/v1/test_vlc_endpoints.py b/tests/api/v1/test_vlc_endpoints.py index 706ac0e..0ec9be1 100644 --- a/tests/api/v1/test_vlc_endpoints.py +++ b/tests/api/v1/test_vlc_endpoints.py @@ -1,5 +1,4 @@ """Tests for VLC player API endpoints.""" -# ruff: noqa: ARG002, PLR2004, E501 from unittest.mock import AsyncMock diff --git a/tests/conftest.py b/tests/conftest.py index bb92133..79b27a6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,5 +1,4 @@ """Test configuration and fixtures.""" -# ruff: noqa: ANN401, ANN001 import asyncio from collections.abc import AsyncGenerator diff --git a/tests/core/test_api_token_dependencies.py b/tests/core/test_api_token_dependencies.py index 8a55731..6a6b154 100644 --- a/tests/core/test_api_token_dependencies.py +++ b/tests/core/test_api_token_dependencies.py @@ -1,5 +1,4 @@ """Tests for API token authentication dependencies.""" -# ruff: noqa: S106 from datetime import UTC, datetime, timedelta from unittest.mock import AsyncMock diff --git a/tests/repositories/test_credit_transaction.py b/tests/repositories/test_credit_transaction.py index efa2ce5..d79755c 100644 --- a/tests/repositories/test_credit_transaction.py +++ b/tests/repositories/test_credit_transaction.py @@ -1,5 +1,4 @@ """Tests for credit transaction repository.""" -# ruff: noqa: ARG002, E501 import json from collections.abc import AsyncGenerator diff --git a/tests/repositories/test_extraction.py b/tests/repositories/test_extraction.py index 95540b9..f6f1c37 100644 --- a/tests/repositories/test_extraction.py +++ b/tests/repositories/test_extraction.py @@ -1,5 +1,4 @@ """Tests for extraction repository.""" -# ruff: noqa: ANN001, ANN201 from unittest.mock import AsyncMock, Mock diff --git a/tests/repositories/test_playlist.py b/tests/repositories/test_playlist.py index b3ad9d7..da71c87 100644 --- a/tests/repositories/test_playlist.py +++ b/tests/repositories/test_playlist.py @@ -1,5 +1,4 @@ """Tests for playlist repository.""" -# ruff: noqa: PLR2004, ANN401 from collections.abc import AsyncGenerator from typing import Any diff --git a/tests/repositories/test_sound.py b/tests/repositories/test_sound.py index 7fd6228..464006c 100644 --- a/tests/repositories/test_sound.py +++ b/tests/repositories/test_sound.py @@ -1,5 +1,4 @@ """Tests for sound repository.""" -# ruff: noqa: ARG002, PLR2004 from collections.abc import AsyncGenerator diff --git a/tests/repositories/test_user.py b/tests/repositories/test_user.py index cbd9371..6b3171e 100644 --- a/tests/repositories/test_user.py +++ b/tests/repositories/test_user.py @@ -1,5 +1,4 @@ """Tests for user repository.""" -# ruff: noqa: ARG002 from collections.abc import AsyncGenerator diff --git a/tests/repositories/test_user_oauth.py b/tests/repositories/test_user_oauth.py index ccd5de6..4769b54 100644 --- a/tests/repositories/test_user_oauth.py +++ b/tests/repositories/test_user_oauth.py @@ -1,5 +1,4 @@ """Tests for user OAuth repository.""" -# ruff: noqa: ARG002 from collections.abc import AsyncGenerator diff --git a/tests/services/test_auth_service.py b/tests/services/test_auth_service.py index eab7851..774efd3 100644 --- a/tests/services/test_auth_service.py +++ b/tests/services/test_auth_service.py @@ -1,5 +1,4 @@ """Tests for authentication service.""" -# ruff: noqa: S106, SLF001, PLC0415 import pytest import pytest_asyncio diff --git a/tests/services/test_credit.py b/tests/services/test_credit.py index 49cb693..5bc4ae5 100644 --- a/tests/services/test_credit.py +++ b/tests/services/test_credit.py @@ -1,5 +1,4 @@ """Tests for credit service.""" -# ruff: noqa: ANN001, ANN201, PLR2004, E501 import json from unittest.mock import AsyncMock, patch diff --git a/tests/services/test_extraction.py b/tests/services/test_extraction.py index dde6ea9..fed5308 100644 --- a/tests/services/test_extraction.py +++ b/tests/services/test_extraction.py @@ -1,5 +1,4 @@ """Tests for extraction service.""" -# ruff: noqa: ANN001, ANN201, PLR2004, SLF001, E501 import tempfile from pathlib import Path diff --git a/tests/services/test_extraction_processor.py b/tests/services/test_extraction_processor.py index 07f28b5..af0cf64 100644 --- a/tests/services/test_extraction_processor.py +++ b/tests/services/test_extraction_processor.py @@ -1,5 +1,4 @@ """Tests for extraction background processor.""" -# ruff: noqa: ANN001, ANN201, PLR2004, SLF001 from unittest.mock import AsyncMock, Mock, patch diff --git a/tests/services/test_oauth_service.py b/tests/services/test_oauth_service.py index 942f2d9..c9c3a32 100644 --- a/tests/services/test_oauth_service.py +++ b/tests/services/test_oauth_service.py @@ -1,5 +1,4 @@ """Tests for OAuth service.""" -# ruff: noqa: ANN001, PLR2004, ANN401, PT011, ANN202, ANN003, ARG001 from typing import Any from unittest.mock import AsyncMock, Mock, patch diff --git a/tests/services/test_player.py b/tests/services/test_player.py index 08d43fb..7e18256 100644 --- a/tests/services/test_player.py +++ b/tests/services/test_player.py @@ -1,5 +1,4 @@ """Tests for player service.""" -# ruff: noqa: ANN001, ANN201, ARG002, PLR2004, SLF001, E501, SIM117, ARG005 import asyncio import threading diff --git a/tests/services/test_playlist.py b/tests/services/test_playlist.py index 418b4ee..7fb32a6 100644 --- a/tests/services/test_playlist.py +++ b/tests/services/test_playlist.py @@ -1,5 +1,4 @@ """Tests for playlist service.""" -# ruff: noqa: ANN001, ARG002, PLR2004, E501, PLC0415 from collections.abc import AsyncGenerator diff --git a/tests/services/test_socket_service.py b/tests/services/test_socket_service.py index bbdec12..1d64d34 100644 --- a/tests/services/test_socket_service.py +++ b/tests/services/test_socket_service.py @@ -1,5 +1,4 @@ """Tests for socket service.""" -# ruff: noqa: ANN001, ANN201, ARG002, PLR2004, SLF001, E501, ANN202 from unittest.mock import AsyncMock, patch diff --git a/tests/services/test_sound_normalizer.py b/tests/services/test_sound_normalizer.py index 599a388..d1e4f24 100644 --- a/tests/services/test_sound_normalizer.py +++ b/tests/services/test_sound_normalizer.py @@ -1,5 +1,4 @@ """Tests for sound normalizer service.""" -# ruff: noqa: ANN001, ANN201, ARG002, PLR2004, SLF001, E501, PLC0415 import tempfile from pathlib import Path diff --git a/tests/services/test_sound_scanner.py b/tests/services/test_sound_scanner.py index ddac3b1..b0b861a 100644 --- a/tests/services/test_sound_scanner.py +++ b/tests/services/test_sound_scanner.py @@ -1,5 +1,4 @@ """Tests for sound scanner service.""" -# ruff: noqa: ANN001, ANN201, ARG002, PLR2004, SLF001, PLC0415, SIM117 import tempfile from pathlib import Path diff --git a/tests/services/test_vlc_player.py b/tests/services/test_vlc_player.py index 9218633..c26eef9 100644 --- a/tests/services/test_vlc_player.py +++ b/tests/services/test_vlc_player.py @@ -1,5 +1,4 @@ """Tests for VLC player service.""" -# ruff: noqa: ANN001, ANN201, PLR2004, SLF001, SIM117, E501, ANN202, PLC0415 import asyncio from pathlib import Path diff --git a/tests/utils/test_cookies.py b/tests/utils/test_cookies.py index abcb5ca..2452ead 100644 --- a/tests/utils/test_cookies.py +++ b/tests/utils/test_cookies.py @@ -1,5 +1,4 @@ """Tests for cookie utilities.""" -# ruff: noqa: ANN201, E501 from app.utils.cookies import extract_access_token_from_cookies, parse_cookies diff --git a/tests/utils/test_credit_decorators.py b/tests/utils/test_credit_decorators.py index 7a9ea60..5adb957 100644 --- a/tests/utils/test_credit_decorators.py +++ b/tests/utils/test_credit_decorators.py @@ -1,5 +1,4 @@ """Tests for credit decorators.""" -# ruff: noqa: ARG001, ANN001, E501, PT012 from collections.abc import Callable from typing import Never