Add support for `.ignore` files in file content attachment handler
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16
- Forks
- 3
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 121
Description
The jp_attachment_file_content crate should respect .ignore files to make it easy to exclude certain patterns from being added by default, similar to how ripgrep and fd handle ignore files.
Context
Currently, the file content attachment handler only uses the patterns explicitly provided by the user. However, many projects use .ignore files (popularized by tools like ripgrep and fd) to specify files and directories that should be ignored by default across different tools.
According to the ripgrep documentation, .ignore files use the same gitignore syntax but are intended for tool-specific ignoring rather than version control ignoring. The ignore crate that we're already using supports loading .ignore files through the WalkBuilder API.
Proposed Implementation
Modify the get method in FileContent to use the ignore crate's built-in .ignore file support by configuring the WalkBuilder to respect .ignore files. This can be achieved by:
- Enabling
.ignorefile support in theWalkBuilderconfiguration - Ensuring that
.ignorefiles are loaded and processed before applying user-provided patterns - Maintaining the current behavior where explicit user patterns can override
.ignorepatterns
Resources
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in crates/jp_attachment_file_content/src/lib.rs, especially the FileContent get method around lines 80-121, and inspect how its ignore crate WalkBuilder is configured. The work is done when .ignore files are respected before user-provided patterns while explicit user patterns retain their current override behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100