New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement: Also validate if lock file is up to date #4219
Conversation
|
Not sure, would you like me to provide tests for this one? |
|
I'm not sure if it makes more sense to move this to a command by itself, or keep it as an option/flag just for install. What if you want your build process to check first, and do a |
|
I'm totally open for suggestions! Do you have anything in mind that would make sense? Maybe a or (to leave space for other things which would be useful to verify) |
|
The first example is too ambiguous,
And in the latter scenario, |
There's the |
|
Ah right I forgot about that. Maybe add the |
b6ca8f2
to
2f2849d
Compare
2f2849d
to
1e249c9
Compare
|
Looks good, but I have one concern that maybe @Seldaek might be able to offer some feedback on. Should the lock file be checked by default as well? Then the option would become |
|
馃憤 I also support @alcohol's idea about You should also update CLI docs and CLI command descriptions. |
I think this is a good thing in this case. And Composer is still in alpha so going for consistency rather than BC is better. Also I think this is rarely used at the moment. |
1e249c9
to
cd238de
Compare
| @@ -340,6 +340,7 @@ php composer.phar validate | |||
| ### Options | |||
|
|
|||
| * **--no-check-all:** Whether or not Composer does a complete validation. | |||
| * **--no-lock:** Do not check if lock file is up to date. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cd238de
to
42cae9a
Compare
| @@ -340,6 +340,7 @@ php composer.phar validate | |||
| ### Options | |||
|
|
|||
| * **--no-check-all:** Whether or not Composer does a complete validation. | |||
| * **--no-check-lock:** Do not check if lock file is up to date. | |||
|
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
42cae9a
to
4e69786
Compare
|
@localheinz: You need to update it, @naderman introduced a merge conflict. |
6e6f015
to
08834e9
Compare
|
Done! |
| @@ -37,6 +37,7 @@ protected function configure() | |||
| ->setDescription('Validates a composer.json') | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The composer validate command no longer validates composer.json only.
08834e9
to
18d3aa5
Compare
|
Yeah that probably makes sense. If they just want to validate a json schema they can skip the lock check. Otherwise, check for a lock file in the same directory. |
18d3aa5
to
5828f62
Compare
|
Amended the PR, please have a look! |
|
Looks good to me. /cc @Seldaek do you feel this might be too much of a BC change or acceptable? |
|
Looks good to me, thanks! I doubt it will create issues but perhaps more people use this in build systems than I imagine. |
Enhancement: Also validate if lock file is up to date
This PR
composer.lockis up to date (if it exists), emits an error and exits with non-zero if it's not--no-lockoption which will emit a warning instead馃拋 Useful if you want to break the build because someone modified
composer.jsonwithout updatingcomposer.lock.Example
Fiddle with
composer.jsonin this repository, for example, change{ "autoload": { "psr-0": { "Composer": "src/" } } }to
{ "autoload": { "psr-0": { "Composer": "src" } } }Before
After
After (with
--no-lockoption)