一键导入
run-presubmit-checks
Run presubmit checks on one or more commits. Prepare changes for submission by automatically fixing issues like formatting.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run presubmit checks on one or more commits. Prepare changes for submission by automatically fixing issues like formatting.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use for ALL documentation-related workflows: rst style guide, changelog updates, C/C++ API reference (Doxygen)
Run toolchain binaries (objdump, nm, size, readelf, strip, etc) to disassemble code, list symbols, analyze binary size, and inspect ELF artifacts. MUST be used instead of system tools.
Guide to defining, implementing, and testing a new Pigweed RPC service in C++ using Nanopb, pw_protobuf, or raw methods.
Instructions for running tests and lints for the Pigweed kernel (`pw_kernel`).
Comprehensive workflow for reviewing Git patches and Gerrit Change Lists (CLs).
Instructions for working with Bluetooth code (pw_bluetooth_sapphire, pw_bluetooth_proxy, etc.) and the Bluetooth Core Specification.
| name | run_presubmit_checks |
| description | Run presubmit checks on one or more commits. Prepare changes for submission by automatically fixing issues like formatting. |
This skill describes how to use Pigweed's presubmit script in auto mode to automatically run checks, apply fixes, and continue a rebase across a stack of commits (CLs).
The auto mode in pw_presubmit streamlines the process of fixing presubmit issues across multiple commits. It starts an interactive rebase and runs checks on each commit. If a check fails but has an automatic fix, it applies the fix and amends the commit. If a check fails and cannot be fixed automatically, it stops and allows the user to fix it manually before resuming.
auto mode. If it is not clean, abort and tell the user to clean the working tree before starting.git rev-parse HEAD to get the current commit hash (referred to as <COMMIT>).git rebase --abort; git reset <COMMIT> --hard.I am starting an interactive rebase at
<COMMIT>. This will run presubmit checks on each commit in your stack. If a check fails but has an automatic fix, it will apply the fix and amend your commit. This will change your branch history.If you need to abort and fully restore your branch to its original state, you can run:
git rebase --abort; git reset <COMMIT> --hard
To run presubmit in auto mode on a stack of commits, use the following command:
$ ./pw presubmit --mode auto --ui minimal --program full --base <BASE>
Replace <BASE> with the base commit of the stack (e.g., origin/main or a specific commit hash).
resume.json).When the script fails on a commit:
Identify the failure: Look at the output to see which step failed and why.
Fix the issues: Manually fix the issues, if feasible. Stop and ask the user for input before proceeding if you encounter any of the following:
Stage and Amend: You MUST amend the commit with your fixes before resuming. The script requires a clean working tree.
$ git add <fixed_files>
$ git commit --amend --no-edit
Resume: Run the presubmit command again with the --resume flag and the path to the saved state file.
$ ./pw presubmit --resume /tmp/pw_presubmit_auto_XXXXXX/resume.json
Replace /tmp/pw_presubmit_auto_XXXXXX/resume.json with the path provided in the failure message.