Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(config.ts): add skipCommitMessageCheck config key #19

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor(config.ts): rename skipCommitMessageCheck to skipCommitMsgHo…
…okSourceCheck

refactor(prepare-commit-msg-hook.ts): update reference to skipCommitMessageCheck to skipCommitMsgHookSourceCheck
update variable name
  • Loading branch information
Lars- committed Mar 15, 2023
commit 36437c93d3f11618793b1a581722a49cf5f72734
6 changes: 3 additions & 3 deletions src/commands/config.ts
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ export enum CONFIG_KEYS {
OPENAI_API_KEY = 'OPENAI_API_KEY',
description = 'description',
emoji = 'emoji',
skipCommitMessageCheck = 'skipCommitMessageCheck'
skipCommitMsgHookSourceCheck = 'skipCommitMsgHookSourceCheck'
}

export enum CONFIG_MODES {
@@ -66,9 +66,9 @@ export const configValidators = {

return value;
},
[CONFIG_KEYS.skipCommitMessageCheck](value: any) {
[CONFIG_KEYS.skipCommitMsgHookSourceCheck](value: any) {
validateConfig(
CONFIG_KEYS.skipCommitMessageCheck,
CONFIG_KEYS.skipCommitMsgHookSourceCheck,
typeof value === 'boolean',
'Must be true or false'
);
2 changes: 1 addition & 1 deletion src/commands/prepare-commit-msg-hook.ts
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ export const prepareCommitMessageHook = async () => {
const config = getConfig();

// Skip commit message check if the user has set the skipCommitMessageCheck flag to true
if (!config?.skipCommitMessageCheck && commitSource) return;
if (!config?.skipCommitMsgHookSourceCheck && commitSource) return;

const staged = await getStagedGitDiff();