Repository navigation
Conversation
- the CLI rejects a misspelled flag instead of running without it (strict: true) - resolveInjectMode maps all / vars / blob to the right injection booleans, flag and fallback - findEnvFiles skips .envrc and other names that only start with .env
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Approach: Focused regression tests exercise the real CLI parser and existing helpers without changing production behavior.
Reviewed changes cover all four files, with all 12 added tests, package typechecking, and targeted lint passing.
- CLI flag parsing: Verifies valid flag forwarding and rejects three misspellings without executing commands.
- Injection modes: Checks
all,vars, andblob, fallback resolution, and explicit flag precedence. - Env file discovery: Checks accepted filenames and exclusions using an isolated temporary directory.
- Release metadata: Records the tests-only change with
varlock: none.
gpt-6.1-sol | 𝕏
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Congrats on the Cloudflare news. This adds three small tests around the CLI, tests only.
Misspelled flags are rejected.
cli-executable.tsruns gunshi withstrict: true, so a typo like--formtor--injctstops the command with a "did you mean" instead of running it with the default the user meant to change. Nothing covers that setting: with it flipped tofalsethe suite stays green. The newsrc/cli/cli-executable.test.tsruns the real entry in-process (exit, telemetry and the load/run commands stubbed) and checks that a correctly spelled flag reaches the command, and that three misspelled ones exit 1, name the bad flag on stderr and never run the command.--injectmodes. IfresolveInjectModeever mappedvarsandblobthe wrong way round,--inject blobwould still inject every value as a plain env var and--inject varswould inject none, so the child process would get the opposite of what was asked.inject-mode.test.tspins all three modes, the fallback, and that an explicit--injectwins over the fallback (the--no-inject-graphpath invarlock run).findEnvFilesskips.envrc.varlock inituses it to pick the env files it reads. The comment says.envrcis ignored, and only the'.env.'prefix check makes that true: withstartsWith('.env'),initwould pick up.envrc,.env-backupand the like.find-env-files.test.tswrites a mix of names to a temp dir and checks that only.envand.env.*come back (.d.tsand.mdstill skipped).Checked on main
658da7e: the varlock package suite passes with the tests added (150 files, 2,616 tests) andtsc --noEmitis clean. Each test fails when the line it covers is changed (strict: false;'vars'swapped for'blob'ininjectVars;startsWith('.env')), with nothing else failing.This is a gap in the tests, not a bug in varlock today: main behaves correctly. Part of Trenyx's hardening run (trenyx.io). Saurabh (SK)