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

commitizen does not warn "Command is required" when providing non-exists command on Python 3.9 #429

Closed
Lee-W opened this issue Sep 26, 2021 · 1 comment
Assignees

Comments

@Lee-W
Copy link
Member

Lee-W commented Sep 26, 2021

Description

the root cause of this issue is that argparse raises a different exception on Python 3.9. this also break our test cases

Steps to reproduce

  1. git clone this project
  2. poetry env use 3.9
  3. poetry run cz c nocommand

Current behavior

$ poetry run cz nocommand
usage: cz [-h] [--debug] [-n NAME] {init,commit,c,ls,example,info,schema,bump,changelog,ch,check,version} ...
cz: error: argument {init,commit,c,ls,example,info,schema,bump,changelog,ch,check,version}: invalid choice: 'nocommand' (choose from 'init', 'commit', 'c', 'ls', 'example', 'info', 'schema', 'bump', 'changelog', 'ch', 'check', 'version')

Desired behavior

warn "Command is required" at the end

poetry run cz nocommand
usage: cz [-h] [--debug] [-n NAME] {init,commit,c,ls,example,info,schema,bump,changelog,ch,check,version} ...
cz: error: argument {init,commit,c,ls,example,info,schema,bump,changelog,ch,check,version}: invalid choice: 'nocommand' (choose from 'init', 'commit', 'c', 'ls', 'example', 'info', 'schema', 'bump', 'changelog', 'ch', 'check', 'version')
Command is required

Environment

  • commitizen version: 2.18.1
  • python version: Python 3.9.7
  • operating system: Darwin
@Lee-W
Copy link
Member Author

Lee-W commented Sep 27, 2021

closed by #430

@Lee-W Lee-W closed this as completed Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant