evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a simple commit message caching system that stores commit messages per repository and allows retrieval of the last cached message.
Implement a caching system with repository-specific storage:
Store data in a JSON file where each repository path is a key:
{
"/home/user/project1": {
"message": "feat: add new feature",
"options": { "amend": false }
},
"/home/user/project2": {
"message": "fix: resolve bug",
"options": {}
}
}/**
* Writes commit data to the cache file for a specific repository.
* Creates or updates the cache entry for the repository.
*
* @param {string} cachePath - Path to the cache JSON file
* @param {string} repoPath - Repository path (used as cache key)
* @param {object} data - Data to cache
* @param {string} data.message - The commit message
* @param {object} data.options - Commit options
*/
function writeCache(cachePath, repoPath, data) {
// Implementation
}
/**
* Reads cached commit data for a specific repository.
*
* @param {string} cachePath - Path to the cache JSON file
* @param {string} repoPath - Repository path (used as cache key)
* @returns {object} Cached data with message and options properties
* @throws {Error} When cache file doesn't exist or repository entry not found
*/
function readCache(cachePath, repoPath) {
// Implementation
}
module.exports = { writeCache, readCache };A CLI tool for generating standardized commit messages with built-in caching and retry capabilities.