Skip to content

Commit e6f55fa

Browse files
committed
style: apply yapf formatting to privilege_hits list comp and logger.warning args
1 parent db4e303 commit e6f55fa

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

trpc_agent_sdk/code_executors/local/_unsafe_local_code_executor.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,8 @@ async def execute_code(self, invocation_context: InvocationContext,
144144
# records the decision.
145145
if (report is not None and report.decision == Decision.NEEDS_HUMAN_REVIEW and not should_block):
146146
import logging
147-
logging.getLogger("trpc_agent_sdk.safety").warning(
148-
"TOOL_SAFETY_NEEDS_REVIEW: %s (risk=%s)",
149-
list(report.rule_ids), report.risk_level.value)
147+
logging.getLogger("trpc_agent_sdk.safety").warning("TOOL_SAFETY_NEEDS_REVIEW: %s (risk=%s)",
148+
list(report.rule_ids), report.risk_level.value)
150149

151150
output_parts = []
152151
error_parts = []

trpc_agent_sdk/safety/_rules.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -858,8 +858,9 @@ def _check_bash(self, scan_input: ScanInput, policy: PolicyConfig) -> list[Safet
858858
# would otherwise bypass the CRITICAL privilege rule because the
859859
# line-leading token is `FOO=bar` / `echo`, not `sudo`. The network
860860
# side already scans all tokens; privilege must too.
861-
privilege_hits = [t.split("/")[-1].split("\\")[-1] for t in tokens
862-
if t.split("/")[-1].split("\\")[-1] in _PRIVILEGE_CMDS]
861+
privilege_hits = [
862+
t.split("/")[-1].split("\\")[-1] for t in tokens if t.split("/")[-1].split("\\")[-1] in _PRIVILEGE_CMDS
863+
]
863864

864865
if policy.strict_command_allowlist:
865866
# Fail-closed: when strict mode is on but allowed_commands is

0 commit comments

Comments
 (0)