Skip to content

Commit 433d22c

Browse files
committed
style: add -> None to __init__
1 parent a33b891 commit 433d22c

File tree

20 files changed

+22
-22
lines changed

20 files changed

+22
-22
lines changed

commitizen/changelog_formats/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ChangelogFormat(Protocol):
2525

2626
config: BaseConfig
2727

28-
def __init__(self, config: BaseConfig):
28+
def __init__(self, config: BaseConfig) -> None:
2929
self.config = config
3030

3131
@property

commitizen/changelog_formats/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class BaseFormat(ChangelogFormat, metaclass=ABCMeta):
2020
extension: ClassVar[str] = ""
2121
alternative_extensions: ClassVar[set[str]] = set()
2222

23-
def __init__(self, config: BaseConfig):
23+
def __init__(self, config: BaseConfig) -> None:
2424
# Constructor needs to be redefined because `Protocol` prevent instantiation by default
2525
# See: https://bugs.python.org/issue44807
2626
self.config = config

commitizen/commands/bump.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
class Bump:
4141
"""Show prompt for the user to create a guided commit."""
4242

43-
def __init__(self, config: BaseConfig, arguments: dict):
43+
def __init__(self, config: BaseConfig, arguments: dict) -> None:
4444
if not git.is_git_project():
4545
raise NotAGitProjectError()
4646

commitizen/commands/changelog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
class Changelog:
3030
"""Generate a changelog based on the commit history."""
3131

32-
def __init__(self, config: BaseConfig, args: Mapping[str, Any]):
32+
def __init__(self, config: BaseConfig, args: Mapping[str, Any]) -> None:
3333
if not git.is_git_project():
3434
raise NotAGitProjectError()
3535

commitizen/commands/check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Check:
1919

