Skip to content

Commit e36a6a3

Browse files
committed
fix: flake 8 linting complaince
1 parent 2b5d25e commit e36a6a3

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

app/core/error_handling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ async def add(
258258

259259
# Prevent unlimited growth
260260
if len(self.failed_messages) > self.max_size:
261-
self.failed_messages = self.failed_messages[-self.max_size :]
261+
self.failed_messages = self.failed_messages[-self.max_size:]
262262

263263
logger.error(
264264
"message_added_to_dlq",

app/db/session.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@ async def endpoint(db: AsyncSession = Depends(get_db)):
105105

106106
async def close_db() -> None:
107107
"""Close database connections and dispose of engine."""
108-
global engine
109-
110108
if engine is not None:
111109
await engine.dispose()
112110
logger.info("database_connections_closed")

app/processing/ai_analyzer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,8 @@ def _build_analysis_prompt(self, log: LogEntry, context: Optional[Dict[str, Any]
269269
"3. `severity`: Severity level (LOW/MEDIUM/HIGH/CRITICAL)",
270270
"4. `impact`: Impact on system/users (LOW/MEDIUM/HIGH)",
271271
"5. `recommendations`: Array of 3 specific actionable recommendations",
272-
"6. `estimated_resolution_time`: Estimated time to resolve (e.g., '15 minutes', '2 hours')",
272+
"6. `estimated_resolution_time`: Estimated time to resolve "
273+
"(e.g., '15 minutes', '2 hours')",
273274
"7. `confidence`: Your confidence in this analysis (0.0 to 1.0)",
274275
"\nRespond with valid JSON only.",
275276
]

app/services/analysis_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ async def perform_comprehensive_analysis(
197197
# 5. Create summary
198198
summary = f"Comprehensive analysis of {service_name} service. "
199199
summary += f"""
200-
Analyzed {total_logs} logs with {error_count} errors ({error_rate:.1f}% error rate).
200+
Analyzed {total_logs} logs with {error_count} errors ({error_rate:.1f}% error rate).
201201
"""
202202
summary += f"Found {len(anomalies)} anomalies and {len(ai_insights)} AI insights."
203203

app/services/pattern_service.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,10 @@ async def analyze_pattern_trends(
225225
pattern_types[pattern.pattern_type] = pattern_types.get(pattern.pattern_type, 0) + 1
226226

227227
# Severity distribution
228-
severity_range = f"{int(pattern.severity_score * 10) * 10}-{int(pattern.severity_score * 10) * 10 + 10}"
228+
severity_range = (
229+
f"{int(pattern.severity_score * 10) * 10}-"
230+
f"{int(pattern.severity_score * 10) * 10 + 10}"
231+
)
229232
severity_distribution[severity_range] = (
230233
severity_distribution.get(severity_range, 0) + 1
231234
)

0 commit comments

Comments
 (0)