forked from cardosofelipe/fast-next-template
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:
@@ -66,9 +66,7 @@ class RollbackManager:
|
||||
"""
|
||||
config = get_safety_config()
|
||||
|
||||
self._checkpoint_dir = Path(
|
||||
checkpoint_dir or config.checkpoint_dir
|
||||
)
|
||||
self._checkpoint_dir = Path(checkpoint_dir or config.checkpoint_dir)
|
||||
self._retention_hours = retention_hours or config.checkpoint_retention_hours
|
||||
|
||||
self._checkpoints: dict[str, Checkpoint] = {}
|
||||
@@ -231,7 +229,9 @@ class RollbackManager:
|
||||
success=success,
|
||||
actions_rolled_back=actions_rolled_back,
|
||||
failed_actions=failed_actions,
|
||||
error=None if success else f"Failed to rollback {len(failed_actions)} items",
|
||||
error=None
|
||||
if success
|
||||
else f"Failed to rollback {len(failed_actions)} items",
|
||||
)
|
||||
|
||||
if success:
|
||||
@@ -294,8 +294,7 @@ class RollbackManager:
|
||||
|
||||
if not include_expired:
|
||||
checkpoints = [
|
||||
c for c in checkpoints
|
||||
if c.expires_at is None or c.expires_at > now
|
||||
c for c in checkpoints if c.expires_at is None or c.expires_at > now
|
||||
]
|
||||
|
||||
return checkpoints
|
||||
|
||||
Reference in New Issue
Block a user