Add local fix script and codex validation guidance

This commit is contained in:
beatz174-bit
2026-04-23 13:23:20 +10:00
parent 9e731e51aa
commit 966c44b88d
3 changed files with 45 additions and 0 deletions
+13
View File
@@ -59,6 +59,19 @@ Changes should keep the provider idiomatic, easy to contribute to, and ready for
## Agent instructions ## Agent instructions
## Validation workflow (Codex and local)
When you modify **Go** or **Terraform** files, always run this sequence before concluding work:
1. `./scripts/fix.sh`
2. `./scripts/check.sh`
### Expectations
- Do not leave formatting changes unapplied.
- Do not hand-edit formatting that `gofmt` or `terraform fmt` can apply automatically.
- Treat `./scripts/check.sh` as the required final validation gate.
- If Terraform is unavailable in the environment, note that Terraform formatting/checking could not be run locally.
### Local validation for this repository ### Local validation for this repository
This provider is not yet published to the Terraform Registry. This provider is not yet published to the Terraform Registry.
+12
View File
@@ -181,6 +181,18 @@ data "dynu_dns_records" "selected" {
- Symptom: Terraform behavior doesn't reflect latest code. - Symptom: Terraform behavior doesn't reflect latest code.
- Fix: rebuild binary (`go build -o terraform-provider-dynu`) and re-run `terraform validate` and `terraform plan`. - Fix: rebuild binary (`go build -o terraform-provider-dynu`) and re-run `terraform validate` and `terraform plan`.
## Development checks
Before committing, run:
```bash
./scripts/fix.sh
./scripts/check.sh
```
`fix.sh` applies standard formatting and module hygiene.
`check.sh` is the strict verification script used by CI.
## Developer workflow ## Developer workflow
- `./scripts/setup-dev.sh` - validate local toolchain requirements - `./scripts/setup-dev.sh` - validate local toolchain requirements
Executable
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -euo pipefail
echo "[fix] formatting Go files"
files="$(git ls-files '*.go')"
if [[ -n "${files}" ]]; then
gofmt -w ${files}
fi
echo "[fix] running go mod tidy"
go mod tidy
if command -v terraform >/dev/null 2>&1; then
echo "[fix] running terraform fmt for examples/"
terraform fmt -recursive examples
else
echo "[fix][warn] terraform not found; skipping examples/ formatting" >&2
fi
echo "[fix] complete"