Skip to content

Commit 355a8df

Browse files
feat(makefile): add make check pre-push hook
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent fa4d2cf commit 355a8df

18 files changed

Lines changed: 78 additions & 11 deletions

File tree

.pre-commit-config.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,15 @@ repos:
3333
# MD013: Line length (disabled -- not enforced for documentation repos)
3434
# MD033: Inline HTML (disabled -- devrail markers use HTML comments)
3535
# MD041: First line heading (disabled -- some files have frontmatter)
36+
37+
# --- Pre-Push: Full Check Gate ---
38+
# Runs make check before every push. Skip with: git push --no-verify
39+
- repo: local
40+
hooks:
41+
- id: make-check
42+
name: make check
43+
entry: make check
44+
language: system
45+
always_run: true
46+
pass_filenames: false
47+
stages: [pre-push]

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ check: ## Run all checks (lint, format, test, security, docs)
3333

3434
install-hooks: ## Install pre-commit hooks
3535
pre-commit install
36+
pre-commit install --hook-type pre-push
3637

3738
_lint:
3839
# Internal target — runs inside container

dev-toolchain/.pre-commit-config.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,15 @@ repos:
3838
rev: v8.21.2
3939
hooks:
4040
- id: gitleaks
41+
42+
# --- Pre-Push: Full Check Gate ---
43+
# Runs make check before every push. Skip with: git push --no-verify
44+
- repo: local
45+
hooks:
46+
- id: make-check
47+
name: make check
48+
entry: make check
49+
language: system
50+
always_run: true
51+
pass_filenames: false
52+
stages: [pre-push]

dev-toolchain/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ install-hooks: ## Install pre-commit hooks
9393
fi
9494
@pre-commit install
9595
@pre-commit install --hook-type commit-msg
96-
@echo "Pre-commit hooks installed successfully. Hooks will run on every commit."
96+
@pre-commit install --hook-type pre-push
97+
@echo "Pre-commit hooks installed successfully. Hooks will run on commit and push."
9798

9899
init: ## Scaffold config files for declared languages
99100
$(DOCKER_RUN) make _init

devrail.dev/.pre-commit-config.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,15 @@ repos:
2424
rev: v8.21.2
2525
hooks:
2626
- id: gitleaks
27+
28+
# --- Pre-Push: Full Check Gate ---
29+
# Runs make check before every push. Skip with: git push --no-verify
30+
- repo: local
31+
hooks:
32+
- id: make-check
33+
name: make check
34+
entry: make check
35+
language: system
36+
always_run: true
37+
pass_filenames: false
38+
stages: [pre-push]

devrail.dev/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ check: ## Run all checks (lint, format, test, security, docs)
4343

4444
install-hooks: ## Install pre-commit hooks
4545
pre-commit install
46+
pre-commit install --hook-type pre-push
4647

4748
# Internal targets
4849
_lint:

devrail.dev/content/docs/getting-started/new-project.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Supported languages: `python`, `bash`, `terraform`, `ansible`, `ruby`, `go`, `ja
4444
make install-hooks
4545
```
4646

47-
This sets up pre-commit hooks that run formatting checks and secret detection on every commit.
47+
This sets up pre-commit hooks that run formatting checks and secret detection on every commit, plus a pre-push hook that runs `make check` before every push.
4848

4949
### Step 4: Run Your First Check
5050

devrail.dev/content/docs/getting-started/retrofit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Thumbs.db
9191
make install-hooks
9292
```
9393

94-
This command runs `pre-commit install` to set up hooks that check formatting, linting, and secret detection on every commit.
94+
This command sets up pre-commit hooks for formatting, linting, and secret detection on every commit, plus a pre-push hook that runs `make check` before every push.
9595

9696
## Step 5: Run Your First Check
9797

github-repo-template/.pre-commit-config.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,15 @@ repos:
8585
# hooks:
8686
# - id: terraform-docs-go
8787
# args: [--output-file, README.md]
88+
89+
# --- Pre-Push: Full Check Gate ---
90+
# Runs make check before every push. Skip with: git push --no-verify
91+
- repo: local
92+
hooks:
93+
- id: make-check
94+
name: make check
95+
entry: make check
96+
language: system
97+
always_run: true
98+
pass_filenames: false
99+
stages: [pre-push]

github-repo-template/DEVELOPMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Every DevRail-managed repo exposes these public targets:
5454
| `make docs` | Generate documentation (terraform-docs, tool version report) |
5555
| `make changelog` | Generate CHANGELOG.md from conventional commits (git-cliff) |
5656
| `make check` | Run all of the above in sequence |
57-
| `make install-hooks` | Install pre-commit hooks |
57+
| `make install-hooks` | Install pre-commit and pre-push hooks |
5858
| `make init` | Scaffold config files for declared languages |
5959

6060
### Naming Rules

0 commit comments

Comments
 (0)