evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a tool that manages custom commit types for a team's Git workflow. The tool should allow teams to define their own commit types beyond the standard conventional commit types, configure their display properties, and validate commit messages against these custom types.
Create a configuration system that allows users to:
Implement validation logic that:
type(scope): subject or type: subjectCreate a display function that:
Implement a configuration loader that:
Your solution should include:
A TypeConfig interface or type definition that represents a single commit type with:
value: The type identifier (e.g., "feat", "fix")name: Human-readable descriptionemoji: Optional emoji iconA loadTypeConfig function that accepts configuration and returns a list of available types
A validateCommitType function that checks if a commit message uses a valid type
A displayTypes function that formats and returns a string showing all available types
Input:
const config = {
typesAppend: [
{ value: "workflow", name: "workflow: CI/CD changes", emoji: "🔄" },
{ value: "security", name: "security: Security fixes", emoji: "🔒" }
]
}Expected Behavior: The loader should merge these custom types with the default conventional commit types (feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert), resulting in a total of 13 available types.
Input:
validateCommitType("workflow(ci): add GitHub Actions config")
validateCommitType("invalid: some message")
validateCommitType("feat: add new feature")Expected Output:
Input:
const types = [
{ value: "feat", name: "feat: A new feature", emoji: "✨" },
{ value: "fix", name: "fix: A bug fix", emoji: "🐛" }
]
displayTypes(types)Expected Output: Should return a formatted string showing each type with its emoji and description, suitable for terminal display.
Provides commit message generation and type management capabilities for Git workflows.
Create a test file named type-manager.test.ts that validates: