Skip to content

Script suddenly throwing a "msgRegex: (?:) does not have all mandatory capture groups ('type', 'scope', 'breaking', 'description')" #164

@fran-ink

Description

@fran-ink

Getting a new error with this script today: msgRegex: (?:) does not have all mandatory capture groups ('type', 'scope', 'breaking', 'description')

Our config is OOTB, no change at all. So i searched a bit and it very much looks related to #163

I tried defining my own msgRegex with the validValue mentioned in the PR (/^(?<type>\w+)(?:\((?<scope>[^()]+)\))?(?<breaking>!)?:\s*(?<description>.+)/i) and it still doesn't work.

I think this issue comes from:

conventionConfig.msgRegex = RegExp(conventionOverride.commitMessageRegexPattern) || conventionConfig.msgRegex;

Even if conventionOverride.commitMessageRegexPattern is undefined, the RegExp is never null, so || conventionConfig.msgRegex is unreachable. Or maybe the || conventionConfig.msgRegex should be included in the RegExp?

I could bypass the issue by adding this line in my convention:

commitMessageRegexPattern: ^(?<type>\w+)(?:\((?<scope>[^()]+)\))?(?<breaking>!)?:\s*(?<description>.+)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions