Skip to content

Commit ddcf47f

Browse files
committed
style: fix yapf formatting - single-line raise and scan call
- _policy.py: raise ValueError(...) single-line (was multi-line, yapf forces single-line when under column_limit) - test_tool_filter.py: SafetyScanner.scan(ScanInput(...)) single-line (merged multi-line call, 107 chars < 120 limit)
1 parent 290d18b commit ddcf47f

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

tests/tool_safety/test_tool_filter.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,7 @@ def test_filter_contextvar_does_not_leak_across_calls(tmp_path: Path):
153153
async def _scenario():
154154
# Prime the ContextVar with a stale report as if a prior _after was
155155
# skipped in this same async context.
156-
stale_report = SafetyScanner(PolicyConfig()).scan(
157-
ScanInput(script="sleep 100 &", language="bash"))
156+
stale_report = SafetyScanner(PolicyConfig()).scan(ScanInput(script="sleep 100 &", language="bash"))
158157
assert stale_report.decision.value == "needs_human_review"
159158
_REVIEW_REPORT.set(stale_report)
160159

trpc_agent_sdk/safety/_policy.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,4 @@ def _parse_risk_level(value: Any, default: RiskLevel) -> RiskLevel:
171171
# default would let users believe a stricter policy is active when it
172172
# is not. List valid values so the error is actionable.
173173
valid = [r.value for r in RiskLevel]
174-
raise ValueError(
175-
f"invalid risk level {value!r}; expected one of {valid}"
176-
) from ex
174+
raise ValueError(f"invalid risk level {value!r}; expected one of {valid}") from ex

0 commit comments

Comments
 (0)