From 42c26cbaaada160e42f0792def08920ced5af905 Mon Sep 17 00:00:00 2001 From: di-sukharev Date: Fri, 28 Apr 2023 15:31:10 +0800 Subject: [PATCH] fix(generateCommitMessageFromGitDiff.ts): update content to include WHAT and WHY in commit message instructions fix(i18n/en.json): update commitFix and commitFeat messages to include reasons for changes --- src/generateCommitMessageFromGitDiff.ts | 2 +- src/i18n/en.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/generateCommitMessageFromGitDiff.ts b/src/generateCommitMessageFromGitDiff.ts index 69d4fa5..8154c8e 100644 --- a/src/generateCommitMessageFromGitDiff.ts +++ b/src/generateCommitMessageFromGitDiff.ts @@ -15,7 +15,7 @@ const INIT_MESSAGES_PROMPT: Array = [ { role: ChatCompletionRequestMessageRoleEnum.System, // prettier-ignore - content: `You are to act as the author of a commit message in git. Your mission is to create clean and comprehensive commit messages in the conventional commit convention and explain why a change was done. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message. + content: `You are to act as the author of a commit message in git. Your mission is to create clean and comprehensive commit messages in the conventional commit convention and explain WHAT were the changes and WHY the changes were done. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message. ${config?.emoji? 'Use GitMoji convention to preface the commit.': 'Do not preface the commit with anything.'} ${config?.description ? 'Add a short description of WHY the changes are done after the commit message. Don\'t start it with "This commit", just describe the changes.': "Don't add any descriptions to the commit, only commit message."} Use the present tense. Lines must not be longer than 74 characters. Use ${translation.localLanguage} to answer.` diff --git a/src/i18n/en.json b/src/i18n/en.json index 66ec749..8bf6e18 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -1,6 +1,6 @@ { "localLanguage": "english", - "commitFix": "fix(server.ts): change port variable case from lowercase port to uppercase PORT", - "commitFeat": "feat(server.ts): add support for process.env.PORT environment variable", + "commitFix": "fix(server.ts): change port variable case from lowercase port to uppercase PORT to improve semantics", + "commitFeat": "feat(server.ts): add support for process.env.PORT environment variable to be able to run app on a configurable port", "commitDescription": "The port variable is now named PORT, which improves consistency with the naming conventions as PORT is a constant. Support for an environment variable allows the application to be more flexible as it can now run on any available port specified via the process.env.PORT environment variable." }