Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/core/protect/RooProtectedController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment "Alternative singular form for compatibility" was removed from the AGENT.md line. Was this intentional? If not, you might want to restore it:

]

constructor(cwd: string) {
Expand Down
8 changes: 8 additions & 0 deletions src/core/protect/__tests__/RooProtectedController.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good comprehensive test coverage! I notice you're testing (without a prefix). Is this a valid workspace filename that VSCode actually uses? If not, we might want to remove this test case to keep tests focused on real-world scenarios.

expect(controller.isWriteProtected("folder/workspace.code-workspace")).toBe(true)
})

it("should protect AGENTS.md file", () => {
expect(controller.isWriteProtected("AGENTS.md")).toBe(true)
})
Expand Down Expand Up @@ -149,6 +156,7 @@ describe("RooProtectedController", () => {
".clinerules*",
".roo/**",
".vscode/**",
"*.code-workspace",
".rooprotected",
"AGENTS.md",
"AGENT.md",
Expand Down
Loading