You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
The key has expired.
Fix the prompt creation logic (#22)
* Remove TODO comments (now tickets on GitHub repo)
* Run `black` and `isort` on existing codebase
* Add documentation comments
* Implement unit testing
* Rename `chat_completion.jinja` to `system.jinja`
Renamed the `chat_completion.jinja` template file to `system.jinja` to better reflect its purpose and functionality. This change improves code organization and enhances the readability of the template file names.
* Fix trailing whitespace and blank lines in `config.py` and `test_config.py`
Removed trailing whitespace and blank lines in the `config.py` and `test_config.py` files to adhere to PEP 8 guidelines. This change improves the readability and maintainability of the code.
* Include additional templates and package files in the setup configuration
Modified the `setup.py` file to include additional templates and package files in the setup configuration.
Changes:
- Changed the line `from setuptools import setup` to `from setuptools import setup, find_packages` to use the `find_packages()` function for automatic package discovery.
- Added the `include_package_data=True` line to include non-code files in the package.
- Added the `package_data` dictionary to specify the file patterns to include in each package.
This change ensures that additional templates and package files are included when the package is installed.
* Refactor imports and improve path handling in `magic_commit/__main__.py`
Updated the import statements in `magic_commit/__main__.py` to improve readability and adhere to PEP 8 style guidelines.
Changes:
- Grouped imports based on their source (standard library, third-party, local)
- Removed unused imports
Additionally, improved path handling by:
- Expanding the user's home directory if the tilde symbol is used in the directory path
- Converting relative paths to absolute paths using `os.path.abspath()`
These changes make the code more organized and easier to understand.
* Refactor commit message generation logic
Refactored the `generate_commit_message` function to use the `run_git_diff` function to retrieve the git diff instead of relying on the `commit_messages` parameter. This simplifies the function as it no longer needs to process and split the commit messages. The `render_template` function was also added to handle rendering the commit message template. These changes improve code readability and maintainability.