Skip to content

Commit 8698d35

Browse files
committed
fix(fast-paced commit): fast commit generation
1 parent 7331c9a commit 8698d35

File tree

7 files changed

+18
-14
lines changed

7 files changed

+18
-14
lines changed

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.3.2
1+
3.3.3

commit_helper/__main__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ def main():
1818

1919
debug('file_path', file_path, debug_mode)
2020

21-
if file_path.is_file():
22-
handle_file_based_commit(file_path, debug_mode, args)
23-
24-
elif args.convention is not '':
21+
if args.convention is not '':
2522
convention_flag_handler(args, debug_mode)
23+
return
24+
25+
elif file_path.is_file():
26+
handle_file_based_commit(file_path, debug_mode, args)
27+
return
2628

2729
else:
2830
debug('parser full return', parser.parse_args(), debug_mode)

commit_helper/conventions/karma_angular.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
def angular_convention(tag, msg, context):
22
tag = tag.lower()
3-
if context is '':
3+
if context == '':
44
composed_message = "%s: %s\n" % (tag, msg)
55
else:
66
composed_message = "%s(%s): %s\n" % (tag, context, msg)

commit_helper/conventions/no_convention.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44

55
def just_message(msg=''):
6-
if msg is '':
6+
if msg == '':
77
message = str(input(INPUT_COLOR + "commit message: " + RESET))
88
else:
99
message = msg

commit_helper/utils/colors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from colored import fg
22
from colored import attr
33

4-
INPUT_COLOR = fg(6)
5-
NOTIFY_COLOR = fg(14)
6-
DEBUG_COLOR = fg(239)
4+
INPUT_COLOR = fg(14)
5+
NOTIFY_COLOR = fg(15)
6+
DEBUG_COLOR = fg(244)
77
RESET = attr(0)

commit_helper/utils/flag_commit_handler.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ def convention_flag_handler(args, debug_mode):
2222
commit_message = just_message(msg=args.message)
2323
else:
2424
commit_message = just_message()
25-
26-
create_file('none', args.no_file)
25+
convention = 'none'
2726

2827
else:
2928
commit_message = handle_conventioned_commit(convention, args)

commit_helper/utils/utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import sys
22
import argparse
33
from yaml import dump
4+
from .text_utils import notify
45
from .text_utils import handle_context_arg
56
from .text_utils import handle_tag_message_args
67
from commit_helper.conventions.karma_angular import angular_convention
@@ -33,14 +34,16 @@ def gen_co_author(co_author):
3334
return '\nCo-authored-by: %s' % co_author
3435

3536

37+
# TEST
3638
def create_file(convention_name, dont_create=False): # pragma: no cover
3739
if not dont_create:
3840
data = dict(
3941
convention=convention_name
4042
)
4143
with open('commiter.yml', 'w') as output_file:
42-
dump(data, output_file, default_flow_style=False)
43-
print('Successfully created the commiter file.')
44+
output_file.write(dump(data, stream=None,
45+
default_flow_style=False))
46+
notify('Successfully created the commiter file.')
4447

4548

4649
def parser_cli():

0 commit comments

Comments
 (0)