Problem Statement
Currently, git-lrc uses standard .gitignore configurations. However, developers often need to commit certain files (like package-lock.json, auto-generated code, database migrations, or translation files) but want to skip sending them to the AI review.
Sending these files to the AI connector:
- Wastes valuable API tokens.
- Increases review latency unnecessarily.
- Clutters the Review UI with noisy comments.
Planned Tech Stack & Implementation
- Language: Go (Golang)
- Libraries: Leverage Go's standard library or
github.com/gobwas/glob for pattern matching.
- Location: Update the internal file collection/staged diff processing logic under
storage/ or internal/appcore/.
Proposed Solution
Add support for a local .lrcignore file in the repository's root directory:
- On running
git lrc review or pre-commit checks, read .lrcignore if present.
- Parse glob patterns (e.g.,
package-lock.json, **/generated/**).
- Exclude matching staged diffs before compiling the payload sent to the AI connector.
Planned Tech Stack & Implementation
- Language: Go (Golang)
- Pattern Matching: Use standard Go libraries (like
path/filepath or standard glob libraries) to handle file pattern matching.
- Integration Points: Integrate the exclusion check inside the staged diff gathering system (typically under the
storage/ or internal/appcore/ modules).
Expected Features
- Local
.lrcignore File Parsing: Detects and parses a .lrcignore file at the root of the active Git repository.
- Glob Pattern Matching: Supports standard wildcard pattern matching (e.g.,
*.lock, **/vendor/**, temp_file.txt).
- Comments and Whitespace Support: Gracefully skips commented lines (starting with
#) and empty lines in the ignore file.
- Fallbacks: If no
.lrcignore is present, it should fallback to default behavior (reviewing all staged files not in .gitignore).
Expected Outcome
- Zero Token Waste: AI Connectors (Gemini, Claude, OpenAI) will only receive relevant diff files, drastically saving API usage.
- Faster Reviews: Less payload size means much faster response times from the AI endpoints.
- Noisy-Free UI: The local Review UI will only display critical, human-written code diffs, making the review process highly productive.
Problem Statement
Currently,
git-lrcuses standard.gitignoreconfigurations. However, developers often need to commit certain files (likepackage-lock.json, auto-generated code, database migrations, or translation files) but want to skip sending them to the AI review.Sending these files to the AI connector:
Planned Tech Stack & Implementation
github.com/gobwas/globfor pattern matching.storage/orinternal/appcore/.Proposed Solution
Add support for a local
.lrcignorefile in the repository's root directory:git lrc reviewor pre-commit checks, read.lrcignoreif present.package-lock.json,**/generated/**).Planned Tech Stack & Implementation
path/filepathor standard glob libraries) to handle file pattern matching.storage/orinternal/appcore/modules).Expected Features
.lrcignoreFile Parsing: Detects and parses a.lrcignorefile at the root of the active Git repository.*.lock,**/vendor/**,temp_file.txt).#) and empty lines in the ignore file..lrcignoreis present, it should fallback to default behavior (reviewing all staged files not in.gitignore).Expected Outcome