fix(lint): auto-fix ruff violations and tune lint rules
- Auto-fixed 4,496 lint issues (import sorting, modern syntax, etc.) - Added ignore rules for patterns intentional in this codebase: E402 (late imports), E712 (SQLAlchemy filters), B904 (raise from), SIM108/SIM105/SIM117 (readability preferences) - Added per-file ignores for tests and scripts - Excluded broken scripts/rename_terminology.py (has curly quotes) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
10
tests/fixtures/message_fixtures.py
vendored
10
tests/fixtures/message_fixtures.py
vendored
@@ -6,6 +6,8 @@ Note: Fixtures should NOT use db.expunge() as it breaks lazy loading.
|
||||
See tests/conftest.py for details on fixture best practices.
|
||||
"""
|
||||
|
||||
from datetime import UTC
|
||||
|
||||
import pytest
|
||||
|
||||
from app.modules.messaging.models import (
|
||||
@@ -171,14 +173,14 @@ def test_message_with_attachment(db, test_conversation_admin_store, test_admin):
|
||||
@pytest.fixture
|
||||
def closed_conversation(db, test_admin, test_store_user, test_store):
|
||||
"""Create a closed conversation."""
|
||||
from datetime import datetime, timezone
|
||||
from datetime import datetime
|
||||
|
||||
conversation = Conversation(
|
||||
conversation_type=ConversationType.ADMIN_STORE,
|
||||
subject="Closed Conversation",
|
||||
store_id=test_store.id,
|
||||
is_closed=True,
|
||||
closed_at=datetime.now(timezone.utc),
|
||||
closed_at=datetime.now(UTC),
|
||||
closed_by_type=ParticipantType.ADMIN,
|
||||
closed_by_id=test_admin.id,
|
||||
)
|
||||
@@ -314,14 +316,14 @@ def store_api_conversation(db, test_admin, test_store_user, test_store_with_stor
|
||||
@pytest.fixture
|
||||
def store_api_closed_conversation(db, test_admin, test_store_user, test_store_with_store_user):
|
||||
"""Create a closed conversation for store API tests."""
|
||||
from datetime import datetime, timezone
|
||||
from datetime import datetime
|
||||
|
||||
conversation = Conversation(
|
||||
conversation_type=ConversationType.ADMIN_STORE,
|
||||
subject="Store API Closed Conversation",
|
||||
store_id=test_store_with_store_user.id,
|
||||
is_closed=True,
|
||||
closed_at=datetime.now(timezone.utc),
|
||||
closed_at=datetime.now(UTC),
|
||||
closed_by_type=ParticipantType.ADMIN,
|
||||
closed_by_id=test_admin.id,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user