File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -18,14 +18,14 @@ def main(
1818 commit_log : str ,
1919 ignore_patterns : list [str ],
2020 force_patch : bool ,
21- ):
21+ ) -> None :
2222 """Print the next version of a package; if there's no print, then's no new version."""
2323
2424 # is a release needed?
2525 if not changed_files :
26- raise ValueError ("No changes detected" )
26+ return print ("No changes detected" , file = sys . stderr )
2727 if all (any (fnmatch (f , pat ) for pat in ignore_patterns ) for f in changed_files ):
28- raise ValueError ("None of the changed files require a release." )
28+ return print ("None of the changed files require a release." , file = sys . stderr )
2929
3030 # detect bump
3131 if "[major]" in commit_log :
@@ -37,7 +37,7 @@ def main(
3737 elif force_patch :
3838 bump = BumpType .PATCH
3939 else :
40- return sys . exit ( 0 ) # no release needed!
40+ return print ( "Commit log doesn't signify a version bump." , file = sys . stderr )
4141
4242 # increment
4343 major , minor , patch = map (int , tag .split ("." ))
@@ -51,7 +51,7 @@ def main(
5151 case BumpType .PATCH :
5252 patch += 1
5353 case _:
54- raise ValueError (f"Bump type not supported: { bump } " )
54+ return print (f"Bump type not supported: { bump } " , file = sys . stderr )
5555
5656 # print the next version
5757 print (f"{ major } .{ minor } .{ patch } " )
You can’t perform that action at this time.
0 commit comments