fix: allow string values for commit_footer config (#919)

This commit is contained in:
YeonGyu-Kim
2026-02-07 19:04:34 +09:00
parent 8e92704316
commit e4bbd6bf15
4 changed files with 117 additions and 7 deletions
+69
View File
@@ -664,3 +664,72 @@ describe("ExperimentalConfigSchema feature flags", () => {
}
})
})
describe("GitMasterConfigSchema", () => {
test("accepts boolean true for commit_footer", () => {
//#given
const config = { commit_footer: true }
//#when
const result = GitMasterConfigSchema.safeParse(config)
//#then
expect(result.success).toBe(true)
if (result.success) {
expect(result.data.commit_footer).toBe(true)
}
})
test("accepts boolean false for commit_footer", () => {
//#given
const config = { commit_footer: false }
//#when
const result = GitMasterConfigSchema.safeParse(config)
//#then
expect(result.success).toBe(true)
if (result.success) {
expect(result.data.commit_footer).toBe(false)
}
})
test("accepts string value for commit_footer", () => {
//#given
const config = { commit_footer: "Custom footer text" }
//#when
const result = GitMasterConfigSchema.safeParse(config)
//#then
expect(result.success).toBe(true)
if (result.success) {
expect(result.data.commit_footer).toBe("Custom footer text")
}
})
test("defaults commit_footer to true when not provided", () => {
//#given
const config = {}
//#when
const result = GitMasterConfigSchema.safeParse(config)
//#then
expect(result.success).toBe(true)
if (result.success) {
expect(result.data.commit_footer).toBe(true)
}
})
test("rejects number for commit_footer", () => {
//#given
const config = { commit_footer: 123 }
//#when
const result = GitMasterConfigSchema.safeParse(config)
//#then
expect(result.success).toBe(false)
})
})
+4 -4
View File
@@ -339,10 +339,10 @@ export const BabysittingConfigSchema = z.object({
})
export const GitMasterConfigSchema = z.object({
/** Add "Ultraworked with Sisyphus" footer to commit messages (default: true) */
commit_footer: z.boolean().default(true),
/** Add "Co-authored-by: Sisyphus" trailer to commit messages (default: true) */
include_co_authored_by: z.boolean().default(true),
/** Add "Ultraworked with Sisyphus" footer to commit messages (default: true). Can be boolean or custom string. */
commit_footer: z.union([z.boolean(), z.string()]).default(true),
/** Add "Co-authored-by: Sisyphus" trailer to commit messages (default: true) */
include_co_authored_by: z.boolean().default(true),
})
export const BrowserAutomationProviderSchema = z.enum(["playwright", "agent-browser", "dev-browser"])