Skip to content

Feature: Add support for .lrcignore to exclude specific files from AI review #85

Description

@himnishag

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:

  1. Wastes valuable API tokens.
  2. Increases review latency unnecessarily.
  3. 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:

  1. On running git lrc review or pre-commit checks, read .lrcignore if present.
  2. Parse glob patterns (e.g., package-lock.json, **/generated/**).
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions