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
Commit 6b2d30d
Browse filesBrowse the repository at this point in the historyBrowse files
Replace api.GenerateOptions Dir/File with Config io.Reader
The struct collapses to five fields: Config (io.Reader), Stderr, Write,
Diff, InsecureProcessPluginNames. api.Generate parses the config from
the reader and treats every relative path in it as relative to the
current working directory.
CLI: each command opens the config file, reads its bytes, parses it once
to extract declared process-plugin names, then chdirs to the config's
directory before invoking api.Generate. Single-process so chdir is fine.
Tests: a new mutatedConfigBytes helper parses the test's sqlc.yaml,
forces version "2", rewrites every schema/queries/output path to be
absolute relative to the test directory, and re-encodes as YAML — so
api.Generate works without knowing the source directory. Optional
mutate callback applies extra changes (managed-db servers etc.) and
also drops a temp file alongside the original for cmd.Vet which still
takes a config path.
cmd/process.go and cmd/vet.go now skip joining their dir parameter when
the config-supplied path is already absolute.
KNOWN ISSUE: TestReplay parse-error tests and the diff_output tests
fail because the api now emits absolute paths in error messages and
unified-diff labels (no config-dir context to strip). Either add a
BaseDir hint back to GenerateOptions or update the affected test
expectations to match.
https://claude.ai/code/session_01RCzB2JR5Y5ScFDUmwcxGVZ
0 commit comments