Skip to content

Commit 9a9f64d

Browse files
committed
docs: describe the git hooks and pull request checks in development setup
Cover the hooks pnpm install turns on, pnpm skills:check and pnpm commit:check, the skills step in CI, the warn-only Commit message and Docs check workflows, and the no-docs label.
1 parent 48fed0f commit 9a9f64d

1 file changed

Lines changed: 26 additions & 2 deletions

File tree

‎apps/docs/src/content/contributing/development.md‎

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ pnpm install
3232

3333
`pnpm-workspace.yaml` lists `packages/*`, `examples/*` and `apps/*`, so one install covers every project.
3434

35+
### Git hooks
36+
37+
`pnpm install` sets `core.hooksPath` to `.githooks` and `commit.template` to `.gitmessage`. If you already set either one yourself, it keeps your value.
38+
39+
| Hook | What it does |
40+
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
41+
| `pre-commit` | Formats the staged files with Prettier and stages the result. It skips a file that also has unstaged changes, so hunks you left out with `git add -p` stay out of the commit. |
42+
| `commit-msg` | Checks the message against the [commit message guidelines](https://github.com/santoshyadavdev/angular-devtools/blob/main/docs/contributing/commit-message-guidelines.md). It prints a warning and never blocks the commit. |
43+
3544
## Project structure
3645

3746
```text
@@ -126,8 +135,12 @@ pnpm typecheck # Host app + specs, devtools UI, devtools pa
126135
pnpm exec nx affected -t test build # Test and build affected projects
127136
pnpm test:devtools # Devtools package tests (Vitest)
128137
pnpm extension:build # Chrome extension
138+
pnpm skills:check # Agent skills and roles in .claude/
139+
pnpm commit:check # Commit messages on your branch
129140
```
130141

142+
`pnpm skills:check` validates the frontmatter of every skill and role and checks that the files and links they mention exist. `pnpm commit:check` checks every commit on your branch that is not on `main` (it compares with `upstream/main`, then `origin/main`, then `main`).
143+
131144
### What CI runs
132145

133146
`.github/workflows/ci.yml` runs on pushes and pull requests to `main`, in this order:
@@ -136,8 +149,8 @@ pnpm extension:build # Chrome extension
136149
<ngmd-step title="Install">
137150
<code>pnpm install --frozen-lockfile</code> on the Node version from <code>.nvmrc</code>.
138151
</ngmd-step>
139-
<ngmd-step title="Check formatting and types">
140-
<code>pnpm format:check</code>, then <code>pnpm typecheck</code>.
152+
<ngmd-step title="Check formatting, skills and types">
153+
<code>pnpm format:check</code>, <code>pnpm skills:check</code>, then <code>pnpm typecheck</code>.
141154
</ngmd-step>
142155
<ngmd-step title="Test and build affected projects">
143156
<code>nx affected -t test build</code>, compared against the last green commit on <code>main</code>.
@@ -153,6 +166,17 @@ pnpm extension:build # Chrome extension
153166
</ngmd-step>
154167
</ngmd-workflow>
155168

169+
### Pull request checks
170+
171+
Two more workflows run on pull requests. Both only warn. They never fail the pull request.
172+
173+
| Workflow | File | What it checks |
174+
| ---------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
175+
| `Commit message` | `.github/workflows/commit-message.yml` | The pull request title and every commit message. The title becomes the commit on `main` when the pull request is squash merged. |
176+
| `Docs check` | `.github/workflows/docs-check.yml` | That a change to `packages/ng-devtools/src/`, `app/src/` or the top-level files in `extension/` also changes a page in `apps/docs/src/content`. Tests don't count. |
177+
178+
If a code change needs no docs change, add the `no-docs` label to the pull request and say why in the description. The `Docs check` workflow then skips the warning.
179+
156180
## Make changes
157181

158182
### Add an RPC function

0 commit comments

Comments
 (0)