Skip to content
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

refactor: refactor module names to avoid function/module name clashes #114

Merged
merged 2 commits into from
Jan 8, 2025

Conversation

filipchristiansen
Copy link
Collaborator

@filipchristiansen filipchristiansen commented Jan 8, 2025

Overview

This PR refactors several module filenames in the gitingest package to address naming clashes between modules and the functions they export. Additionally, the names of the corresponding test files have been updated to match the new module names.

Changes Made

  • Module Renaming:

    • clone.py is now repository_clone.py
    • ingest.py is now repository_ingest.py
    • ingest_from_query.py is now query_ingestion.py
    • parse_query.py is now query_parser.py
    • process_query.py is no query_processor.py
  • Test File Renaming:

    • Renamed test files to match their corresponding module names.
      • For example, test_clone.py is now test_repository_clone.py, and similarly for other modules.
  • Import Updates:

    • Updated the imports in gitingest/__init__.py to reflect the new module names.
    • Verified that all internal references to these modules are consistent with the new names.

Rationale

The original module names conflicted with their function names, which could lead to confusion and potential import issues. By renaming modules (and their associated test files) to more descriptive names, we improve the clarity of the codebase and prevent future naming conflicts.

Testing

  • Ran unit tests to ensure that all functionality remains intact after renaming.

Impact

These changes should be fully backward compatible as public API functions (clone_repo, ingest, ingest_from_query, and parse_query) remain the same. The only differences are internal file/module names, which do not affect end-user code relying on the public API.

@filipchristiansen filipchristiansen force-pushed the refactor/module-renames branch 3 times, most recently from 5d6d195 to 337eacc Compare January 8, 2025 19:41
Copy link
Owner

@cyclotruc cyclotruc left a comment

Choose a reason for hiding this comment

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

Tested, all good thank you!

- Renamed:
  - `clone.py`       → `repository_clone.py`
  - `ingest.py`      → `repository_ingest.py`
  - `ingest_from_query.py` → `query_ingestion.py`
  - `parse_query.py` → `query_parser.py`
- Updated import statements accordingly in package `__init__.py`
@cyclotruc cyclotruc merged commit 6d92ed9 into cyclotruc:main Jan 8, 2025
8 checks passed
@filipchristiansen filipchristiansen deleted the refactor/module-renames branch January 9, 2025 01:00
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.

2 participants