11 lines
254 B
Bash
Executable File
11 lines
254 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
msg_file="$1"
|
|
# Require scope if REQs exist
|
|
if [ -f REQUIREMENTS.md ]; then
|
|
if ! grep -qE '^[a-z]+(\(.+\))?:' "$msg_file"; then
|
|
echo "error: commit requires scope — e.g. feat(parser): ..."
|
|
exit 1
|
|
fi
|
|
fi
|