Skip to content

Commit ac0998e

Browse files
GeneAIclaude
authored andcommitted
fix: Fix all linting and formatting issues across codebase
- Fix E402 import order in backend/api/wizards.py - Fix B007 loop variable in benchmark_parallelization.py - Fix E741 ambiguous variable name in context_collector.py - Fix F821 undefined name in test_e2e.py (add TEXT_DOCUMENT_DID_OPEN) - Fix F841 unused variables in example files - Run black formatter on all files - Run ruff --fix to auto-fix issues 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b33414b commit ac0998e

File tree

8 files changed

+26
-18
lines changed

8 files changed

+26
-18
lines changed

backend/api/wizards.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Provides REST endpoints for wizard data.
55
"""
66

7+
import time
78

89
from fastapi import FastAPI, HTTPException
910
from fastapi.middleware.cors import CORSMiddleware
@@ -18,8 +19,6 @@
1819
allow_headers=["*"],
1920
)
2021

21-
import time
22-
2322
# Calculate timestamps for realistic created/updated dates
2423
NOW = int(time.time() * 1000)
2524
DAY_MS = 24 * 60 * 60 * 1000

benchmark_parallelization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def benchmark_pipeline(iterations=100):
4444

4545
# Benchmark
4646
start = time.perf_counter()
47-
for i in range(iterations):
47+
for _ in range(iterations):
4848
integration.store_pattern(
4949
content=test_content,
5050
pattern_type="clinical",

empathy_software_plugin/wizards/performance/profiler_parsers.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,16 @@ def parse(self, data: str) -> list[FunctionProfile]:
9393
for line in data.split("\n"):
9494
match = re.match(pattern, line.strip())
9595
if match:
96-
(ncalls, tottime, percall_tot, cumtime, percall_cum, filepath, lineno, funcname) = (
97-
match.groups()
98-
)
96+
(
97+
ncalls,
98+
tottime,
99+
percall_tot,
100+
cumtime,
101+
percall_cum,
102+
filepath,
103+
lineno,
104+
funcname,
105+
) = match.groups()
99106

100107
profiles.append(
101108
FunctionProfile(

examples/coach/lsp/context_collector.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,11 @@ def _get_dependencies(self, file_path: Path) -> str:
202202
elif (project_root / "requirements.txt").exists():
203203
try:
204204
deps = (project_root / "requirements.txt").read_text()
205-
lines = [l.strip() for l in deps.split("\n") if l.strip() and not l.startswith("#")]
205+
lines = [
206+
line.strip()
207+
for line in deps.split("\n")
208+
if line.strip() and not line.startswith("#")
209+
]
206210
return "Python requirements:\n" + "\n".join(lines[:15])
207211
except Exception:
208212
return "Python project (requirements.txt found)"

examples/coach/lsp/tests/test_e2e.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
from ..server import CoachLanguageServer
1616

17+
# LSP protocol method name constant
18+
TEXT_DOCUMENT_DID_OPEN = "textDocument/didOpen"
19+
1720

1821
class TestEndToEnd:
1922
"""End-to-end integration tests"""

examples/domain_wizards/tests/test_healthcare_wizard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def test_wizard_initialization_without_security_warns(self, caplog):
4949
enable_security=False, # Not HIPAA compliant
5050
)
5151

52-
wizard = HealthcareWizard(llm)
52+
HealthcareWizard(llm)
5353

5454
# Should log warning about security not enabled
5555
assert any(

examples/level_5_transformative/run_full_demo.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,14 @@ def analyze_healthcare_handoff(memory: PatternMemory):
103103
# Read healthcare code
104104
healthcare_file = Path(__file__).parent / "data" / "healthcare_handoff_code.py"
105105
with open(healthcare_file) as f:
106-
healthcare_code = f.read()
106+
f.read()
107107

108108
print_info("Analyzing healthcare handoff protocol...")
109109
print_info(f"File: {healthcare_file.name}")
110110
print()
111111

112112
# Use ComplianceWizard to analyze healthcare protocol
113-
wizard = ComplianceWizard()
113+
ComplianceWizard()
114114

115115
# Create mock issues based on the healthcare code's vulnerabilities
116116
issues = [
@@ -190,14 +190,14 @@ def analyze_deployment_pipeline(memory: PatternMemory, healthcare_pattern: dict)
190190
# Read deployment code
191191
deployment_file = Path(__file__).parent / "data" / "deployment_pipeline.py"
192192
with open(deployment_file) as f:
193-
deployment_code = f.read()
193+
f.read()
194194

195195
print_info("Analyzing software deployment pipeline...")
196196
print_info(f"File: {deployment_file.name}")
197197
print()
198198

199199
# Use CICDWizard to analyze deployment
200-
wizard = CICDWizard()
200+
CICDWizard()
201201

202202
print("CICDWizard Analysis:")
203203
print_info("Standard analysis complete")
@@ -317,7 +317,7 @@ def main():
317317
input("\n\nPress Enter to continue to software analysis...\n")
318318

319319
# Step 2: Analyze software domain with cross-domain pattern matching
320-
prediction = analyze_deployment_pipeline(memory, healthcare_pattern)
320+
analyze_deployment_pipeline(memory, healthcare_pattern)
321321

322322
# Summary
323323
print_header("SUMMARY: Level 5 Systems Empathy", "=")

tests/test_clinical_protocol_monitor.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ async def test_analyze_load_protocol_on_demand(
217217
return_value=mock_trajectory_prediction,
218218
),
219219
):
220-
221220
context = {
222221
"patient_id": "12345",
223222
"sensor_data": {"heart_rate": 105, "temperature": 38.5},
@@ -255,7 +254,6 @@ async def test_analyze_with_string_sensor_data(
255254
return_value=mock_trajectory_prediction,
256255
),
257256
):
258-
259257
context = {
260258
"patient_id": "12345",
261259
"sensor_data": '{"heart_rate": 105}',
@@ -284,7 +282,6 @@ async def test_analyze_full_workflow(
284282
return_value=mock_trajectory_prediction,
285283
),
286284
):
287-
288285
context = {
289286
"patient_id": "12345",
290287
"sensor_data": {"heart_rate": 105, "temperature": 38.5},
@@ -338,7 +335,6 @@ async def test_analyze_patient_history_storage(
338335
return_value=mock_trajectory_prediction,
339336
),
340337
):
341-
342338
# First reading
343339
context1 = {"patient_id": "12345", "sensor_data": {"heart_rate": 90}}
344340
await monitor.analyze(context1)
@@ -374,7 +370,6 @@ async def test_analyze_history_truncation(
374370
return_value=mock_trajectory_prediction,
375371
),
376372
):
377-
378373
context = {"patient_id": "12345", "sensor_data": {"heart_rate": 90}}
379374
await monitor.analyze(context)
380375

0 commit comments

Comments
 (0)