Skip to content

Conversation

@filipchristiansen
Copy link
Contributor

This PR removes the helper function _normalize_pattern (and its use inside _parse_patterns)

Before

  • gitingest -e "*/test_*"
    ├── tests/
    │   ├── __init__.py
    │   ├── conftest.py
    │   ├── .pylintrc
    │   └── query_parser/
    │       ├── __init__.py
    │       ├── test_git_host_agnostic.py
    │       └── test_query_parser.py
  • gitingest -e "**/test_*"
  • gitingest -e "/test_*"
    ├── tests/
    │   ├── __init__.py
    │   ├── conftest.py
    │   ├── .pylintrc
    │   └── query_parser/
    │       └── __init__.py

Now:

  • gitingest -e "*/test_*": Same behaviour

  • gitingest -e "**/test_*": Same behaviour

  • gitingest -e "/test_*": Excludes no tests (matches only at project root)

    ├── tests/
    │   ├── __init__.py
    │   ├── conftest.py
    │   ├── test_cli.py
    │   ├── test_clone.py
    │   ├── test_flow_integration.py
    │   ├── test_git_utils.py
    │   ├── test_gitignore_feature.py
    │   ├── test_ingestion.py
    │   ├── test_notebook_utils.py
    │   ├── .pylintrc
    │   └── query_parser/
    │       ├── __init__.py
    │       ├── test_git_host_agnostic.py
    │       └── test_query_parser.py

Copy link
Contributor

Copilot AI left a 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 removes the _normalize_pattern helper and stops applying pattern normalization in _parse_patterns.

  • Deleted the _normalize_pattern function and its os import in query_parser_utils.py.
  • Updated _parse_patterns to return raw patterns and removed its import in query_parser.py.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/gitingest/utils/query_parser_utils.py Removed unused os import and _normalize_pattern helper function
src/gitingest/query_parser.py Dropped _normalize_pattern import and simplified _parse_patterns to return parsed_patterns directly
Comments suppressed due to low confidence (2)

src/gitingest/query_parser.py:313

  • Add unit tests for patterns with leading separators (e.g., '/test_*') to verify that normalization is no longer applied and patterns are returned exactly as provided.
    return parsed_patterns

src/gitingest/query_parser.py:310

  • Update the docstring of _parse_patterns to reflect that leading separators are no longer stripped and wildcards are not appended automatically.
        if not _is_valid_pattern(p):

Copy link
Contributor

@ix-56h ix-56h left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

Copy link
Contributor

@NicolasIRAGNE NicolasIRAGNE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok with me

@filipchristiansen filipchristiansen merged commit b1eebae into main Jul 5, 2025
18 checks passed
@filipchristiansen filipchristiansen deleted the remove-normalize-pattern branch July 5, 2025 11:25
BareninVitalya pushed a commit to BareninVitalya/gitingest that referenced this pull request Jul 5, 2025
ix-56h pushed a commit to ix-56h/gitingest that referenced this pull request Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants