Skip to content

Commit 0d37fd9

Browse files
committed
fix(lint): sort imports, remove unused imports, simplify boolean expr, wrap long line
- gateframe/audit/trend.py: remove unused Optional import, sort import block - tests/audit/test_trend.py: sort import block, remove unused TrendReport and WorkflowRunSummary imports, simplify 'True if i < 8 else False' → 'i < 8', wrap 101-char line to satisfy E501 Fixes CI lint failures flagged by ruff check.
1 parent 5926410 commit 0d37fd9

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

gateframe/audit/trend.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
from collections import defaultdict
3434
from dataclasses import dataclass, field
3535
from pathlib import Path
36-
from typing import Optional
37-
3836

3937
# ── Data models ───────────────────────────────────────────────────────────────
4038

tests/audit/test_trend.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
"""Tests for gateframe.audit.trend — ContractTrendAnalyzer."""
22

33
import json
4-
import pytest
54
from pathlib import Path
5+
6+
import pytest
7+
68
from gateframe.audit.trend import (
7-
ContractTrendAnalyzer,
89
ContractTrend,
9-
TrendReport,
10-
WorkflowRunSummary,
11-
_ols_slope,
10+
ContractTrendAnalyzer,
1211
_direction,
12+
_ols_slope,
1313
)
1414

15-
1615
# ── Helpers ───────────────────────────────────────────────────────────────────
1716

1817

@@ -146,7 +145,7 @@ def test_window_limits_runs(self, tmp_path):
146145
entries = []
147146
for i in range(10):
148147
ts = f"2026-04-01T{i:02d}:00:00+00:00"
149-
entries.append(_entry("c", True if i < 8 else False, f"run-{i}", ts))
148+
entries.append(_entry("c", i < 8, f"run-{i}", ts))
150149
_write_audit(log, entries)
151150
report = ContractTrendAnalyzer(log, window=5).analyze()
152151
ct = report.contract_trends[0]
@@ -170,7 +169,8 @@ def test_malformed_lines_skipped(self, tmp_path):
170169
with log.open("w") as f:
171170
f.write("not-json\n")
172171
f.write(json.dumps(_entry("billing", True, "run-1")) + "\n")
173-
f.write(json.dumps(_entry("billing", True, "run-2", "2026-04-01T02:00:00+00:00")) + "\n")
172+
entry = _entry("billing", True, "run-2", "2026-04-01T02:00:00+00:00")
173+
f.write(json.dumps(entry) + "\n")
174174
report = ContractTrendAnalyzer(log).analyze()
175175
assert len(report.contract_trends) == 1
176176

0 commit comments

Comments
 (0)