Patch "validate --no-check-lock" #10723
Merged
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.
if no lock-file is configured, turn lock file validation errors into warnings (implicit --no-check-lock) unless those are explicitly promoted via the new
--check-lockoption.{"config": {"lock": false}}is an implicit--no-check-lockfor composer validate.--check-lockoverrides an (implicit or explicit)--no-check-lock, always.rationale is that if no composer.lock file is configured in composer.json, the validate command should not fatal over it but instead demote to warning as the suggestion given in the warning won't work unless composer.lock is configured again (and there is no error as the lock-file is ignored by composer).
the difference this makes is the one between an exit status of zero or non-zero, between success and failure.
that is, if (and as) composer validate is used in check scripts (e.g. CI, tests, hooks etc.), it won't stumble over old lock-file artifacts, whatever the reasons may be.
(originally reported and fix idea / context in #10715)