-
Notifications
You must be signed in to change notification settings - Fork 27
ComposerLintReview Error #57
Comments
static-review doesn't include composer.lock in the repository, so this should be solved by running |
The composer.json file is not part of static-review in any way. Our project uses static-review as a git hook, and one of the reviews is ComposerLintReview which fails when we try to commit changes to our composer.json. |
Well then it looks like you tried to commit composer.json without composer.lock being in sync. |
So static review creates a temporary version of the staged file that you want to commit and reviews that. Have a go running |
I figured it out. The cached composer.json file static-review uses checks if it's out-of-sync against any cached composer.lock, meaning that if I only commit the composer.json file it'll check out-of-sync against an old composer.lock (as long as there is one in the cache). In my case we once upon a time had composer.lock in the repo but later decided to remove it (due to the repo being a library). But I still have an old copy of it in static-review's cache, so every time I try to commit changes to composer.json it'll complain. I removed the cached composer.lock and now I can successfully commit composer.json. Woo! |
Ah yes, I haven't done much work on cleaning up the temporary files, nice work figuring it out! I'll open a new issue to look at cleaning up the temporary files that the git version control class creates. |
When I try to commit changes to a composer.json ComposerLintReview more often that not gives me the following error:
If I manually run
composer diagnose
against the file it'll give me the following output (with exit code 0):Digging into the ComposerLintReview class and logging the output of the child process (if
$process->isSuccessful()
is false) gives me the following:Digging deeper by manually running
composer validate
against the cache file above, I receive the following:Not sure what's going here, but Composer is seemingly not a big fan of the static-review's cached composer file.
Any ideas?
Thanks!
The text was updated successfully, but these errors were encountered: