Skip to content

Commit 8540e1f

Browse files
committed
refactor(BaseCommitizen): remove unused process_commit
1 parent 59fd3f5 commit 8540e1f

File tree

4 files changed

+0
-42
lines changed

4 files changed

+0
-42
lines changed

commitizen/cz/base.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,3 @@ def schema_pattern(self) -> str:
9999
def info(self) -> str:
100100
"""Information about the standardized commit message."""
101101
raise NotImplementedError("Not Implemented yet")
102-
103-
def process_commit(self, commit: str) -> str:
104-
"""Process commit for changelog.
105-
106-
If not overwritten, it returns the first line of commit.
107-
"""
108-
return commit.split("\n")[0]

commitizen/cz/conventional_commits/conventional_commits.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
import re
32

43
from commitizen import defaults
54
from commitizen.cz.base import BaseCommitizen
@@ -198,8 +197,3 @@ def info(self) -> str:
198197
filepath = os.path.join(dir_path, "conventional_commits_info.txt")
199198
with open(filepath, encoding=self.config.settings["encoding"]) as f:
200199
return f.read()
201-
202-
def process_commit(self, commit: str) -> str:
203-
if m := re.match(self.schema_pattern(), commit):
204-
return m.group(3).strip()
205-
return ""

tests/test_cz_base.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,3 @@ def test_info(config):
4242
cz = DummyCz(config)
4343
with pytest.raises(NotImplementedError):
4444
cz.info()
45-
46-
47-
def test_process_commit(config):
48-
cz = DummyCz(config)
49-
message = cz.process_commit("test(test_scope): this is test msg")
50-
assert message == "test(test_scope): this is test msg"

tests/test_cz_conventional_commits.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -130,26 +130,3 @@ def test_info(config):
130130
conventional_commits = ConventionalCommitsCz(config)
131131
info = conventional_commits.info()
132132
assert isinstance(info, str)
133-
134-
135-
@pytest.mark.parametrize(
136-
("commit_message", "expected_message"),
137-
[
138-
(
139-
"test(test_scope): this is test msg",
140-
"this is test msg",
141-
),
142-
(
143-
"test(test_scope)!: this is test msg",
144-
"this is test msg",
145-
),
146-
(
147-
"test!(test_scope): this is test msg",
148-
"",
149-
),
150-
],
151-
)
152-
def test_process_commit(commit_message, expected_message, config):
153-
conventional_commits = ConventionalCommitsCz(config)
154-
message = conventional_commits.process_commit(commit_message)
155-
assert message == expected_message

0 commit comments

Comments
 (0)