Skip to content

Commit c31a09a

Browse files
feat(makefile): add fix target for in-place formatting
Add `make fix` target to Makefile. Update retrofit guide to use `make fix` instead of manual docker run. Add fix to target mapping. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3b73d65 commit c31a09a

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ HUGO_VERSION ?= latest
66
.DEFAULT_GOAL := help
77

88
# .PHONY declarations
9-
.PHONY: help build serve lint format test security scan docs check install-hooks
10-
.PHONY: _lint _format _test _security _scan _docs _check
9+
.PHONY: help build serve lint format fix test security scan docs check install-hooks
10+
.PHONY: _lint _format _fix _test _security _scan _docs _check
1111

1212
# Public targets
1313
help: ## Show this help
@@ -23,6 +23,9 @@ serve: ## Start local Hugo development server
2323
lint: ## Run all linters
2424
$(DOCKER_RUN) make _lint
2525

26+
fix: ## Auto-fix formatting issues in-place
27+
$(DOCKER_RUN) make _fix
28+
2629
format: ## Run all formatters
2730
$(DOCKER_RUN) make _format
2831

@@ -52,6 +55,9 @@ _lint:
5255
_format:
5356
@echo "format: no language-specific formatters for documentation site"
5457

58+
_fix:
59+
@echo "fix: no language-specific formatters for documentation site"
60+
5561
_test:
5662
@echo "test: no language-specific tests for documentation site"
5763

content/docs/getting-started/retrofit.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,11 @@ Expect some findings on the first run -- your existing code may not match DevRai
104104

105105
### Fixing Findings
106106

107-
Use `make` targets to auto-fix what can be auto-fixed:
107+
Use `make fix` to auto-fix formatting issues in-place:
108108

109109
```bash
110-
# Auto-format code (inside the container)
111-
# Note: formatting targets apply fixes directly
112-
docker run --rm -v "$(pwd):/workspace" -w /workspace \
113-
ghcr.io/devrail-dev/dev-toolchain:v1 make _format
110+
# Auto-fix formatting (runs inside the container)
111+
make fix
114112
```
115113

116114
For linting issues that cannot be auto-fixed, address them manually following the guidance in the [Standards Reference](/docs/standards/).

content/docs/standards/_index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ Each Makefile target runs the relevant tools for all languages declared in `.dev
3030
| Target | What It Runs |
3131
|---|---|
3232
| `make lint` | ruff check, shellcheck, tflint, ansible-lint, mypy, rubocop, reek, golangci-lint, eslint, tsc |
33-
| `make format` | ruff format, shfmt, terraform fmt, rubocop, gofumpt, prettier |
33+
| `make format` | ruff format --check, shfmt -d, terraform fmt -check, rubocop --check, gofumpt -d, prettier --check |
34+
| `make fix` | ruff format, shfmt -w, terraform fmt, rubocop -a, gofumpt -w, prettier --write |
3435
| `make test` | pytest, bats, terratest, molecule, rspec, go test, vitest |
3536
| `make security` | bandit, semgrep, tfsec, checkov, brakeman, bundler-audit, govulncheck, npm audit |
3637
| `make scan` | trivy, gitleaks (universal -- all projects) |

0 commit comments

Comments
 (0)