Skip to content

Commit 99dfb5a

Browse files
committed
refactor(cli): remove "--version" argument
BREAKING CHANGE: Use "cz verion" instead
1 parent 3262247 commit 99dfb5a

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

commitizen/cli.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import argparse
22
import logging
33
import sys
4-
import warnings
54
from functools import partial
65

76
from decli import cli
@@ -277,16 +276,6 @@ def main():
277276
elif not args.name and not conf.path:
278277
conf.update({"name": "cz_conventional_commits"})
279278

280-
if args.version:
281-
warnings.warn(
282-
(
283-
"'cz --version' will be deprecated in next major version. "
284-
"Please use 'cz version' command from your scripts"
285-
),
286-
category=DeprecationWarning,
287-
)
288-
args.func = commands.Version
289-
290279
if args.debug:
291280
logging.getLogger("commitizen").setLevel(logging.DEBUG)
292281
sys.excepthook = commitizen_debug_excepthook

tests/test_cli.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,6 @@ def test_ls(mocker, capsys):
5555
assert isinstance(out, str)
5656

5757

58-
def test_arg_version(mocker, capsys):
59-
testargs = ["cz", "--version"]
60-
mocker.patch.object(sys, "argv", testargs)
61-
62-
with pytest.warns(DeprecationWarning) as record:
63-
cli.main()
64-
out, _ = capsys.readouterr()
65-
assert out.strip() == __version__
66-
67-
assert record[0].message.args[0] == (
68-
"'cz --version' will be deprecated in next major version. "
69-
"Please use 'cz version' command from your scripts"
70-
)
71-
72-
7358
def test_arg_debug(mocker):
7459
testargs = ["cz", "--debug", "info"]
7560
mocker.patch.object(sys, "argv", testargs)

0 commit comments

Comments
 (0)