Skip to content

Commit 96cbab1

Browse files
continue[bot]Continue
andcommitted
style: run prettier on terminal security code
Fix code formatting to pass prettier checks in CI. Generated with [Continue](https://continue.dev) Co-Authored-By: Continue <[email protected]> Co-authored-by: Username <[email protected]>
1 parent 3e66f6e commit 96cbab1

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

packages/terminal-security/src/evaluateTerminalCommandSecurity.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,38 +53,42 @@ export function evaluateTerminalCommandSecurity(
5353
// Split on line breaks to handle multi-line commands
5454
// Newlines are command separators in shells, similar to semicolons
5555
const commandLines = normalizedCommand.split(/\r?\n|\r/);
56-
56+
5757
// If there are multiple lines, evaluate each separately
5858
if (commandLines.length > 1) {
5959
let mostRestrictivePolicy: ToolPolicy = basePolicy;
60-
60+
6161
for (const line of commandLines) {
6262
const trimmedLine = line.trim();
63-
63+
6464
// Skip empty lines
6565
if (trimmedLine === "") {
6666
continue;
6767
}
68-
68+
6969
// Parse and evaluate this line
7070
const tokens = parse(trimmedLine);
71-
const linePolicy = evaluateTokensSecurity(tokens, basePolicy, trimmedLine);
72-
71+
const linePolicy = evaluateTokensSecurity(
72+
tokens,
73+
basePolicy,
74+
trimmedLine,
75+
);
76+
7377
// Track the most restrictive policy
7478
mostRestrictivePolicy = getMostRestrictive(
7579
mostRestrictivePolicy,
7680
linePolicy,
7781
);
78-
82+
7983
// If we found a disabled command, return immediately
8084
if (mostRestrictivePolicy === "disabled") {
8185
return "disabled";
8286
}
8387
}
84-
88+
8589
return mostRestrictivePolicy;
8690
}
87-
91+
8892
// Single line command - parse and evaluate normally
8993
const tokens = parse(normalizedCommand);
9094

0 commit comments

Comments
 (0)