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 validates commit message configurations by reading commitlint rules and applying them to generate proper commit prompts.
Your tool should read commitlint configuration files and use the rules to:
scope-enum rule from commitlint configuration and make those scopes available for commit message generationheader-max-length and subject-max-length rules and enforce these constraintsThe tool should accept a commitlint configuration object and generate commit configuration options that enforce those rules.
scope-enum rule containing ['api', 'ui', 'docs'], the generated options should include those exact scopes @testheader-max-length is set to 72 in commitlint config with error severity (2), the generated options should enforce this limit @testsubject-max-length is set to 50 with warning severity (1), the generated options should include this constraint @test/**
* Commitlint rule configuration
*/
export interface CommitlintRule {
severity: 0 | 1 | 2; // 0 = disable, 1 = warning, 2 = error
value: any;
}
/**
* Commitlint configuration structure
*/
export interface CommitlintConfig {
rules: {
'scope-enum'?: [0 | 1 | 2, 'always' | 'never', string[]];
'header-max-length'?: [0 | 1 | 2, 'always' | 'never', number];
'subject-max-length'?: [0 | 1 | 2, 'always' | 'never', number];
[key: string]: any;
};
}
/**
* Generated commit configuration options
*/
export interface CommitOptions {
scopes?: string[];
maxHeaderLength?: number;
maxSubjectLength?: number;
}
/**
* Processes commitlint configuration and extracts commit options
* that can be used to generate conformant commit messages.
*
* @param config - The commitlint configuration object
* @returns Commit options derived from the commitlint rules
*/
export function extractCommitOptions(config: CommitlintConfig): CommitOptions;Provides standardized commit message generation with commitlint integration support.