Skip to content

feat: support using delimiter in scope-enum#1

Closed
colinaaa wants to merge 2 commits intoupsteam-masterfrom
test
Closed

feat: support using delimiter in scope-enum#1
colinaaa wants to merge 2 commits intoupsteam-masterfrom
test

Conversation

@colinaaa
Copy link
Copy Markdown
Owner

Description

Currently, if the scope in message has delimiters(/, , or \), it is considered as multiple scopes and is tested separately.

I add extra checks to see if the scope matches the enum directly to allow 'scope-enum' to have delimiter.

Motivation and Context

Scope should be able to have delimiter like /. And tests should pass when 'scope-enum' is configured to have delimiter.

Usage examples

// commitlint.config.js
module.exports = {
  rules: {
    'scope-enum': [
      RuleConfigSeverity.Error,
      'always',
      [
        'foo/bar',
      ],
    ],
  },
};
echo "fix(foo/bar): qux" | commitlint # fails

⧗   input: fix(foo/bar): qux
✖   scope must be one of [foo/bar] [scope-enum]

How Has This Been Tested?

  1. A multipleSlash test case is added.
  2. Check if adding foo/bar to scope-enum would work.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant