evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a command-line tool that integrates with Git's prepare-commit-msg hook to help generate standardized commit messages interactively. The tool should write the commit message to the appropriate file location so Git can use it during the commit process.
Hook Integration Mode
--hook command-line flag.git/COMMIT_EDITMSG instead of executing a commit--hook), create the commit directlyInteractive Message Builder
<type>(<scope>): <subject>Configuration Loading
.czrc file in the current directory if it existscommit-helperSetup:
git init test-repo
cd test-repo
echo "test" > test.txt
git add test.txtTest file: test.test.js
Scenario: Run the tool with --hook flag and verify it writes to .git/COMMIT_EDITMSG
Expected behavior:
git commit.git/COMMIT_EDITMSG should be createdSetup:
git init test-repo
cd test-repo
echo "test" > test.txt
git add test.txtTest file: test.test.js
Scenario: Run the tool without --hook flag
Expected behavior:
git commit -m "<message>"Setup:
git init test-repo
cd test-repo
cat > .czrc << 'EOF'
{
"types": [
{"value": "feature", "name": "feature: A new feature"},
{"value": "bugfix", "name": "bugfix: A bug fix"}
],
"scopes": ["api", "ui", "database"]
}
EOF
echo "test" > test.txt
git add test.txtTest file: test.test.js
Scenario: Run the tool and verify it uses custom types and scopes from .czrc
Expected behavior:
Provides Git commit message generation with hook integration support.
.git/COMMIT_EDITMSG when --hook flag is provided--hook flag is not provided.czrc