Skip to content

feat: Support standard gitignore syntax with pathspec library #35

Description

@CodeMaverick-143

Feature Request

Replace naive folder matching in insight/utils.py with standard Git ignore pattern matching using pathspec.

Problem with Current Implementation

Currently, get_ignored_dirs() only matches exact top-level directory names. It cannot handle:

  • Standard glob patterns (e.g., *.min.js, *.log, tests/**)
  • File path patterns (e.g., src/generated/*)
  • Negation patterns (e.g., !important.py)

Proposed Solution

  1. Add pathspec to requirements.txt and setup.py.
  2. Load patterns from .gitignore and .insightignore.
  3. Use pathspec.PathSpec.from_lines("gitwildmatch", patterns) to filter discovered files and directories.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions