Repository navigation
Add --ignore-extra option - #2
Merged
Merged
Conversation
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.
Before
envguard reported every key in
.envthat is missing from.env.exampleas extra: a warning by default, an error with--strict. There was no way to say that some extras are expected, so variables such asCI,CI_JOB_IDorTZmade--strictfail.After
A new
--ignore-extra <KEY>option leaves chosen extra keys out of the report. It can be repeated or given a comma-separated list, and an entry ending in*matches by prefix. Invalid entries (empty, malformed) exit with code 2 and a message on stderr.With
CI,CI_JOB_IDandTZin.env, plain--strictstill exits 1 and lists all three. The README has the option in the table and a full example.How
src/cli.ts: parses and validates the option, adds it to the help text.src/compare.ts: filters extra keys by exact name or prefix.tests/cli.test.ts,tests/compare.test.ts: 26 new tests (108 before, 134 now); existing tests are unchanged.README.md: option row and example.