-
Notifications
You must be signed in to change notification settings - Fork 0
.gitignore file will handle ** pattern properly in ripgrep. #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: upstream_main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
f5e012e to
658879c
Compare
|
@codex review x 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex Review x 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
8e94133 to
dbeaf68
Compare
|
@codex Review this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| from kaos.path import KaosPath | ||
| from kosong.tooling import CallableTool2, ToolError, ToolOk, ToolReturnValue | ||
| from pathspec import PathSpec | ||
| from pydantic import BaseModel, Field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Declare pathspec runtime dependency
The new Glob implementation imports pathspec.PathSpec, but pathspec is not listed in [project.dependencies] in pyproject.toml (lines 7–26). In a normal install that only pulls runtime dependencies, this module will be missing and importing kimi_cli.tools.file.glob will raise ModuleNotFoundError, breaking the Glob tool entirely. Add pathspec to the project dependencies or make the import optional so production installs do not crash.
Useful? React with 👍 / 👎.
90cfa20 to
d4285b2
Compare
d4285b2 to
b48bbb3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for using the ** (recursive glob) pattern in the glob tool when a .gitignore file is present in the working directory. The implementation ensures that gitignored directories are properly excluded during traversal, making recursive searches safe and efficient.
Key Changes
- Implemented custom gitignore-aware recursive globbing that prunes ignored directories during traversal
- Modified pattern validation to allow
**patterns when.gitignoreexists - Updated error messages to explain the requirement for
.gitignorewith**patterns
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/kimi_cli/tools/file/glob.py | Added gitignore parsing, custom recursive glob implementation with gitignore filtering, and updated validation logic to allow ** patterns with gitignore |
| tests/test_glob.py | Added tests for ** pattern with gitignore, including traversal verification and gitignore respect |
| tests/conftest.py | Reordered imports for consistency |
| src/kimi_cli/tools/shell/init.py | Reordered imports for consistency |
| src/kimi_cli/metadata.py | Reordered imports for consistency |
| src/kimi_cli/app.py | Reordered imports for consistency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4cc9ac0 to
f4a0a32
Compare
|
@codex Review |
|
Codex Review: Didn't find any major issues. Swish! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
1837c93 to
a587f5d
Compare
Signed-off-by: Richard Chien <stdrc@outlook.com>
Signed-off-by: Richard Chien <stdrc@outlook.com>
…MoonshotAI#602) Signed-off-by: Richard Chien <stdrc@outlook.com> Co-authored-by: xiaoju111a <xiaoju111a@users.noreply.github.com> Co-authored-by: Richard Chien <stdrc@outlook.com>
Signed-off-by: Richard Chien <stdrc@outlook.com>
…MoonshotAI#607) Co-authored-by: xiaoju111a <xiaoju111a@users.noreply.github.com>
Signed-off-by: Richard Chien <stdrc@outlook.com>
…turn ToolError Unsafe pattern if can not finding the .gitignore file.
Implemented a method to load and apply .gitignore specifications during the glob search, allowing for exclusion of matches based on the patterns defined in the .gitignore file.
…ored directories are pruned during traversal instead of after the fact. Added helpers to normalize gitignore checks and filter matches consistently.
…tched the glob tool to call it, so the matching logic lives in packages/kaos rather than being inlined in Kimi CLI. This removes the local matching implementation while keeping the same behavior. Updated packages/kaos/src/kaos/__init__.py and src/kimi_cli/tools/file/glob.py.
a587f5d to
71fee41
Compare
@codex review
upstream PR