File tree Expand file tree Collapse file tree 6 files changed +20
-5
lines changed Expand file tree Collapse file tree 6 files changed +20
-5
lines changed Original file line number Diff line number Diff line change 11from os import system
22from utils import get_text
3+ from utils import change_if_none
34
45
5- def changelog_convention (co_author = '' ):
6+ def changelog_convention (co_author ):
67 tag , msg = get_text ()
78 tag = tag .upper ()
9+ co_author = change_if_none (co_author )
810 composed_message = """%s: %s\n \n Co-authored-by: """ % (tag , context )
911 system ("git commit -m '%s%s'" % (composed_message , co_author ))
Original file line number Diff line number Diff line change 11from os import system
22from utils import get_text
3+ from utils import change_if_none
34
45
5- def angular_convention (co_author = '' ):
6+ def angular_convention (co_author ):
67 tag , msg , context = get_text (context = True )
78 tag = tag .lower ()
9+ co_author = change_if_none (co_author )
810 composed_message = """%s(%s): %s\n \n Co-authored-by:
911""" % (tag , context , msg )
1012 system ('git commit -m "%s%s"' % (composed_message , co_author ))
Original file line number Diff line number Diff line change 11from os import system
2+ from utils import change_if_none
23
34
4- def just_message (co_author = '' ):
5+ def just_message (co_author ):
56 msg = str (input ("commit message: " ))
7+ co_author = change_if_none (co_author )
68 composed = """%s\n \n Co-authored-by: """ % msg .capitalize ()
79 system ("git commit -m '%s%s'" % (composed , co_author ))
Original file line number Diff line number Diff line change 11from os import system
22from utils import get_text
3+ from utils import change_if_none
34
45
5- def symphony_convention (co_author = '' ):
6+ def symphony_convention (co_author ):
67 tag , msg = get_text ()
78 tag = tag .capitalize ()
9+ co_author = change_if_none (co_author )
810 composed = """[%s] %s\n \n Co-authored-by: """ % (tag , msg )
911 system ("git commit -m '%s%s'" % (composed , co_author ))
Original file line number Diff line number Diff line change 1515from utils import menu
1616from utils import parser_cli
1717from utils import create_file
18- from utils import supported_conventions
1918
2019
2120parser = parser_cli ()
Original file line number Diff line number Diff line change @@ -51,3 +51,11 @@ def parser_cli():
5151 dest = "convention" ,
5252 help = "selects a convention to be used for the commit" )
5353 return parser
54+
55+
56+ def change_if_none (string ):
57+ if string is None :
58+ return ''
59+ else :
60+ return string
61+
You can’t perform that action at this time.
0 commit comments