From ca5e93ffc847b1dabeb1dd40da5226679b2b86af Mon Sep 17 00:00:00 2001 From: shockrah Date: Wed, 3 Mar 2021 17:17:11 -0800 Subject: [PATCH] =?UTF-8?q?=E2=9E=95=20New=20commit=20message=20prettyfier?= =?UTF-8?q?=20that=20i=20kidna=20like?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + git-doc.py | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 git-doc.py diff --git a/.gitignore b/.gitignore index 4e1e61e..12ac9be 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ docs/public/ keys/ chan-like/target/ +commit-message.tmp diff --git a/git-doc.py b/git-doc.py new file mode 100644 index 0000000..907d580 --- /dev/null +++ b/git-doc.py @@ -0,0 +1,34 @@ +''' +Additions: + +Modifications: * +Removals: - +Note/Warning ! +''' + +import sys + +TMP_MSG_FILE = 'tmp-commit-file' + +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) + +