Skip to content

Commit

Permalink
Merge 5ae04cf into 6323a60
Browse files Browse the repository at this point in the history
  • Loading branch information
theo-o authored May 14, 2020
2 parents 6323a60 + 5ae04cf commit 3fd19ab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/validate-commit-messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
import subprocess
import sys

"""
This script attempts to verify that certain
basic commit message conventions are followed.
"""


def get_output(cmd):
return subprocess.run(cmd, stdout=subprocess.PIPE, check=True).stdout.decode()
Expand Down Expand Up @@ -44,6 +49,9 @@ def pluralize(value, singular="", plural="s"):
if re.search(r"^(build|chore|ci|docs|feat|fix|perf|refactor|style|test)(\([a-z]+\))?: .*$", lines[0],) is None:
errors.append("First line does not match format")

if re.search(r"[^:]: [a-z].*$", lines[0]) is None:
errors.append("First letter in commit message description is not lowercase.")

if len(lines) > 1 and lines[1]:
errors.append(
"Second line must be empty. Please put a blank line between the subject (first line) and the body/extended description (third line "
Expand Down

0 comments on commit 3fd19ab

Please sign in to comment.