Skip to content

Commit 9e167ac

Browse files
committed
lint: Improve code readability by proper linting
1 parent 9435c2c commit 9e167ac

File tree

6 files changed

+16
-6
lines changed

6 files changed

+16
-6
lines changed

app/db/session.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ def init_db() -> None:
6767
environment=settings.environment,
6868
)
6969

70-
7170
# Create session factory
7271
async_session_factory = async_sessionmaker(
7372
engine,

app/messaging/connection.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,11 @@ def channel(self) -> Optional[Channel]:
112112
@property
113113
def is_connected(self) -> bool:
114114
"""Check if connected to RabbitMQ."""
115-
return self._is_connected and self._connection is not None and not self._connection.is_closed
115+
return (
116+
self._is_connected
117+
and self._connection is not None
118+
and not self._connection.is_closed
119+
)
116120

117121
async def declare_queue(
118122
self, queue_name: str, durable: bool = True, auto_delete: bool = False

app/messaging/consumer.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,14 @@ def _validate_message(self, data: dict) -> bool:
156156
message_data = data["data"]
157157

158158
# Check required message fields
159-
required_fields = ["type", "receiver", "service_name", "log_level", "message", "timestamp"]
159+
required_fields = [
160+
"type",
161+
"receiver",
162+
"service_name",
163+
"log_level",
164+
"message",
165+
"timestamp"
166+
]
160167

161168
if not all(field in message_data for field in required_fields):
162169
return False

app/services/analysis_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from uuid import UUID
66
import json
77

8-
from sqlalchemy import select, and_
8+
from sqlalchemy import select
99
from sqlalchemy.ext.asyncio import AsyncSession
1010

1111
from app.models.analysis_result import AnalysisResult

app/services/log_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ async def get_unprocessed_logs(self, limit: int = 100) -> List[LogEntry]:
143143
"""Get unprocessed log entries for batch processing."""
144144
query = (
145145
select(LogEntry)
146-
.where(LogEntry.processed == False)
146+
.where(LogEntry.processed.is_(False))
147147
.order_by(LogEntry.timestamp.asc())
148148
.limit(limit)
149149
)

app/services/pattern_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ async def get_active_patterns(
7777
self, service_name: Optional[str] = None, limit: int = 100
7878
) -> List[Pattern]:
7979
"""Get active patterns, optionally filtered by service."""
80-
query = select(Pattern).where(Pattern.is_active == True)
80+
query = select(Pattern).where(Pattern.is_active.is_(True))
8181

8282
if service_name:
8383
query = query.where(Pattern.service_name == service_name)

0 commit comments

Comments
 (0)