File tree 3 files changed +12
-12
lines changed
3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 7
7
from commitizen .commands .changelog import Changelog
8
8
from commitizen .config import BaseConfig
9
9
from commitizen .exceptions import (
10
- CommitFailedError ,
10
+ BumpCommitFailedError ,
11
+ BumpTagFailedError ,
11
12
DryRunExit ,
12
13
ExpectedExit ,
13
14
NoCommitsFoundError ,
14
15
NoPatternMapError ,
15
16
NoVersionSpecifiedError ,
16
- TagFailedError ,
17
17
)
18
18
19
19
@@ -151,10 +151,10 @@ def __call__(self): # noqa: C901
151
151
self .config .set_key ("version" , new_version .public )
152
152
c = git .commit (message , args = self ._get_commit_args ())
153
153
if c .err :
154
- raise CommitFailedError (f'git.commit error: "{ c .err .strip ()} "' )
154
+ raise BumpCommitFailedError (f'git.commit error: "{ c .err .strip ()} "' )
155
155
c = git .tag (new_tag_version )
156
156
if c .err :
157
- raise TagFailedError (c .err )
157
+ raise BumpTagFailedError (c .err )
158
158
out .success ("Done!" )
159
159
160
160
def _get_commit_args (self ):
Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ class ExitCode(enum.IntEnum):
10
10
NO_COMMITS_FOUND = 3
11
11
NO_VERSION_SPECIFIED = 4
12
12
NO_PATTERN_MAP = 5
13
- COMMIT_FAILED = 6
14
- TAG_FAILED = 7
13
+ BUMP_COMMIT_FAILED = 6
14
+ BUMP_TAG_FAILED = 7
15
15
NO_ANSWERS = 8
16
16
COMMIT_ERROR = 9
17
17
NO_COMMIT_BACKUP = 10
@@ -84,12 +84,12 @@ class NoPatternMapError(CommitizenException):
84
84
exit_code = ExitCode .NO_PATTERN_MAP
85
85
86
86
87
- class CommitFailedError (CommitizenException ):
88
- exit_code = ExitCode .COMMIT_FAILED
87
+ class BumpCommitFailedError (CommitizenException ):
88
+ exit_code = ExitCode .BUMP_COMMIT_FAILED
89
89
90
90
91
- class TagFailedError (CommitizenException ):
92
- exit_code = ExitCode .TAG_FAILED
91
+ class BumpTagFailedError (CommitizenException ):
92
+ exit_code = ExitCode .BUMP_TAG_FAILED
93
93
94
94
95
95
class CurrentVersionNotFoundError (CommitizenException ):
Original file line number Diff line number Diff line change 4
4
5
5
from commitizen import cli , cmd , git
6
6
from commitizen .exceptions import (
7
- CommitFailedError ,
7
+ BumpCommitFailedError ,
8
8
CurrentVersionNotFoundError ,
9
9
DryRunExit ,
10
10
ExpectedExit ,
@@ -81,7 +81,7 @@ def test_bump_on_git_with_hooks_no_verify_disabled(mocker):
81
81
testargs = ["cz" , "bump" , "--yes" ]
82
82
mocker .patch .object (sys , "argv" , testargs )
83
83
84
- with pytest .raises (CommitFailedError ) as excinfo :
84
+ with pytest .raises (BumpCommitFailedError ) as excinfo :
85
85
cli .main ()
86
86
87
87
assert 'git.commit error: "0.1.0"' in str (excinfo .value )
You can’t perform that action at this time.
0 commit comments