docs: document smart hook file classification in CONTRIBUTING (#23370)

The git hooks now classify staged files and select either the full
or lightweight make target. This was missing from the contributing
guide after #23358 landed.

Also add actionlint config to suppress a pre-existing SC2016 false
positive in the triage workflow. Shellcheck disable directives
don't work inside heredocs when actionlint drives shellcheck.
This commit is contained in:
Mathias Fredriksson
2026-03-20 17:36:50 +02:00
committed by GitHub
parent ac51610332
commit 89eaf6ad74
2 changed files with 17 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
paths:
# The triage workflow uses a quoted heredoc (<<'EOF') with ${VAR}
# placeholders that envsubst expands later. Shellcheck's SC2016
# warns about unexpanded variables in single-quoted strings, but
# the non-expansion is intentional here. Actionlint doesn't honor
# inline shellcheck disable directives inside heredocs.
.github/workflows/triage-via-chat-api.yaml:
ignore:
- 'SC2016'
+8
View File
@@ -71,6 +71,8 @@ Use the following `make` commands and scripts in development:
- `make install` installs binaries to `$GOPATH/bin`
- `make test`
- `make pre-commit` runs gen, fmt, lint, typos, and builds a slim binary
- `make pre-commit-light` runs fmt and lint for shell, terraform, markdown,
helm, actions, and typos (skips gen, Go/TS lint+fmt, and binary build)
- `make pre-push` runs heavier CI checks including tests (allowlisted)
Install the git hooks to run these automatically:
@@ -79,6 +81,12 @@ Install the git hooks to run these automatically:
git config core.hooksPath scripts/githooks
```
The hooks classify staged/changed files and select the appropriate target.
Commits that only touch docs, shell, terraform, or other lightweight files
run `make pre-commit-light` instead of the full `make pre-commit`, and
`pre-push` is skipped entirely. Changes to Go, TypeScript, SQL, proto, or
the Makefile trigger the full targets as before.
### Running Coder on development mode
1. Run the development script to spin up the local environment: