commitizen icon indicating copy to clipboard operation
commitizen copied to clipboard

cz check fails

Open manang opened this issue 4 years ago • 9 comments

Description

cz check fails if the scope contains a space, but it is possible to commit with a space among the words.

Steps to reproduce

cz commit ->write a scope of two words with a space between
cz check --rev-range origin/master..

Current behavior

It fails, because the scope contains a space

Desired behavior

it does not show errors

Environment

Commitizen Version: 2.19.0 Python Version: 3.9.7 (default, Sep 3 2021, 12:37:55) [Clang 12.0.5 (clang-1205.0.22.9)] Operating System: Darwin (or ubuntu)

manang avatar Oct 06 '21 11:10 manang

Do you mean commit like feat(test test): test? If so, I just confirmed it failed. I'm ok with space inside scope. conventional commit doesn't seem to have a clear definition on whether space should be removed. @Woile What do you think?

Lee-W avatar Oct 06 '21 14:10 Lee-W

Hi @Lee-W , yes, your example is correct. I don't know if feat(test test) is compliant with conventional commit., but if I can commit with cz commit, so, cz check does not have to return that the commit is not compliant. Only this.

Thanks for your help

manang avatar Oct 06 '21 15:10 manang

somehow cz commit and cz check should match, I agree.

there's not much information about the scope. I'm not a big fan of spaces but there shouldn't be anything wrong with them, the changelog would look ok as well:

test config: changed parameter for foobar

I've seen ppl using a - to separate words.

woile avatar Oct 06 '21 17:10 woile

Hello I have kind of problem like that.... when I try to add the scope this happens:

commit validation: failed! please enter a commit message in the commitizen format. commit "": "test(scope): te5st y mas test" pattern: (build|ci|docs|feat|fix|perf|refactor|test):(\s.*)

When I don't use the scope the check works well.

This is my schema pattern config:

**schema_pattern: "(build|ci|docs|feat|fix|perf|refactor|test):(\\s.*)"**

The scope supposed to be optional, isn't ?

CarlosBrunoE avatar Oct 07 '21 22:10 CarlosBrunoE

The problem was tat was missing (.*) after the first value:

Example: schema_pattern: "(build|ci|docs|feat|fix|perf|refactor|test)(.):(\s.)"

@manang Try upgrading to latest version. It worked for me

CarlosBrunoE avatar Oct 07 '21 22:10 CarlosBrunoE

which version? on brew there is a version less recent. thanks

manang avatar Oct 07 '21 22:10 manang

v2.20.0 was released yesterday

CarlosBrunoE avatar Oct 07 '21 23:10 CarlosBrunoE

There was a problem during the publication to homebrew. So I can't test now.

Get Outlook for iOShttps://aka.ms/o0ukef


From: Carlos Bruno @.> Sent: Friday, October 8, 2021 1:53:03 AM To: commitizen-tools/commitizen @.> Cc: Angelo Mantellini (manangel) @.>; Mention @.> Subject: Re: [commitizen-tools/commitizen] cz check fails (#444)

v2.20.0 was released yesterday

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/commitizen-tools/commitizen/issues/444#issuecomment-938233727, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABNGJ2YJUFOFCGVTSPTJRATUFYXF7ANCNFSM5FOJ6C6Q.

manang avatar Oct 07 '21 23:10 manang

I've sent a PR to address homebrew publishing issue https://github.com/commitizen-tools/commitizen/pull/445 Let's see whether this issue will be fixed.

Lee-W avatar Oct 09 '21 07:10 Lee-W

Closing as commitizen is being released on brew and apparently this issue was solved.

Feel free to reopen if it still happens

woile avatar Apr 28 '23 13:04 woile