Skip to content

Commit

Permalink
fix(cz-git): fix limit length defind commitlint config
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhengqbbb committed Mar 11, 2022
1 parent 41549d1 commit f602c9e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/cz-git/src/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,15 @@ export const generateOptions = (clConfig: UserConfig): CommitizenGitOptions => {
emptyIssuePrefixsAlias: pkgConfig.emptyIssuePrefixsAlias ?? clPromptConfig.emptyIssuePrefixsAlias ?? defaultConfig.emptyIssuePrefixsAlias,
customIssuePrefixsAlias: pkgConfig.customIssuePrefixsAlias ?? clPromptConfig.customIssuePrefixsAlias ?? defaultConfig.customIssuePrefixsAlias,
confirmColorize: pkgConfig.confirmColorize ?? clPromptConfig.confirmColorize ?? defaultConfig.confirmColorize,
maxHeaderLength: CZ_MAN_HEADER_LENGTH ? parseInt(CZ_MAN_HEADER_LENGTH) : getMaxLength(clConfig?.rules?.["header-max-length"] as any),
maxSubjectLength: CZ_MAN_SUBJECT_LENGTH ? parseInt(CZ_MAN_SUBJECT_LENGTH) : getMaxLength(clConfig?.rules?.["subject-max-length"] as any),
minSubjectLength: CZ_MIN_SUBJECT_LENGTH ? parseInt(CZ_MIN_SUBJECT_LENGTH) : getMinLength(clConfig?.rules?.["subject-min-length"] as any),
maxHeaderLength: CZ_MAN_HEADER_LENGTH
? parseInt(CZ_MAN_HEADER_LENGTH)
: clPromptConfig.maxHeaderLength ?? getMaxLength(clConfig?.rules?.["header-max-length"] as any),
maxSubjectLength: CZ_MAN_SUBJECT_LENGTH
? parseInt(CZ_MAN_SUBJECT_LENGTH)
: clPromptConfig.maxSubjectLength ?? getMaxLength(clConfig?.rules?.["subject-max-length"] as any),
minSubjectLength: CZ_MIN_SUBJECT_LENGTH
? parseInt(CZ_MIN_SUBJECT_LENGTH)
: clPromptConfig.minSubjectLength ?? getMinLength(clConfig?.rules?.["subject-min-length"] as any),
defaultScope: CZ_SCOPE ?? clPromptConfig.defaultScope ?? defaultConfig.defaultScope,
defaultSubject: CZ_SUBJECT ?? clPromptConfig.defaultSubject ?? defaultConfig.defaultSubject,
defaultBody: CZ_BODY ?? clPromptConfig.defaultBody ?? defaultConfig.defaultBody,
Expand Down

0 comments on commit f602c9e

Please sign in to comment.