mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-22 22:44:13 +08:00
prettier
This commit is contained in:
@@ -64,8 +64,12 @@ export function buildDisallowedToolsString(
|
||||
|
||||
// If user has explicitly allowed some hardcoded disallowed tools, remove them from disallowed list
|
||||
if (allowedTools) {
|
||||
const allowedToolsArray = allowedTools.split(",").map(tool => tool.trim());
|
||||
disallowedTools = disallowedTools.filter(tool => !allowedToolsArray.includes(tool));
|
||||
const allowedToolsArray = allowedTools
|
||||
.split(",")
|
||||
.map((tool) => tool.trim());
|
||||
disallowedTools = disallowedTools.filter(
|
||||
(tool) => !allowedToolsArray.includes(tool),
|
||||
);
|
||||
}
|
||||
|
||||
let allDisallowedTools = disallowedTools.join(",");
|
||||
|
||||
@@ -726,7 +726,10 @@ describe("buildDisallowedToolsString", () => {
|
||||
test("should remove hardcoded disallowed tools if they are in allowed tools", () => {
|
||||
const customDisallowedTools = "BadTool1,BadTool2";
|
||||
const allowedTools = "WebSearch,SomeOtherTool";
|
||||
const result = buildDisallowedToolsString(customDisallowedTools, allowedTools);
|
||||
const result = buildDisallowedToolsString(
|
||||
customDisallowedTools,
|
||||
allowedTools,
|
||||
);
|
||||
|
||||
// WebSearch should be removed from disallowed since it's in allowed
|
||||
expect(result).not.toContain("WebSearch");
|
||||
@@ -754,7 +757,10 @@ describe("buildDisallowedToolsString", () => {
|
||||
test("should handle custom disallowed tools when all hardcoded tools are overridden", () => {
|
||||
const customDisallowedTools = "BadTool1,BadTool2";
|
||||
const allowedTools = "WebSearch,WebFetch";
|
||||
const result = buildDisallowedToolsString(customDisallowedTools, allowedTools);
|
||||
const result = buildDisallowedToolsString(
|
||||
customDisallowedTools,
|
||||
allowedTools,
|
||||
);
|
||||
|
||||
// Hardcoded tools should be removed
|
||||
expect(result).not.toContain("WebSearch");
|
||||
|
||||
Reference in New Issue
Block a user