Closed colinaaa closed 2 months ago
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
lgtm, thanks!
@knocte wdyt?
LGTM but I would prefer if the contributor:
This way we make sure the bug is really being fixed.
Hi @knocte @escapedcat, I created a PR at https://github.com/colinaaa/commitlint/pull/1 to do what you said.
It shows that the tests if failing without the source code changes:
https://github.com/colinaaa/commitlint/actions/runs/11089407847/job/30810494667
⎯⎯⎯⎯⎯⎯⎯ Failed Tests 2 ⎯⎯⎯⎯⎯⎯⎯
FAIL @commitlint/rules/src/scope-enum.test.ts > Scope Enum Validation > Always > Multi-Scope Messages > Succeeds with a 'multipleSlash' message when the scopes are included in enum
AssertionError: expected false to be truthy
❯ @commitlint/rules/src/scope-enum.test.ts:154:20
152| ['bar/baz']
153| );
154| expect(actual).toBeTruthy();
| ^
155| expect(message).toEqual('scope must be one of [bar/baz]');
156| });
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯
FAIL @commitlint/rules/src/scope-enum.test.ts > Scope Enum Validation > Never > Messages with Scopes > Fails with a 'multipleSlash' message when the scopes are included in enum
AssertionError: expected true to be falsy
- Expected
+ Received
- true
+ false
❯ @commitlint/rules/src/scope-enum.test.ts:202:20
200| ['bar/baz']
201| );
202| expect(actual).toBeFalsy();
| ^
203| expect(message).toEqual('scope must not be one of [bar/baz]');
204| });
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯
And the test passed after I made this changes:
https://github.com/colinaaa/commitlint/actions/runs/11089426928/job/30810538885?pr=1
PTAL~
Why did you create a PR on your fork? You just need to put those commits in this PR.
Why did you create a PR on your fork? You just need to put those commits in this PR.
Because I cannot run the action in this PR. As you can see now, GitHub says:
This workflow requires approval from a maintainer
lgtm! thanks!
Thanks for splitting in 2 commits. The CI of your 2nd commit is red, why?
Thanks for splitting in 2 commits. The CI of your 2nd commit is red, why?
I think it's "a bug" in Github?
It's green here: https://github.com/conventional-changelog/commitlint/pull/4161/commits/b5893912a688a39c56f3ba0a9dfa9e24dd06e701
And here if you click the red X: https://github.com/conventional-changelog/commitlint/pull/4161/commits
I think it's "a bug" in Github?
We probably should only enable that step if CI is running in a repo that is not a fork, I guess.
We probably should only enable that step if CI is running in a repo that is not a fork, I guess.
Yeah, this is a bit confusing.
Apart from this I guess we're good here. Thanks @colinaaa !
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
How Has This Been Tested?
multipleSlash
test case is added.foo/bar
toscope-enum
would work.Types of changes
Checklist: