refactor: Compiled ignored ruff rules in pyproject

This commit is contained in:
JSC
2025-08-01 09:40:15 +02:00
parent fceff92ca1
commit f68f4d9046
30 changed files with 22 additions and 31 deletions

View File

@@ -43,8 +43,28 @@ exclude = ["alembic"]
select = ["ALL"] select = ["ALL"]
ignore = ["D100", "D103", "TRY301"] ignore = ["D100", "D103", "TRY301"]
[tool.ruff.per-file-ignores] [tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["S101", "S105"] "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] [tool.pytest.ini_options]
filterwarnings = [ filterwarnings = [

View File

@@ -1,5 +1,4 @@
"""Tests for API token endpoints.""" """Tests for API token endpoints."""
# ruff: noqa: ARG002, PLR2004, PLC0415, BLE001, E501
from datetime import UTC, datetime, timedelta from datetime import UTC, datetime, timedelta
from unittest.mock import patch from unittest.mock import patch

View File

@@ -1,5 +1,4 @@
"""Tests for authentication endpoints.""" """Tests for authentication endpoints."""
# ruff: noqa: ARG002, PLR2004, E501, PLC0415, ANN401
from typing import Any from typing import Any
from unittest.mock import patch from unittest.mock import patch

View File

@@ -1,5 +1,4 @@
"""Tests for extraction API endpoints.""" """Tests for extraction API endpoints."""
# ruff: noqa: PLR2004, E501
import pytest import pytest

View File

@@ -1,5 +1,4 @@
"""Tests for player API endpoints.""" """Tests for player API endpoints."""
# ruff: noqa: ARG002, PLR2004, ANN001, ANN201
from unittest.mock import AsyncMock, Mock, patch from unittest.mock import AsyncMock, Mock, patch

View File

@@ -1,5 +1,4 @@
"""Tests for playlist API endpoints.""" """Tests for playlist API endpoints."""
# ruff: noqa: ARG002, PLR2004, E501, PLC0415
import pytest import pytest

View File

@@ -1,5 +1,4 @@
"""Tests for socket API endpoints.""" """Tests for socket API endpoints."""
# ruff: noqa: ARG002, PLR2004, ANN001, ANN201
from unittest.mock import AsyncMock, patch from unittest.mock import AsyncMock, patch

View File

@@ -1,5 +1,4 @@
"""Tests for sound API endpoints.""" """Tests for sound API endpoints."""
# ruff: noqa: ARG002, PLR2004, E501, PLC0415, ANN001, ANN202
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
from unittest.mock import patch from unittest.mock import patch

View File

@@ -1,5 +1,4 @@
"""Tests for VLC player API endpoints.""" """Tests for VLC player API endpoints."""
# ruff: noqa: ARG002, PLR2004, E501
from unittest.mock import AsyncMock from unittest.mock import AsyncMock

View File

@@ -1,5 +1,4 @@
"""Test configuration and fixtures.""" """Test configuration and fixtures."""
# ruff: noqa: ANN401, ANN001
import asyncio import asyncio
from collections.abc import AsyncGenerator from collections.abc import AsyncGenerator

View File

@@ -1,5 +1,4 @@
"""Tests for API token authentication dependencies.""" """Tests for API token authentication dependencies."""
# ruff: noqa: S106
from datetime import UTC, datetime, timedelta from datetime import UTC, datetime, timedelta
from unittest.mock import AsyncMock from unittest.mock import AsyncMock

View File

@@ -1,5 +1,4 @@
"""Tests for credit transaction repository.""" """Tests for credit transaction repository."""
# ruff: noqa: ARG002, E501
import json import json
from collections.abc import AsyncGenerator from collections.abc import AsyncGenerator

View File

@@ -1,5 +1,4 @@
"""Tests for extraction repository.""" """Tests for extraction repository."""
# ruff: noqa: ANN001, ANN201
from unittest.mock import AsyncMock, Mock from unittest.mock import AsyncMock, Mock

View File

@@ -1,5 +1,4 @@
"""Tests for playlist repository.""" """Tests for playlist repository."""
# ruff: noqa: PLR2004, ANN401
from collections.abc import AsyncGenerator from collections.abc import AsyncGenerator
from typing import Any from typing import Any

View File

@@ -1,5 +1,4 @@
"""Tests for sound repository.""" """Tests for sound repository."""
# ruff: noqa: ARG002, PLR2004
from collections.abc import AsyncGenerator from collections.abc import AsyncGenerator

View File

@@ -1,5 +1,4 @@
"""Tests for user repository.""" """Tests for user repository."""
# ruff: noqa: ARG002
from collections.abc import AsyncGenerator from collections.abc import AsyncGenerator

View File

@@ -1,5 +1,4 @@
"""Tests for user OAuth repository.""" """Tests for user OAuth repository."""
# ruff: noqa: ARG002
from collections.abc import AsyncGenerator from collections.abc import AsyncGenerator

View File

@@ -1,5 +1,4 @@
"""Tests for authentication service.""" """Tests for authentication service."""
# ruff: noqa: S106, SLF001, PLC0415
import pytest import pytest
import pytest_asyncio import pytest_asyncio

View File

@@ -1,5 +1,4 @@
"""Tests for credit service.""" """Tests for credit service."""
# ruff: noqa: ANN001, ANN201, PLR2004, E501
import json import json
from unittest.mock import AsyncMock, patch from unittest.mock import AsyncMock, patch

View File

@@ -1,5 +1,4 @@
"""Tests for extraction service.""" """Tests for extraction service."""
# ruff: noqa: ANN001, ANN201, PLR2004, SLF001, E501
import tempfile import tempfile
from pathlib import Path from pathlib import Path

View File

@@ -1,5 +1,4 @@
"""Tests for extraction background processor.""" """Tests for extraction background processor."""
# ruff: noqa: ANN001, ANN201, PLR2004, SLF001
from unittest.mock import AsyncMock, Mock, patch from unittest.mock import AsyncMock, Mock, patch

View File

@@ -1,5 +1,4 @@
"""Tests for OAuth service.""" """Tests for OAuth service."""
# ruff: noqa: ANN001, PLR2004, ANN401, PT011, ANN202, ANN003, ARG001
from typing import Any from typing import Any
from unittest.mock import AsyncMock, Mock, patch from unittest.mock import AsyncMock, Mock, patch

View File

@@ -1,5 +1,4 @@
"""Tests for player service.""" """Tests for player service."""
# ruff: noqa: ANN001, ANN201, ARG002, PLR2004, SLF001, E501, SIM117, ARG005
import asyncio import asyncio
import threading import threading

View File

@@ -1,5 +1,4 @@
"""Tests for playlist service.""" """Tests for playlist service."""
# ruff: noqa: ANN001, ARG002, PLR2004, E501, PLC0415
from collections.abc import AsyncGenerator from collections.abc import AsyncGenerator

View File

@@ -1,5 +1,4 @@
"""Tests for socket service.""" """Tests for socket service."""
# ruff: noqa: ANN001, ANN201, ARG002, PLR2004, SLF001, E501, ANN202
from unittest.mock import AsyncMock, patch from unittest.mock import AsyncMock, patch

View File

@@ -1,5 +1,4 @@
"""Tests for sound normalizer service.""" """Tests for sound normalizer service."""
# ruff: noqa: ANN001, ANN201, ARG002, PLR2004, SLF001, E501, PLC0415
import tempfile import tempfile
from pathlib import Path from pathlib import Path

View File

@@ -1,5 +1,4 @@
"""Tests for sound scanner service.""" """Tests for sound scanner service."""
# ruff: noqa: ANN001, ANN201, ARG002, PLR2004, SLF001, PLC0415, SIM117
import tempfile import tempfile
from pathlib import Path from pathlib import Path

View File

@@ -1,5 +1,4 @@
"""Tests for VLC player service.""" """Tests for VLC player service."""
# ruff: noqa: ANN001, ANN201, PLR2004, SLF001, SIM117, E501, ANN202, PLC0415
import asyncio import asyncio
from pathlib import Path from pathlib import Path

View File

@@ -1,5 +1,4 @@
"""Tests for cookie utilities.""" """Tests for cookie utilities."""
# ruff: noqa: ANN201, E501
from app.utils.cookies import extract_access_token_from_cookies, parse_cookies from app.utils.cookies import extract_access_token_from_cookies, parse_cookies

View File

@@ -1,5 +1,4 @@
"""Tests for credit decorators.""" """Tests for credit decorators."""
# ruff: noqa: ARG001, ANN001, E501, PT012
from collections.abc import Callable from collections.abc import Callable
from typing import Never from typing import Never