chore: add pre-commit ruff hook with auto-fix
Some checks failed
CI / test-cli (push) Successful in 11s
CI / test-sqlmesh (push) Successful in 12s
CI / test-web (push) Failing after 14s
CI / tag (push) Has been skipped

- scripts/hooks/pre-commit: runs ruff --fix for root and web/ (matching CI)
  and re-stages any auto-fixed files so they land in the commit
- Makefile: add install-hooks target (run once after clone)
- pyproject.toml: exclude web/ from root ruff (web has its own config)
- Fix remaining import sort warnings caught by the new hook

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Deeman
2026-02-28 10:19:29 +01:00
parent c5a218490e
commit 42c1309b20
9 changed files with 36 additions and 13 deletions

View File

@@ -7,7 +7,6 @@ from unittest.mock import AsyncMock, patch
import aiosqlite
import pytest
from beanflows import core
from beanflows.app import create_app

View File

@@ -2,10 +2,6 @@
Unit tests for billing SQL helpers, feature/limit access, and plan determination.
"""
import pytest
from hypothesis import HealthCheck, given
from hypothesis import settings as h_settings
from hypothesis import strategies as st
from beanflows.billing.routes import (
can_access_feature,
get_billing_customer,
@@ -18,6 +14,9 @@ from beanflows.billing.routes import (
upsert_subscription,
)
from beanflows.core import config
from hypothesis import HealthCheck, given
from hypothesis import settings as h_settings
from hypothesis import strategies as st
# ════════════════════════════════════════════════════════════
# get_subscription

View File

@@ -2,7 +2,6 @@
Tests for the billing event hook system.
"""
import pytest
from beanflows.billing.routes import _billing_hooks, _fire_hooks, on_billing_event

View File

@@ -144,9 +144,8 @@ class TestCancelRoute:
# subscription_required decorator
# ════════════════════════════════════════════════════════════
from quart import Blueprint # noqa: E402
from beanflows.auth.routes import subscription_required # noqa: E402
from quart import Blueprint # noqa: E402
test_bp = Blueprint("test", __name__)

View File

@@ -5,13 +5,12 @@ Covers signature verification, event parsing, subscription lifecycle transitions
import json
import pytest
from beanflows.billing.routes import get_billing_customer, get_subscription
from conftest import make_webhook_payload, sign_payload
from hypothesis import HealthCheck, given
from hypothesis import settings as h_settings
from hypothesis import strategies as st
from beanflows.billing.routes import get_billing_customer, get_subscription
WEBHOOK_PATH = "/billing/webhook/paddle"
SIG_HEADER = "Paddle-Signature"

View File

@@ -3,8 +3,6 @@ Tests for role-based access control: role_required decorator, grant/revoke/ensur
and admin route protection.
"""
import pytest
from quart import Blueprint
from beanflows import core
from beanflows.auth.routes import (
ensure_admin_role,
@@ -12,6 +10,7 @@ from beanflows.auth.routes import (
revoke_role,
role_required,
)
from quart import Blueprint
# ════════════════════════════════════════════════════════════
# grant_role / revoke_role