diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0723fc7db..1492b4104 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -53,13 +53,6 @@ repos: language: script # exclude: we could exclude files here, but we do it in the script instead -#- repo: local -# hooks: -# - id: check-commit-msg -# name: Check commit message -# entry: python scripts/dev/check-commit-msg.py -# language: python -# stages: [commit-msg] - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook rev: v9.5.0 diff --git a/scripts/dev/check-commit-msg.py b/scripts/dev/check-commit-msg.py deleted file mode 100644 index 81649e82d..000000000 --- a/scripts/dev/check-commit-msg.py +++ /dev/null @@ -1,35 +0,0 @@ -# This file is part of the DiscoPoP software (http://www.discopop.tu-darmstadt.de) -# -# Copyright (c) 2020, Technische Universitaet Darmstadt, Germany -# -# This software may be modified and distributed under the terms of -# the 3-Clause BSD License. See the LICENSE file in the package base -# directory for details. - -import re - -# checks the commit message for correct formatting. -# invoked by the git commit-msg hook, if configured. -import sys - -# todo translate to python - -path_to_commit_msg = sys.argv[1] - -with open(path_to_commit_msg, "r") as f: - commit_msg = f.read() - commit_msg = commit_msg.replace("\n", "") - -pattern = re.compile("^(feat|fix|test|chore|wip|refactor|doc|docs|perf|ci|build|style)(\(.+\))?(\[.+\])?:.+$") -matches = bool(pattern.match(commit_msg)) - -if matches: - print("VALID commit message: ", commit_msg) - sys.exit(0) -else: - print("INVALID commit message: ") - print("\t", commit_msg) - print("Please use the following format:") - print("\t(scope)[optional info]: commit message") - print("where `` can be any of `feat,fix,test,chore,wip,refactor,doc,docs,perf,ci,build,style`.") - sys.exit(1)