File tree Expand file tree Collapse file tree 3 files changed +33
-11
lines changed
Expand file tree Collapse file tree 3 files changed +33
-11
lines changed Original file line number Diff line number Diff line change @@ -176,25 +176,24 @@ The gotask checker handles `github.com/siketyan/gotask` library:
176176## Development Commands
177177
178178` ` ` bash
179- # Run all tests
180- go test ./...
181-
182- # Run tests with verbose output
183- go test -v ./...
179+ # Run ALL tests (ALWAYS use this before committing)
180+ ./test_all.sh
184181
185182# Run golangci-lint
186183golangci-lint run ./...
187184
188185# Format code
189186go fmt ./...
190-
191- # Validate test metadata (structure.json )
192- cd testdata/metatest && go test -v ./...
193-
194- # Validate JSON schema
195- cd testdata/metatest && go run github.com /santhosh-tekuri/jsonschema/cmd/jv@29cbed9 structure.schema .json structure.json
196187```
197188
189+ > [ !IMPORTANT]
190+ > Always use ` ./test_all.sh ` before committing. This script runs:
191+ > 1 . JSON schema validation for ` structure.json `
192+ > 2 . Test metadata validation (ensures all test functions are in ` structure.json ` )
193+ > 3 . All analyzer tests
194+ >
195+ > Running only ` go test ./... ` will miss structure validation failures.
196+
198197## Adding a New Checker
199198
2001991 . Create ` internal/checkers/<name>/checker.go ` :
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ set -x
4+
5+ go run github.com/santhosh-tekuri/jsonschema/cmd/jv@29cbed9 testdata/metatest/structure.schema.json testdata/metatest/structure.json
6+ go test ./testdata/metatest/validation_test.go
7+ go test -v ./...
Original file line number Diff line number Diff line change 21482148 },
21492149 "level" : " basic"
21502150 },
2151+ "derivedCtxInForLoopWithFunctionVariable" : {
2152+ "title" : " Derived ctx in for loop with function variable" ,
2153+ "targets" : [
2154+ " errgroup"
2155+ ],
2156+ "variants" : {
2157+ "good" : {
2158+ "description" : " Real-world production pattern: derived ctx used in closure inside for loop" ,
2159+ "functions" : {
2160+ "errgroup" : " goodErrgroupWithContextForLoop"
2161+ }
2162+ },
2163+ "bad" : null
2164+ },
2165+ "level" : " basic"
2166+ },
21512167 "literalWithDerivedCtxWithDefer" : {
21522168 "title" : " Literal with derived ctx - with defer" ,
21532169 "targets" : [
You can’t perform that action at this time.
0 commit comments