fix(lint): resolve all ruff E402/F401/F841/I001 errors

- Move logger= after imports in planner/routes.py and setup_paddle.py
- Add # noqa: E402 to intentional post-setup imports (app.py, core.py,
  migrate.py, test_supervisor.py)
- Fix unused cursor variables (test_noindex.py) → _
- Move stray csv import to top of test_outreach.py
- Auto-sort import blocks (test_email_templates, test_noindex, test_outreach)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Deeman
2026-02-27 11:52:02 +01:00
parent b149424e12
commit c269caf048
9 changed files with 13 additions and 22 deletions

View File

@@ -12,7 +12,6 @@ import pytest
from padelnomics.core import utcnow_iso
from padelnomics.email_templates import EMAIL_TEMPLATE_REGISTRY, render_email_template
# ── render_email_template() ──────────────────────────────────────────────────

View File

@@ -8,14 +8,9 @@ Covers:
- Article detail page has no robots meta tag for indexable articles
"""
from datetime import UTC, datetime
from unittest.mock import AsyncMock, patch
import pytest
from padelnomics import core
from padelnomics.content import NOINDEX_THRESHOLDS
# ── Threshold unit tests ─────────────────────────────────────────────────────
@@ -156,7 +151,7 @@ class TestArticleDetailRobotsTag:
VALUES (?, ?, 'Noindex Test', '', 'published', '2020-01-01 08:00:00',
'city-pricing', 'en', 1, datetime('now'))""",
(url_path, slug),
) as cursor:
) as _:
pass
await db.commit()
@@ -186,7 +181,7 @@ class TestArticleDetailRobotsTag:
VALUES (?, ?, 'Indexable Test', '', 'published', '2020-01-01 08:00:00',
'city-pricing', 'en', 0, datetime('now'))""",
(url_path, slug),
) as cursor:
) as _:
pass
await db.commit()

View File

@@ -12,21 +12,21 @@ Covers:
- Compose pre-fill (GET /admin/emails/compose with outreach params)
- Compose send pipeline update (POST /admin/emails/compose with outreach type)
"""
import csv as _csv_module
import io
from datetime import UTC, datetime
from unittest.mock import AsyncMock, patch
import pytest
from quart.datastructures import FileStorage
from padelnomics import core
from padelnomics.admin.routes import (
OUTREACH_STATUSES,
get_follow_up_due_count,
get_outreach_pipeline,
get_outreach_suppliers,
)
from quart.datastructures import FileStorage
from padelnomics import core
# ── Fixtures ──────────────────────────────────────────────────────────────────
@@ -832,9 +832,6 @@ class TestActivityTimeline:
assert resp.status_code == 200
# ── CSV writer helper (avoids importing DictWriter at module level) ────────────
import csv as _csv_module
def _csv_writer(buf, fieldnames):

View File

@@ -23,7 +23,7 @@ _spec = _ilu.spec_from_file_location("padelnomics_supervisor", _SUP_PATH)
sup = _ilu.module_from_spec(_spec)
_spec.loader.exec_module(sup)
from padelnomics_extract.proxy import (
from padelnomics_extract.proxy import ( # noqa: E402
load_proxy_urls,
make_round_robin_cycler,
make_sticky_selector,