''' Additions: + Modifications: * Removals: - Note/Warning ! ''' import sys TMP_MSG_FILE = 'commit-message.tmp' lines = [] for line in sys.stdin: line = line.strip() if line.startswith('+'): line = '➕' + line[1:] elif line.startswith('-'): line = '➖' + line[1:] elif line.startswith('*'): line = '✨' + line[1:] elif line.startswith('!'): line = '❗' + line[1:] lines.append(line) with open(TMP_MSG_FILE, 'w') as target: for line in lines: print(line, file=target)