Skip to content

Commit 2a2a29e

Browse files
committed
fix(commitizen/cz): set changelog_map, changelog_pattern to none as default
without this default, getting these attributes will be an error
1 parent 3a80c56 commit 2a2a29e

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

commitizen/commands/changelog.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from commitizen import factory, out, git, cz
77
from commitizen.config import BaseConfig
8-
from commitizen.error_codes import NO_COMMITS_FOUND
8+
from commitizen.error_codes import NO_COMMITS_FOUND, NO_PATTERN_MAP
99

1010
try:
1111
import importlib.resources as pkg_resources
@@ -32,11 +32,13 @@ def __call__(self):
3232
out.error(
3333
f"'{self.config.settings['name']}' rule does not support changelog"
3434
)
35+
raise SystemExit(NO_PATTERN_MAP)
3536

3637
pat = re.compile(changelog_pattern)
3738

3839
commits = git.get_commits(start=self.start_rev)
3940
if not commits:
41+
out.error("No commits found")
4042
raise SystemExit(NO_COMMITS_FOUND)
4143

4244
tag_map = {tag.rev: tag.name for tag in git.get_tags()}

commitizen/cz/base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
class BaseCommitizen(metaclass=ABCMeta):
1010
bump_pattern: Optional[str] = None
1111
bump_map: Optional[dict] = None
12+
changelog_pattern: Optional[str] = None
13+
changelog_map: Optional[dict] = None
1214
default_style_config: List[Tuple[str, str]] = [
1315
("qmark", "fg:#ff9d00 bold"),
1416
("question", "bold"),

0 commit comments

Comments
 (0)