Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ pnpm installs the Node toolchain (commitlint, Prettier, lefthook, semantic-relea
git hooks; Homebrew adds actionlint, zizmor, shellcheck and gitleaks. The hooks warn and skip when
a linter is missing, so a fresh clone can always commit — CI has no such escape hatch.

On push, the hooks also check the branch name and the 20-file limit, with the same scripts `ci-pr`
runs on the pull request.

## Contributing

[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) and
Expand Down
16 changes: 16 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# review:
# commit-msg -> Conventional Commits (commitlint)
# pre-commit -> Prettier, then the four linters ci-workflows runs
# pre-push -> Conventional Branch name and the PR size limit (ci-pr)
#
# Prettier and commitlint are devDependencies, so they are always present. The
# linters are system tools: the guards below warn and skip when one is missing
Expand Down Expand Up @@ -76,3 +77,18 @@ pre-commit:
action-pins:
glob: '{.github/workflows,workflow-templates}/*.{yml,yaml}'
run: sh .devtools/check-action-pins.sh

# The same two scripts ci-pr runs, and the ones `.pre-commit-hooks.yaml` offers to
# consumers. Without them here this repo was the one place a bad branch name was
# first reported by CI, after the pull request was already open.
#
# Both check the branch that is checked out, not the ref being pushed, which is
# the same thing in every push but `git push origin <other-branch>`.
pre-push:
parallel: true
commands:
branch-name:
run: bash .devtools/check-branch-name.sh

pr-size:
run: bash .devtools/check-pr-size.sh
Loading