Run SwiftFormat and SwiftLint on staged Swift files in the pre-commit hook (formatting-and-linting.md), gracefully skipping when a tool is absent since CI re-runs both. Enforce the Conventional Commits subject format and the 72-character subject limit in the commit-msg hook (commits.md). Correct the pre-push comment that named the removed ci.yml.
14 lines
428 B
Bash
Executable File
14 lines
428 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# pre-push hook: run the mechanical gates locally before a push reaches GitHub.
|
|
# These mirror the CI workflows (.github/workflows/) so red is caught here
|
|
# first. PureYAML is a root Swift package, so Swift gates run at repo root.
|
|
#
|
|
# Install (per repo): git config core.hooksPath .githooks
|
|
|
|
set -u
|
|
|
|
ROOT=$(git rev-parse --show-toplevel 2>/dev/null || echo .)
|
|
cd "$ROOT" || exit 1
|
|
|
|
bash scripts/check-all.sh
|