mirror of
https://github.com/instructkr/claude-code.git
synced 2026-05-26 15:36:46 +00:00
Catch stale Rust compile drift before push
Add a repository-local pre-push gate that runs the locked Rust workspace build from the repo root, plus concise install and verification docs for maintainers. Constraint: ROADMAP #694 requires a local installable hook artifact only; branch protection remains external. Rejected: CI or branch-protection changes | outside the requested local pre-push gate scope. Confidence: high Scope-risk: narrow Directive: Keep .github/hooks/pre-push and contributor docs synchronized if the Rust workspace build command changes. Tested: bash -n .github/hooks/pre-push; SKIP_CLAW_PRE_PUSH_BUILD=1 .github/hooks/pre-push; git diff --check; python3 .github/scripts/check_doc_source_of_truth.py; cargo fmt --manifest-path rust/Cargo.toml --all -- --check; cargo build --manifest-path rust/Cargo.toml --workspace --locked; .github/hooks/pre-push Not-tested: shellcheck and markdownlint unavailable in environment.
This commit is contained in:
10
.github/hooks/pre-push
vendored
10
.github/hooks/pre-push
vendored
@@ -8,6 +8,11 @@
|
||||
# caught before pushing to main or PR branches.
|
||||
set -euo pipefail
|
||||
|
||||
if [[ "${SKIP_CLAW_PRE_PUSH_BUILD:-}" == "1" ]]; then
|
||||
echo "pre-push: SKIP_CLAW_PRE_PUSH_BUILD=1 set; skipping cargo workspace build" >&2
|
||||
exit 0
|
||||
fi
|
||||
|
||||
repo_root="$(git rev-parse --show-toplevel 2>/dev/null)"
|
||||
cd "$repo_root"
|
||||
|
||||
@@ -16,5 +21,6 @@ if [[ ! -f rust/Cargo.toml ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "pre-push: cargo build --manifest-path rust/Cargo.toml --workspace" >&2
|
||||
cargo build --manifest-path rust/Cargo.toml --workspace
|
||||
build_cmd=(cargo build --manifest-path rust/Cargo.toml --workspace --locked)
|
||||
echo "pre-push: ${build_cmd[*]}" >&2
|
||||
"${build_cmd[@]}"
|
||||
|
||||
Reference in New Issue
Block a user