You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
openapi: move alias amplification out of scan.go #1054
compilers/openapi/internal/scan/scan.go holds three things: the walk over the source tree, the anchor-cycle check, and the alias-amplification weigher. The weigher's tests already sit in amplification_internal_test.go, a test file with no amplification.go beside it. site.go is tested from two files, site_internal_test.go and sites_internal_test.go.
Direction
amplification.go: aliasAmplification, the weigher (aliasWeigher and its methods, newAliasWeigher, weighFrame, childrenOf, saturatingAdd), its diagnostics (aliasAmplificationDiag, aliasBudgetDiag, shapeAllowance) and its bounds (maxAliasAmplification, minExpandedNodes).
scan.go keeps the walk and the cycle check. The cycle check is too small to stand alone.
The package comment moves from scan.go to doc.go.
Tests follow what they call; sites_internal_test.go merges into site_internal_test.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/scan/scan.go → 522 (morphic @a1f15b29).
Activity