Archived
Merge pull request #14 from beatz174-bit/codex/add-auto-fix-helper-script-for-codex
Add local fixer script and Codex validation guidance
This commit is contained in:
@@ -59,6 +59,19 @@ Changes should keep the provider idiomatic, easy to contribute to, and ready for
|
||||
|
||||
## 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
|
||||
|
||||
This provider is not yet published to the Terraform Registry.
|
||||
|
||||
@@ -181,6 +181,18 @@ data "dynu_dns_records" "selected" {
|
||||
- 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`.
|
||||
|
||||
## 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
|
||||
|
||||
- `./scripts/setup-dev.sh` - validate local toolchain requirements
|
||||
|
||||
Executable
+20
@@ -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"
|
||||
Reference in New Issue
Block a user