fleetlint Policy for a fleet of repositories
v0.9
Getting started

hooks/pre-push-check

Full check runs before push

Severitywarning
Tiers1, 2
Stacksany
Scoperoot
Kindoutcome
Sourcelibrary v0.6.0
Selected byfleetlint-recommended@v0.6.0

Requirement

The task runner’s check (make check, just check, task check, npm run check, ./gradlew check and the like) or a check script (./scripts/check.sh) runs as a pre-push hook: a pre-commit/prek hook with stages: [pre-push], or a command in lefthook’s pre-push. check-fast does not count.

Why

Pushing red is what breaks main for everyone else; the hook makes it impossible to do by accident.

Applies when

[".pre-commit-config.yaml", "lefthook.yml", "lefthook.yaml", "lefthook.toml", "lefthook.json", "lefthook.jsonc",
 ".lefthook.yml", ".lefthook.yaml", ".lefthook.toml", ".lefthook.json", ".lefthook.jsonc"].exists(f, file(f))

Fix

Add a local hook whose entry is the task runner’s check (make check, just check, npm run check, …), with stages: [pre-push] and always_run: true.

Agent instruction: Add a repo: local hook running the repository’s task runner check (the command fleetlint check reports as the task runner, e.g. just check) at stage pre-push with pass_filenames: false and always_run: true.

A finding of this rule points at the file ([".pre-commit-config.yaml", "lefthook.yml", "lefthook.yaml", "lefthook.toml", "lefthook.json", "lefthook.jsonc", ".lefthook.yml", ".lefthook.yaml", ".lefthook.toml", ".lefthook.json", ".lefthook.jsonc"].filter(f, file(f)) + [".pre-commit-config.yaml"])[0] yields.

Sources


Generated by fleetlint docs from catalog v0.6.0.