Skip to content

Commit 296edfc

Browse files
authored
Mark code-workspace files as protected (#7403)
1 parent 0cfd314 commit 296edfc

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/core/protect/RooProtectedController.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ export class RooProtectedController {
1919
".clinerules*",
2020
".roo/**",
2121
".vscode/**",
22+
"*.code-workspace",
2223
".rooprotected", // For future use
2324
"AGENTS.md",
24-
"AGENT.md", // Alternative singular form for compatibility
25+
"AGENT.md",
2526
]
2627

2728
constructor(cwd: string) {

src/core/protect/__tests__/RooProtectedController.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ describe("RooProtectedController", () => {
4444
expect(controller.isWriteProtected(".vscode/tasks.json")).toBe(true)
4545
})
4646

47+
it("should protect .code-workspace files", () => {
48+
expect(controller.isWriteProtected("myproject.code-workspace")).toBe(true)
49+
expect(controller.isWriteProtected("pentest.code-workspace")).toBe(true)
50+
expect(controller.isWriteProtected(".code-workspace")).toBe(true)
51+
expect(controller.isWriteProtected("folder/workspace.code-workspace")).toBe(true)
52+
})
53+
4754
it("should protect AGENTS.md file", () => {
4855
expect(controller.isWriteProtected("AGENTS.md")).toBe(true)
4956
})
@@ -149,6 +156,7 @@ describe("RooProtectedController", () => {
149156
".clinerules*",
150157
".roo/**",
151158
".vscode/**",
159+
"*.code-workspace",
152160
".rooprotected",
153161
"AGENTS.md",
154162
"AGENT.md",

0 commit comments

Comments
 (0)