Repository navigation
openapi: split load.go by concern #1058
Copy link
Copy link
Closed
Labels
priority:P4Refactors, tests, CI, hostile-input hardening, cosmetic diagnostics, other formatsRefactors, tests, CI, hostile-input hardening, cosmetic diagnostics, other formatstype:choreRefactor or cleanup, no behavior changeRefactor or cleanup, no behavior change
Description
Problem
The rest of compilers/openapi/internal/load keeps one concern per file (later.go, required.go, references.go). load.go (1,150 lines) still holds four concerns beside the load itself:
- the source budgets;
- YAML stream decoding;
- the parser's validation findings;
- overlay application.
Direction
budgets.go:exceeds,budgetRefusal,OverByteBudget,nodeCount(it pairs with the existingbudgets_internal_test.go).decode.go: the YAML stream decoding andParsed.overlays.go:patch,applyOverlay,overlayRefusals.- The parser's validation findings join
validate.go, beside the rule-table validation feat(compilers/openapi)!: validate against an OpenAPI rule table #1046 adds under that name. If that file turns out to hold something else, the findings take a name that does not collide, and the PR says why. load.gokeepsLoad, its options, the resolution setup and the supported versions. The package comment moves todoc.go.- Tests in
load_internal_test.gofollow what they call; the package's other test files stay as they are.
Blocked by
#1046 rewrites load.go, load_internal_test.go and most of the package, and adds validate.go.
Done when
- Every top-level declaration of the package, with its doc comment and any comment between declarations, is byte-identical before and after the move (compared with a throwaway go/ast script), and no golden changes.
- Comments that name a file name the file the code now lives in, changed in a commit of their own.
go test ./compilers/openapi/...passes without-update.
Priority: P4, rule 1 (housekeeping: moves code between files and changes no lowering, validation, IR or emit-contract behaviour). wc -l compilers/openapi/internal/load/load.go → 1150 (morphic @a1f15b29).
Metadata
Metadata
Assignees
Labels
priority:P4Refactors, tests, CI, hostile-input hardening, cosmetic diagnostics, other formatsRefactors, tests, CI, hostile-input hardening, cosmetic diagnostics, other formatstype:choreRefactor or cleanup, no behavior changeRefactor or cleanup, no behavior change
Activity