Skip to content

Commit f771da3

Browse files
committed
refactor(commands): remove unused args, type version command args
1 parent 1f8c4bc commit f771da3

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

commitizen/commands/version.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
import platform
22
import sys
3-
from collections.abc import Mapping
4-
from typing import Any
3+
from typing import TypedDict
54

65
from commitizen import out
76
from commitizen.__version__ import __version__
87
from commitizen.config import BaseConfig
98
from commitizen.providers import get_provider
109

1110

11+
class VersionArgs(TypedDict, total=False):
12+
report: bool
13+
project: bool
14+
verbose: bool
15+
16+
1217
class Version:
1318
"""Get the version of the installed commitizen or the current project."""
1419

15-
def __init__(self, config: BaseConfig, *args: Mapping[str, Any]) -> None:
20+
def __init__(self, config: BaseConfig, arguments: VersionArgs) -> None:
1621
self.config: BaseConfig = config
17-
self.parameter = args[0]
22+
self.parameter = arguments
1823
self.operating_system = platform.system()
1924
self.python_version = sys.version
2025

tests/commands/test_version_command.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ def test_version_use_version_provider(
9797
{
9898
"report": False,
9999
"project": project,
100-
"commitizen": False,
101100
"verbose": not project,
102101
},
103102
)()

0 commit comments

Comments
 (0)