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: [scope-enum] [scope-case] allow space after comma as scope delimiter #3576

Closed
4 tasks
miluoshi opened this issue Apr 4, 2023 · 4 comments · Fixed by #3577
Closed
4 tasks

feat: [scope-enum] [scope-case] allow space after comma as scope delimiter #3576

miluoshi opened this issue Apr 4, 2023 · 4 comments · Fixed by #3577
Labels

Comments

@miluoshi
Copy link
Contributor

miluoshi commented Apr 4, 2023

Expected Behavior

scope-enum and scope-case rules should also accept comma with space , as a delimiter in addition to /, \, ,

Current Behavior

  • type(scope1,scope2,scope3): msg passes
  • type(scope1, scope2, scope3): msg fails

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

No response

Steps to Reproduce

1. enable rule `'scope-enum': [2, 'always', ['scope1', 'scope2']],`
2. run `echo "type(scope1, scope2, scope3): msg" | commitlint

Context

It's quite common for developers to separate multiple scopes with , instead of ,. It leads to frustration finding that commitlint failed just because of a space (which improves readability)

commitlint --version

@commitlint/cli@17.4.4

git --version

v2.38.1

node --version

v18.12.1

@miluoshi miluoshi added the bug label Apr 4, 2023
miluoshi added a commit to miluoshi/commitlint that referenced this issue Apr 4, 2023
miluoshi added a commit to miluoshi/commitlint that referenced this issue Apr 4, 2023
miluoshi added a commit to miluoshi/commitlint that referenced this issue Apr 4, 2023
@escapedcat
Copy link
Member

Hm, would this also pass?: type(scope1,scope2, scope3): msg

miluoshi added a commit to miluoshi/commitlint that referenced this issue Apr 4, 2023
@escapedcat
Copy link
Member

Maybe @karl-run has feedback to this

@miluoshi miluoshi changed the title fix: [scope-enum] allow space after comma as scope delimiter feat: [scope-enum] [scope-case] allow space after comma as scope delimiter Apr 4, 2023
@miluoshi
Copy link
Contributor Author

miluoshi commented Apr 4, 2023

Hm, would this also pass?: type(scope1,scope2, scope3): msg

Yes, that would pass per implementation in #3577

@escapedcat
Copy link
Member

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

Successfully merging a pull request may close this issue.

2 participants