goose icon indicating copy to clipboard operation
goose copied to clipboard

feat: Read .gooseignore to Restrict access to files or Directories

Open ZhenLian opened this issue 1 year ago • 1 comments

Description

This aims to implement the feature described in issue #1065, enabling Goose's developer tool to read a .gooseignore file, which can be defined globally or locally (similar to how the .goosehints file is read). The tool will prevent text_editor or bash from opening any files or directories specified in .gooseignore. The naming conventions for .gooseignore align with those defined in Gitignore documentation.

testing

  • unit tests and tested with cargo test
  • tested on Goose CLI ------------------screenshots for the 3rd round of review goose can take case-insensitive scenarios into account: goose6

------------------screenshots for the second round of review the bash tool ignoring feature still works as expected: Screenshot 2025-02-25 at 9 41 13 PM

and if we remove all ignore files, things will behave normal: Screenshot 2025-02-25 at 9 43 39 PM

------------------screenshots for initial commit

goose1 goose2 and here is my .gooseignore file used for testing: Screenshot 2025-02-25 at 8 12 56 AM

ZhenLian avatar Feb 12 '25 02:02 ZhenLian

@wendytang Hey Wendy, thanks a lot for the review! I've updated the code - would you mind taking a look again? Thank you!

ZhenLian avatar Feb 26 '25 05:02 ZhenLian

@wendytang Hey Wendy, I am going to merge this, but if you spot anything that we need to address, feel free to let me know. I am happy to take a look! :)

ZhenLian avatar Feb 27 '25 16:02 ZhenLian