evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a utility that generates standardized Git commit footers with issue tracking references. The utility should support multiple issue tracking systems and allow customization of how issue references are formatted.
/**
* Configuration for issue prefix options
* @typedef {Object} IssuePrefixOption
* @property {string} value - The prefix value (e.g., "closes", "refs")
* @property {string} name - Display name for the prefix
*/
/**
* Configuration options for the footer generator
* @typedef {Object} FooterConfig
* @property {IssuePrefixOption[]} issuePrefixes - List of available issue prefixes
* @property {boolean} allowCustomIssuePrefix - Whether to allow custom prefixes
* @property {boolean} allowEmptyIssuePrefix - Whether to allow no prefix
*/
/**
* Generates a formatted commit footer with issue references
* @param {string} prefix - The issue prefix to use (e.g., "closes", "refs", or empty string)
* @param {string|string[]} issues - Single issue or array of issues (e.g., "#123" or ["#100", "#101"])
* @param {FooterConfig} config - Configuration options
* @returns {string} Formatted footer string
*/
function generateFooter(prefix, issues, config) {
// IMPLEMENTATION HERE
}
/**
* Validates if a prefix is allowed based on configuration
* @param {string} prefix - The prefix to validate
* @param {FooterConfig} config - Configuration options
* @returns {boolean} Whether the prefix is valid
*/
function isValidPrefix(prefix, config) {
// IMPLEMENTATION HERE
}
module.exports = {
generateFooter,
isValidPrefix,
};Provides issue tracking integration capabilities for Git commit workflows.