Mark code-workspace files as protected (#7403)

This commit is contained in:
Matt Rubens 2025-08-26 00:09:14 -04:00 committed by GitHub
parent 0cfd314c00
commit 296edfc829
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

View file

@ -19,9 +19,10 @@ export class RooProtectedController {
".clinerules*",
".roo/**",
".vscode/**",
"*.code-workspace",
".rooprotected", // For future use
"AGENTS.md",
"AGENT.md", // Alternative singular form for compatibility
"AGENT.md",
]
constructor(cwd: string) {

View file

@ -44,6 +44,13 @@ describe("RooProtectedController", () => {
expect(controller.isWriteProtected(".vscode/tasks.json")).toBe(true)
})
it("should protect .code-workspace files", () => {
expect(controller.isWriteProtected("myproject.code-workspace")).toBe(true)
expect(controller.isWriteProtected("pentest.code-workspace")).toBe(true)
expect(controller.isWriteProtected(".code-workspace")).toBe(true)
expect(controller.isWriteProtected("folder/workspace.code-workspace")).toBe(true)
})
it("should protect AGENTS.md file", () => {
expect(controller.isWriteProtected("AGENTS.md")).toBe(true)
})
@ -149,6 +156,7 @@ describe("RooProtectedController", () => {
".clinerules*",
".roo/**",
".vscode/**",
"*.code-workspace",
".rooprotected",
"AGENTS.md",
"AGENT.md",