Makefile: auto-run composer install before phpcs - #74
Conversation
`phpcs` (and so `make checks`) needs vendor/ (parallel-lint, phpcs, minus-x), but until now that meant remembering to run `composer install` yourself first — skip it and `make checks` failed with "parallel-lint: not found" instead of a clear error. `phpcs` now depends on the vendor/autoload.php file target, which runs `composer install` whenever it's missing or composer.json is newer, so `make checks` works on a fresh checkout without an extra manual step. Co-Authored-By: Claude Sonnet 5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6c1c23bc7d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| composer test | ||
|
|
||
| vendor/autoload.php: composer.json | ||
| composer install --no-progress |
There was a problem hiding this comment.
Refresh the ignored lock when requirements change
When an existing checkout already has the ignored composer.lock and a later revision changes composer.json (for example, bumps one of these exact dev-tool versions), this recipe runs but fails or installs stale versions because Composer still prioritizes the old lock. Composer's install documentation says it reads composer.lock when present and only falls back to composer.json when absent; a newly required package therefore produces “not present in the lock file” instead of making phpcs usable. Regenerate/remove the untracked lock or use the appropriate update operation when composer.json is newer.
Useful? React with 👍 / 👎.
Summary
`phpcs` (and so `make checks`) needs `vendor/` (parallel-lint, phpcs, minus-x), but until now that meant remembering to run `composer install` yourself first — skip it and `make checks` failed with `parallel-lint: not found` instead of a clear error.
`phpcs` now depends on the `vendor/autoload.php` file target, which runs `composer install` whenever it's missing or `composer.json` is newer, so `make checks` works on a fresh checkout without an extra manual step.
Tests
Verified on a clean checkout (`rm -rf vendor composer.lock`): `make checks` now installs automatically and passes. A second run doesn't re-install (vendor/autoload.php is already up to date).
🤖 Generated with Claude Code