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

Added auto commit message gen #563

Merged
merged 4 commits into from
Sep 18, 2024
Merged

Added auto commit message gen #563

merged 4 commits into from
Sep 18, 2024

Conversation

sauravpanda
Copy link
Member

@sauravpanda sauravpanda commented Sep 18, 2024

Updated pre-commit configuration and added commit message generation

  • Purpose:
    Improve code quality and automate commit message generation.
  • Key Changes:
    • Removed the black pre-commit hook, as it is now handled by the project's linter configuration.
    • Added a new command generate-commit-msg to the CLI, which generates a commit message based on the staged changes.
    • Integrated the commit message generation into the prepare-commit-msg Git hook, so that the commit message is automatically generated when committing changes.
  • Impact:
    The changes will ensure consistent code formatting, improve the quality of commit messages, and streamline the development workflow.

✨ Generated with love by Kaizen ❤️

Original Description

sauravpanda and others added 4 commits September 17, 2024 11:31
Introduce a command for generating commit messages based on diffs
and improve configuration management.

- Added `generate_commit_msg` command for staged changes.
- Updated config to use `KAIZEN_` prefix instead of `MYAPP_`.
- Removed `black` pre-commit hook from configuration.
- Adjusted token limits and model defaults in LLMProvider.
- Enhanced installation of git hooks for destination directories.

These changes streamline the commit process and improve the
usability of the CLI tool.
Copy link
Contributor

kaizen-bot bot commented Sep 18, 2024

🔍 Code Review Summary

All Clear: This commit looks good! 👍

Overview

  • Total Feedbacks: 1 (Critical: 0, Refinements: 1)
  • Files Affected: 1
  • Code Quality: [█████████████████░░░] 85% (Good)

🟠 Refinement Suggestions:

These are not critical issues, but addressing them could further improve the code:

error_handling (1 issues)

1. Lack of error handling in loading configuration.


📁 File: cli/kaizen_cli/config/manager.py
🔍 Reasoning:
The current implementation of loading configuration does not handle potential errors that may arise from missing or malformed environment variables. This could lead to runtime exceptions and application crashes.

💡 Solution:
Implement error handling to manage cases where environment variables are missing or incorrectly formatted.

Current Code:

parsed_value = json.loads(value)

Suggested Code:

try:
    parsed_value = json.loads(value)
except json.JSONDecodeError:
    raise ValueError(f'Invalid value for{key}:{value}')

Test Cases

10 file need updates to their tests. Run !unittest to generate create and update tests.


✨ Generated with love by Kaizen ❤️

Useful Commands
  • Feedback: Reply with !feedback [your message]
  • Ask PR: Reply with !ask-pr [your question]
  • Review: Reply with !review
  • Explain: Reply with !explain [issue number] for more details on a specific issue
  • Ignore: Reply with !ignore [issue number] to mark an issue as false positive
  • Update Tests: Reply with !unittest to create a PR with test changes

cli/kaizen_cli/config/manager.py Show resolved Hide resolved
kaizen/llms/provider.py Show resolved Hide resolved
@sauravpanda sauravpanda merged commit 27f4c90 into main Sep 18, 2024
3 checks passed
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.

1 participant