Release / Plan (reuse the published image?) (push) Successful in 4s
CI / Docker image (build and smoke test) (push) Skipped
CI / Format and vet (push) Successful in 1m29s
CI / Tests (Linux, race detector) (push) Failing after 1m48s
CI / Dependency audit (push) Successful in 21s
Release / ci (push) Failing after 1m50s
Release / Build image (amd64) (push) Skipped
Release / Build image (arm64) (push) Skipped
Release / Publish tags (push) Skipped
Release / Gitea release (push) Skipped
Always-on Go service (stdlib only) that follows the Traefik JSON access log, the sshd log and the fail2ban log of a host, classifies attacks, scores sources, keeps bounded aggregates with snapshots, and serves an embedded dashboard with live updates, offline geolocation (DB-IP Lite), privacy-friendly traffic analytics, an exportable blocklist and token-authenticated federation between instances. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
43 lines
1.5 KiB
Bash
Executable File
43 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Enforces Conventional Commits 1.0.0 and English-only commit messages.
|
|
set -euo pipefail
|
|
|
|
msg_file="${1:?usage: commit-msg <file>}"
|
|
python3 - "$msg_file" <<'PY'
|
|
import re, sys
|
|
from pathlib import Path
|
|
|
|
raw = Path(sys.argv[1]).read_text(encoding="utf-8")
|
|
lines = [l for l in raw.splitlines() if not l.startswith("#")]
|
|
while lines and not lines[0].strip():
|
|
lines.pop(0)
|
|
if not lines:
|
|
sys.exit("commit-msg: empty commit message")
|
|
|
|
subject = lines[0].strip()
|
|
if subject.startswith(("Merge ", "Revert \"")):
|
|
sys.exit(0)
|
|
|
|
conv_re = re.compile(
|
|
r"^(feat|fix|chore|ci|docs|refactor|test|perf|build|style|revert)(\([a-z0-9_./-]+\))?!?: .+$"
|
|
)
|
|
if not conv_re.match(subject):
|
|
sys.exit(
|
|
f"commit-msg: invalid Conventional Commit header: {subject!r}\n"
|
|
"Expected: <type>[optional scope]: <description in English>\n"
|
|
"Allowed types: feat, fix, chore, ci, docs, refactor, test, perf, build, style, revert"
|
|
)
|
|
|
|
body = "\n".join(lines)
|
|
cleaned = re.sub(r"\b(Guará|Sabiá|Acauã|Harpia|Urutau|Ciberfauna)\b", "", body)
|
|
pt_accents = re.search(r"[áàâãéêíóôõúçÁÀÂÃÉÊÍÓÔÕÚÇ]", cleaned)
|
|
pt_words = re.search(
|
|
r"\b(não|para|como|quando|então|pelos|pelas|pelo|pela|estão|está|também|versão|"
|
|
r"corrige|adiciona|atualiza|remove|padroniza|implementa|ajusta|arquivo|arquivos)\b",
|
|
cleaned,
|
|
re.I,
|
|
)
|
|
if pt_accents or pt_words:
|
|
sys.exit("commit-msg: commit messages must be written 100% in English.")
|
|
PY
|