refactor: improve commit length enforcement (#206)

This commit is contained in:
hiroki osame
2023-05-03 08:53:05 -04:00
committed by GitHub
parent f53fb85dd7
commit f466f0527e
2 changed files with 9 additions and 9 deletions

View File

@@ -109,10 +109,10 @@ const getPrompt = (
diff: string,
maxLength: number,
) => `${[
'Generate a concise git commit message written in present tense for the following code diff with the given specifications.',
'Generate a concise git commit message written in present tense for the following code diff with the given specifications below:',
`Message language: ${locale}`,
`Max message character length: ${maxLength}`,
'Exclude anything unnecessary such as the original translation—your entire response will be passed directly into git commit.',
`Commit message must be a maximum of ${maxLength} characters.`,
'Exclude anything unnecessary such as translation. Your entire response will be passed directly into git commit.',
].join('\n')}\n\n${diff}`;
const generateStringFromLength = (length: number) => {