snapshot of c000b74a5b09c433f96a69fa102c5c8f6583dff0 Annotations about the code that implements koment.

scripts/commitlint.sh

1 #!/usr/bin/env bash
2
3 set -euo pipefail
4
5 re='^(feat|fix|docs|style|refactor|test|chore|perf|ci|build|revert)(!)?(\([a-z0-9 .\-]+\))?!?: .+'
6
7 failed=0
8 while IFS= read -r subject; do
9 [ -z "$subject" ] && continue
10 case "$subject" in
11 'Merge '*) continue ;;
12 esac
13 if ! printf '%s\n' "$subject" | grep -qE "$re"; then
14 echo "::error::non-conforming commit subject: $subject" >&2
15 failed=1
16 fi
17 done
18
19 if [ "$failed" -ne 0 ]; then
20 cat >&2 <<'MSG'
21 Commit subjects MUST follow Conventional Commits 1.0.0:
22 <type>(<scope>)?!: <description>
23 Types: feat, fix, docs, style, refactor, test, chore, perf, ci, build, revert
24 Use ! after the type (or after the scope) for breaking changes.
25 See https://www.conventionalcommits.org/ and docs/explanation/decisions/0128.
26 MSG
27 exit 1
28 fi

Find an annotation

Search file paths, rationale, kinds, and authors.

moveEnter openEsc close