refactor(safety): apply consistent formatting across services and tests

Improved code readability and uniformity by standardizing line breaks, indentation, and inline conditions across safety-related services, models, and tests, including content filters, validation rules, and emergency controls.
This commit is contained in:
2026-01-03 16:23:39 +01:00
parent 065e43c5a9
commit 520c06175e
23 changed files with 123 additions and 81 deletions

View File

@@ -220,7 +220,9 @@ class TestScan:
filter_all: ContentFilter,
) -> None:
"""Test scanning for specific categories only."""
content = "Email: test@example.com, token: ghp_abc123456789012345678901234567890123"
content = (
"Email: test@example.com, token: ghp_abc123456789012345678901234567890123"
)
# Scan only for secrets
matches = await filter_all.scan(

View File

@@ -321,8 +321,7 @@ class TestLoadRulesFromPolicy:
validator.load_rules_from_policy(policy)
approval_rules = [
r for r in validator._rules
if r.decision == SafetyDecision.REQUIRE_APPROVAL
r for r in validator._rules if r.decision == SafetyDecision.REQUIRE_APPROVAL
]
assert len(approval_rules) == 1