Add option to enforce refs on whippet deps validate
#245
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.
This commit adds an
--enforce-refs
option that can be passed intowhippet deps validate
that will cause it to fail if a dependency in whippet.json is missing a "ref" property.This will facilitate us in enabling automatic plugin updates, as we'll be able to update our shared whippet validation workflow to fail if references are missing, thereby ensuring that all dependencies have a reference and therefore can't be accidentally updated beyond e.g. a major version tag, or a specific pinned version.
Note that like the other checks in
whippet deps validate
, this does not check whether the reference provided exists and is valid, it just checks one is provided. An implicit check on the validity of the reference itself happens whenwhippet deps update
orwhippet deps install
is run.How to test
./script/test
/bin/whippet
from this repo (e.g. I havewhippet-dev
aliased to that file)whippet-dev deps validate -r
on that repo. It should failwhippet.json
with:whippet deps update
, then runwhippet-dev deps validate -r
again. Validation should now pass.