Skip to content

Commit 812a63f

Browse files
ChughShilpaclaude
andcommitted
docs(agents): add targeted lint/format commands to AGENTS.md
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Shilpa Chugh <shchugh@redhat.com>
1 parent 7c161d0 commit 812a63f

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

AGENTS.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,23 @@ make vet # Vet the Go code
128128
make golangci-lint # Verify the Go code
129129
```
130130

131+
### Targeted lint/format
132+
133+
For quick feedback on specific files or packages instead of running project-wide `make` targets:
134+
135+
```bash
136+
# Go
137+
make golangci-lint LINT_PKG=./pkg/controller/... # Lint a single Go package
138+
go vet ./pkg/controller/... # Vet a single Go package (package-level)
139+
gofmt -w path/to/file.go # Format a single Go file
140+
141+
# Python
142+
pre-commit run --files path/to/file.py # Run all hooks on a single file
143+
144+
# Rust (crate-level: triggers on the file but formats/checks the entire crate)
145+
pre-commit run --files path/to/file.rs # Run all hooks on a single file
146+
```
147+
131148
**Code generation** (always run after modifying the APIs):
132149

133150
```bash

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ HELM_DOCS ?= $(LOCALBIN)/helm-docs
4343
YQ ?= $(LOCALBIN)/yq
4444
GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint
4545
GOLANGCI_LINT_KAL ?= $(LOCALBIN)/golangci-lint-kube-api-linter
46+
LINT_PKG ?= ./...
4647
KUBE_LINTER ?= $(LOCALBIN)/kube-linter
4748

4849
##@ General
@@ -173,7 +174,7 @@ vet: ## Run go vet against the code.
173174

174175
.PHONY: golangci-lint
175176
golangci-lint: golangci-lint-install golangci-lint-kal ## Run golangci-lint to verify Go files.
176-
$(GOLANGCI_LINT) run --timeout 5m ./...
177+
$(GOLANGCI_LINT) run --timeout 5m $(LINT_PKG)
177178
$(GOLANGCI_LINT_KAL) run -v --config $(PROJECT_DIR)/.golangci-kal.yml
178179

179180
# Instructions to run tests.

0 commit comments

Comments
 (0)