mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-15 09:01:31 +00:00
fix: drop NeedDeps from the slog duration guard's package load
The guard only reads types for the syntax it walks, which resolves from dependency export data; NeedDeps type-checked the whole graph from source for no extra coverage. Verified identical detection either way (160 packages, 993 files, 3684 slog call sites, and both violation classes still caught). 19.0s to 7.3s under -race.
This commit is contained in:
@@ -33,9 +33,12 @@ var logMethods = map[string]bool{
|
||||
func TestSlogDurationConvention(t *testing.T) {
|
||||
root := moduleRoot(t)
|
||||
|
||||
// No NeedDeps: the guard only reads types for the syntax it walks, which
|
||||
// resolves from dependency export data. Asking for dependency syntax as
|
||||
// well type-checks the whole graph from source for no extra coverage.
|
||||
cfg := &packages.Config{
|
||||
Mode: packages.NeedName | packages.NeedSyntax | packages.NeedTypes |
|
||||
packages.NeedTypesInfo | packages.NeedDeps | packages.NeedImports,
|
||||
packages.NeedTypesInfo | packages.NeedImports,
|
||||
Dir: root,
|
||||
}
|
||||
pkgs, err := packages.Load(cfg, "./spinifex/...", "./cmd/...")
|
||||
|
||||
Reference in New Issue
Block a user