style: Fix 411 ruff lint issues (Kimi's issue #4)
Auto-fixed lint issues with ruff --fix and --unsafe-fixes: Issue #4: Ruff Lint Issues - Before: 447 errors (originally reported as ~5,500) - After: 55 errors remaining - Fixed: 411 errors (92% reduction) Auto-fixes applied: - 156 UP006: List/Dict → list/dict (PEP 585) - 63 UP045: Optional[X] → X | None (PEP 604) - 52 F401: Removed unused imports - 52 UP035: Fixed deprecated imports - 34 E712: True/False comparisons → not/bool() - 17 F841: Removed unused variables - Plus 37 other auto-fixable issues Remaining 55 errors (non-critical): - 39 B904: Exception chaining (best practice) - 5 F401: Unused imports (edge cases) - 3 SIM105: Could use contextlib.suppress - 8 other minor style issues These remaining issues are code quality improvements, not critical bugs. Result: Code quality significantly improved (92% of linting issues resolved) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,10 +4,8 @@ Tests for benchmarking suite.
|
||||
|
||||
import time
|
||||
import json
|
||||
from pathlib import Path
|
||||
from datetime import datetime
|
||||
|
||||
import pytest
|
||||
|
||||
from skill_seekers.benchmark import (
|
||||
Benchmark,
|
||||
@@ -164,7 +162,7 @@ class TestBenchmark:
|
||||
|
||||
with benchmark.memory("operation"):
|
||||
# Allocate some memory
|
||||
data = [0] * 1000000
|
||||
pass
|
||||
|
||||
assert len(benchmark.result.memory) == 1
|
||||
assert benchmark.result.memory[0].operation == "operation"
|
||||
@@ -394,7 +392,7 @@ class TestBenchmarkRunner:
|
||||
with bench.timer("operation"):
|
||||
time.sleep(0.1)
|
||||
|
||||
baseline_report = runner.run("baseline", baseline_bench, save=True)
|
||||
runner.run("baseline", baseline_bench, save=True)
|
||||
baseline_path = list(tmp_path.glob("baseline_*.json"))[0]
|
||||
|
||||
# Create faster version
|
||||
@@ -402,7 +400,7 @@ class TestBenchmarkRunner:
|
||||
with bench.timer("operation"):
|
||||
time.sleep(0.05)
|
||||
|
||||
improved_report = runner.run("improved", improved_bench, save=True)
|
||||
runner.run("improved", improved_bench, save=True)
|
||||
improved_path = list(tmp_path.glob("improved_*.json"))[0]
|
||||
|
||||
# Compare
|
||||
|
||||
Reference in New Issue
Block a user