Skip to content

Commit 59fbcab

Browse files
author
SqlRush
committed
Add Grep ignore-file support
1 parent 78b0896 commit 59fbcab

4 files changed

Lines changed: 231 additions & 29 deletions

File tree

docs/claude-code-go-rewrite-plan.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@ test/parity/ # golden tests against TS/official behavior
231231
- 本轮补充:Grep 常用布尔参数继续补齐 ripgrep 长参数 aliases,覆盖 `--line-number``--ignore-case``--fixed-strings``--word-regexp``--invert-match``--only-matching`,并兼容 quoted semantic boolean。
232232
- 本轮补充:Grep multiline 搜索现在支持 ripgrep 风格 `-U``--multiline``multiline-dotall``--multiline-dotall` aliases,统一映射到既有跨行 dotall 匹配逻辑并兼容 quoted semantic boolean。
233233
- 本轮补充:Grep 搜索现在支持 `no_ignore`/`noIgnore`/`no-ignore`/`--no-ignore`,可跳过 `.gitignore`/`.ignore`/`.rgignore` 规则,同时继续排除 VCS metadata 目录并保留 Read deny 额外 ignore 保护;`--no-ignore` 兼容 quoted boolean。
234-
- 本轮补充:Grep 搜索现在支持 ripgrep 风格 `ignore_dot`/`--ignore-dot``no_ignore_dot`/`--no-ignore-dot` aliases;`--no-ignore-dot` 只跳过 `.ignore`/`.rgignore`,保留 `.gitignore` 规则继续生效,并兼容 quoted boolean;既有 `no_ignore_files`/`--no-ignore-files` 保留为同路径兼容输入。
234+
- 本轮补充:Grep 搜索现在支持 ripgrep 风格 `ignore_dot`/`--ignore-dot``no_ignore_dot`/`--no-ignore-dot` aliases;`--no-ignore-dot` 只跳过 `.ignore`/`.rgignore`,保留 `.gitignore` 规则继续生效,并兼容 quoted boolean。
235+
- 本轮补充:Grep 搜索现在支持 ripgrep 风格 `ignore_file`/`--ignore-file`,可读取一个相对当前工作目录匹配的 gitignore 格式规则文件;`no_ignore_files`/`--no-ignore-files` 现在只禁用这些显式 ignore 文件,不再影响 `.gitignore``.ignore``.rgignore`,并兼容 quoted boolean。
235236
- 本轮补充:Grep 搜索现在支持 ripgrep 风格 `ignore_vcs`/`--ignore-vcs``no_ignore_vcs`/`--no-ignore-vcs` aliases;`--no-ignore-vcs` 只跳过 `.gitignore`,保留 `.ignore`/`.rgignore` 规则继续生效,并兼容 quoted boolean。
236237
- 本轮补充:Glob/Grep 层级 ignore 文件现在支持 ripgrep 专用 `.rgignore`,并和 `.gitignore`/`.ignore` 共享解析、否定规则和目录规则语义。
237238
- 本轮补充:Grep 的 `files_with_matches` 输出现在按官方行为使用文件修改时间倒序排序,mtime 相同再按路径排序;分页和 `head_limit` 会在排序后应用。

docs/first-second-parity-audit.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ Covered behavior:
158158
- `Grep` long-line output now accepts `max_columns_preview`/`--max-columns-preview` plus `no_max_columns_preview`/`--no-max-columns-preview`, showing a ripgrep-style truncated preview when `max_columns` is exceeded.
159159
- `Glob`/`Grep` traversal now applies `Read(...)` deny rules from the permission context as extra search ignore rules, hiding denied basename, path, and directory patterns from search results.
160160
- `Glob`/`Grep` hierarchical ignore loading now includes ripgrep-specific `.rgignore` files in addition to `.gitignore` and `.ignore`.
161-
- `Grep` now accepts ripgrep-style `ignore_dot`/`--ignore-dot` and `no_ignore_dot`/`--no-ignore-dot`, letting `.ignore`/`.rgignore` rules be disabled while `.gitignore` remains active; `no_ignore_files`/`--no-ignore-files` remains accepted as a compatibility alias for the same current path.
161+
- `Grep` now accepts ripgrep-style `ignore_dot`/`--ignore-dot` and `no_ignore_dot`/`--no-ignore-dot`, letting `.ignore`/`.rgignore` rules be disabled while `.gitignore` remains active.
162+
- `Grep` now accepts ripgrep-style `ignore_file`/`--ignore-file` for one explicit gitignore-formatted rules file matched relative to the current working directory; `no_ignore_files`/`--no-ignore-files` disables those explicit ignore-file inputs without changing `.gitignore`, `.ignore`, or `.rgignore` loading.
162163
- `Grep` now accepts ripgrep-style `ignore_vcs`/`--ignore-vcs` and `no_ignore_vcs`/`--no-ignore-vcs`, letting `.gitignore` rules be disabled while `.ignore`/`.rgignore` remain active.
163164
- `Read`/`Edit` now coerce quoted semantic strings for `offset`/`limit` and `replace_all`, including whole-decimal numeric strings such as `"2.0"` for integer fields while keeping fractional values rejected.
164165
- `Bash`/`BashOutput` now coerce quoted semantic strings for `timeout`, `run_in_background`/`runInBackground`, and `tail_lines`/`tailLines`, matching official SDK-style number/boolean inputs without relaxing unknown-field validation.

0 commit comments

Comments
 (0)