fix: resolve all 153 ruff lint errors for CI
Some checks failed
Lint & Test / test (push) Failing after 9s
Some checks failed
Lint & Test / test (push) Failing after 9s
Auto-fixed 138 unused imports and f-string issues. Manually fixed: ambiguous variable names (l→layer), availability-check imports using importlib.util.find_spec, unused Color import, ImagePool forward ref via TYPE_CHECKING, multi-statement semicolons, and E402 suppression.
This commit is contained in:
@@ -4,8 +4,7 @@ These tests exercise the FastAPI route handlers using dependency override
|
||||
to inject test stores, avoiding real hardware dependencies.
|
||||
"""
|
||||
|
||||
from datetime import datetime, timezone
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
from unittest.mock import AsyncMock, MagicMock
|
||||
|
||||
import pytest
|
||||
from fastapi import FastAPI
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
"""Tests for webhook routes — trigger, validation, rate limiting."""
|
||||
|
||||
import time
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
"""Pytest configuration and shared fixtures."""
|
||||
|
||||
import json
|
||||
import os
|
||||
from datetime import datetime, timezone
|
||||
from pathlib import Path
|
||||
from unittest.mock import AsyncMock, MagicMock
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -15,11 +11,8 @@ from wled_controller.storage.sync_clock_store import SyncClockStore
|
||||
from wled_controller.storage.output_target_store import OutputTargetStore
|
||||
from wled_controller.storage.automation import (
|
||||
Automation,
|
||||
AlwaysCondition,
|
||||
WebhookCondition,
|
||||
)
|
||||
from wled_controller.storage.automation_store import AutomationStore
|
||||
from wled_controller.storage.value_source import StaticValueSource, ValueSource
|
||||
from wled_controller.storage.value_source_store import ValueSourceStore
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
"""Tests for AutomationEngine — condition evaluation in isolation."""
|
||||
|
||||
import asyncio
|
||||
from datetime import datetime, timezone
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -12,7 +11,6 @@ from wled_controller.storage.automation import (
|
||||
ApplicationCondition,
|
||||
Automation,
|
||||
DisplayStateCondition,
|
||||
MQTTCondition,
|
||||
StartupCondition,
|
||||
SystemIdleCondition,
|
||||
TimeOfDayCondition,
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
import threading
|
||||
import time
|
||||
|
||||
import pytest
|
||||
|
||||
from wled_controller.core.processing.sync_clock_runtime import SyncClockRuntime
|
||||
|
||||
|
||||
@@ -7,9 +7,7 @@ Uses the `client` fixture (which has the correct auth header set), and
|
||||
helpers to make unauthenticated requests by temporarily removing the header.
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
||||
from tests.e2e.conftest import API_KEY
|
||||
|
||||
|
||||
def _unauth_get(client, url):
|
||||
|
||||
@@ -6,7 +6,6 @@ Tests creating entities, backing up, deleting, then restoring from backup.
|
||||
import io
|
||||
import json
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
class TestBackupRestoreFlow:
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
Tests creating, listing, updating, cloning, and deleting color strip sources.
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
class TestColorStripSourceLifecycle:
|
||||
|
||||
@@ -4,7 +4,6 @@ Tests the complete device lifecycle through the API:
|
||||
create -> get -> update -> brightness -> power -> delete -> verify gone.
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
class TestDeviceLifecycle:
|
||||
|
||||
@@ -4,7 +4,6 @@ Tests target CRUD with a dependency on a device:
|
||||
create device -> create target -> list -> update -> delete target -> cleanup device.
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
class TestOutputTargetLifecycle:
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
"""Tests for BaseJsonStore — the shared data-layer base class."""
|
||||
|
||||
import json
|
||||
import threading
|
||||
from concurrent.futures import ThreadPoolExecutor, as_completed
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
"""Tests for DeviceStore — device CRUD, persistence, name uniqueness, thread safety."""
|
||||
|
||||
import threading
|
||||
from concurrent.futures import ThreadPoolExecutor, as_completed
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ from wled_controller.storage.output_target_store import OutputTargetStore
|
||||
from wled_controller.storage.wled_output_target import WledOutputTarget
|
||||
from wled_controller.storage.key_colors_output_target import (
|
||||
KeyColorsOutputTarget,
|
||||
KeyColorsSettings,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
"""Tests for API endpoints (public + authenticated)."""
|
||||
|
||||
import pytest
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from wled_controller.main import app
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
"""Tests for configuration management."""
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
import yaml
|
||||
@@ -9,13 +7,8 @@ import yaml
|
||||
from wled_controller.config import (
|
||||
Config,
|
||||
ServerConfig,
|
||||
StorageConfig,
|
||||
AuthConfig,
|
||||
MQTTConfig,
|
||||
LoggingConfig,
|
||||
get_config,
|
||||
reload_config,
|
||||
is_demo_mode,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
"""Tests for device storage."""
|
||||
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
|
||||
from wled_controller.storage.device_store import Device, DeviceStore
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
"""Tests for processor manager."""
|
||||
|
||||
import asyncio
|
||||
import pytest
|
||||
import respx
|
||||
from httpx import Response
|
||||
|
||||
from wled_controller.core.processing.processor_manager import ProcessorManager
|
||||
from wled_controller.core.processing.processing_settings import ProcessingSettings
|
||||
|
||||
Reference in New Issue
Block a user