dcdpr / dcdpr/jp

Add support for `.ignore` files in file content attachment handler

Open
#192 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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:

  1. Enabling .ignore file support in the WalkBuilder configuration
  2. Ensuring that .ignore files are loaded and processed before applying user-provided patterns
  3. Maintaining the current behavior where explicit user patterns can override .ignore patterns

Resources

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.