2020
def __init__(
2121
self, config: BaseConfig, arguments: dict[str, Any], cwd: str = os.getcwd()
22-
):
22+
) -> None:
2323
"""Initial check command.
2424
2525
Args:

commitizen/commands/commit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
class Commit:
3232
"""Show prompt for the user to create a guided commit."""
3333

34-
def __init__(self, config: BaseConfig, arguments: dict):
34+
def __init__(self, config: BaseConfig, arguments: dict) -> None:
3535
if not git.is_git_project():
3636
raise NotAGitProjectError()
3737

commitizen/commands/example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
class Example:
66
"""Show an example so people understands the rules."""
77

8-
def __init__(self, config: BaseConfig, *args: object):
8+
def __init__(self, config: BaseConfig, *args: object) -> None:
99
self.config: BaseConfig = config
1010
self.cz = factory.committer_factory(self.config)
1111

commitizen/commands/info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
class Info:
66
"""Show in depth explanation of your rules."""
77

8-
def __init__(self, config: BaseConfig, *args: object):
8+
def __init__(self, config: BaseConfig, *args: object) -> None:
99
self.config: BaseConfig = config
1010
self.cz = factory.committer_factory(self.config)
1111

commitizen/commands/init.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def is_pre_commit_installed(self) -> bool:
7979

8080

8181
class Init:
82-
def __init__(self, config: BaseConfig, *args: object):
82+
def __init__(self, config: BaseConfig, *args: object) -> None:
8383
self.config: BaseConfig = config
8484
self.encoding = config.settings["encoding"]
8585
self.cz = factory.committer_factory(self.config)

commitizen/commands/list_cz.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
class ListCz:
77
"""List currently installed rules."""
88

9-
def __init__(self, config: BaseConfig, *args: object):
9+
def __init__(self, config: BaseConfig, *args: object) -> None:
1010
self.config: BaseConfig = config
1111

1212
def __call__(self) -> None:

commitizen/commands/schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
class Schema:
66
"""Show structure of the rule."""
77

8-
def __init__(self, config: BaseConfig, *args: object):
8+
def __init__(self, config: BaseConfig, *args: object) -> None:
99
self.config: BaseConfig = config
1010
self.cz = factory.committer_factory(self.config)
1111

commitizen/commands/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class Version:
1313
"""Get the version of the installed commitizen or the current project."""
1414

15-
def __init__(self, config: BaseConfig, *args: Mapping[str, Any]):
15+
def __init__(self, config: BaseConfig, *args: Mapping[str, Any]) -> None:
1616
self.config: BaseConfig = config
1717
self.parameter = args[0]
1818
self.operating_system = platform.system()

commitizen/config/json_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121

2222
class JsonConfig(BaseConfig):
23-
def __init__(self, *, data: bytes | str, path: Path | str):
23+
def __init__(self, *, data: bytes | str, path: Path | str) -> None:
2424
super().__init__()
2525
self.is_empty_config = False
2626
self.path = path

commitizen/config/toml_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222

2323
class TomlConfig(BaseConfig):
24-
def __init__(self, *, data: bytes | str, path: Path | str):
24+
def __init__(self, *, data: bytes | str, path: Path | str) -> None:
2525
super().__init__()
2626
self.is_empty_config = False
2727
self.path = path

commitizen/config/yaml_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222

2323
class YAMLConfig(BaseConfig):
24-
def __init__(self, *, data: bytes | str, path: Path | str):
24+
def __init__(self, *, data: bytes | str, path: Path | str) -> None:
2525
super().__init__()
2626
self.is_empty_config = False
2727
self.path = path

commitizen/cz/customize/customize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class CustomizeCommitsCz(BaseCommitizen):
2626
bump_map_major_version_zero = defaults.BUMP_MAP_MAJOR_VERSION_ZERO
2727
change_type_order = defaults.CHANGE_TYPE_ORDER
2828

29-
def __init__(self, config: BaseConfig):
29+
def __init__(self, config: BaseConfig) -> None:
3030
super().__init__(config)
3131

3232
if "customize" not in self.config.settings:

commitizen/exceptions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class ExitCode(enum.IntEnum):
4141

4242

4343
class CommitizenException(Exception):
44-
def __init__(self, *args: str, **kwargs: Any):
44+
def __init__(self, *args: str, **kwargs: Any) -> None:
4545
self.output_method = kwargs.get("output_method") or out.error
4646
self.exit_code: ExitCode = self.__class__.exit_code
4747
if args:
@@ -58,7 +58,7 @@ def __str__(self) -> str:
5858
class ExpectedExit(CommitizenException):
5959
exit_code = ExitCode.EXPECTED_EXIT
6060

61-
def __init__(self, *args: str, **kwargs: Any):
61+
def __init__(self, *args: str, **kwargs: Any) -> None:
6262
output_method = kwargs.get("output_method") or out.write
6363
kwargs["output_method"] = output_method
6464
super().__init__(*args, **kwargs)

commitizen/git.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def __init__(
5959
author: str = "",
6060
author_email: str = "",
6161
parents: list[str] | None = None,
62-
):
62+
) -> None:
6363
self.rev = rev.strip()
6464
self.title = title.strip()
6565
self.body = body.strip()
@@ -132,7 +132,7 @@ def __repr__(self) -> str:
132132

133133

134134
class GitTag(GitObject):
135-
def __init__(self, name: str, rev: str, date: str):
135+
def __init__(self, name: str, rev: str, date: str) -> None:
136136
self.rev = rev.strip()
137137
self.name = name.strip()
138138
self._date = date.strip()

commitizen/providers/base_provider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class VersionProvider(ABC):
2020

2121
config: BaseConfig
2222

23-
def __init__(self, config: BaseConfig):
23+
def __init__(self, config: BaseConfig) -> None:
2424
self.config = config
2525

2626
@abstractmethod

commitizen/version_schemes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class VersionProtocol(Protocol):
5151
parser: ClassVar[re.Pattern]
5252
"""Regex capturing this version scheme into a `version` group"""
5353

54-
def __init__(self, version: str):
54+
def __init__(self, version: str) -> None:
5555
"""
5656
Initialize a version object from its string representation.
5757

0 commit comments

Comments
 (0)