一键导入
precheck
Run pre-commit checks (gofmt, goimports, gazelle, code generators, build) before committing Prysm changes. Required before every commit.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run pre-commit checks (gofmt, goimports, gazelle, code generators, build) before committing Prysm changes. Required before every commit.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | precheck |
| description | Run pre-commit checks (gofmt, goimports, gazelle, code generators, build) before committing Prysm changes. Required before every commit. |
Run these in order from the repo root before every commit. Stop and report if any step fails.
gofmt — format changed Go files:
gofmt -l $(git diff --name-only --diff-filter=ACM HEAD | grep '\.go$')
If output is non-empty, run gofmt -w on those files.
goimports — organize imports:
goimports -l $(git diff --name-only --diff-filter=ACM HEAD | grep '\.go$')
If output is non-empty, run goimports -w on those files.
Gazelle — sync deps.bzl (when go.mod changed):
bazel run //:gazelle -- update-repos -from_file=go.mod -to_macro=deps.bzl%prysm_deps -prune=true
git diff --exit-code deps.bzl
Gazelle — sync BUILD.bazel:
bazel run //:gazelle -- fix --mode=diff
If the diff is non-empty, run bazel run //:gazelle -- fix.
Regenerate protobuf (when .proto files changed):
hack/update-go-pbs.sh
Regenerate SSZ (when SSZ-tagged structs changed):
hack/update-go-ssz.sh
Regenerate mocks (when proto service interfaces changed):
hack/update-mockgen.sh
Smoke run with Bazel:
bazel run //cmd/beacon-chain:beacon-chain -- --help
bazel run //cmd/validator:validator -- --help
Hack scripts are idempotent — if unsure which generated files are affected, run all three.