-
-
Notifications
You must be signed in to change notification settings - Fork 38
Fix "The provided cwd "../squizlabs/php_codesniffer" does not exist." #245
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I'm very curious why the reported issue only appears to happen with a Drupal setup (and I cannot reproduce it, nor do our tests fail). All the same, I'm hoping this will fix it. Note: yes, `realpath()` can return `false`, but that shouldn't be possible in this case as we only call it after we've already checked `isPHPCodeSnifferInstalled()`.
|
I've updated line 558 in src/plugin.php to *on a fresh install of Drupal 11.x with php 8.3 |
|
Thanks for testing @rpkoller ! That sounds like I've just pushed a new commit to revert this line back to its v1.0 state. Would be great to get confirmation whether that does fix things. |
|
with your latest change to |
|
@jrfnl . Thank you for the PR. That seems to fix the bug. |
|
This new change resolves the issue. I was troubleshooting it in the resolved install paths, and here are the results:
To debug this, I modified the following code accordingly. |
|
Thanks everyone for testing and confirming! We'll get this out in a patch release soon. |
Potherca
left a comment
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.
Merge at will. (I've read #239.)
|
Could we have a release that includes this please? |
|
Side note, not only Drupal setups are affected. My personal dev pc (windows 🤷🏻) and multiple action workflows are failing with exactly the same error. Adding this to the composer.json did the trick for now. "conflict": {
"dealerdirect/phpcodesniffer-composer-installer": "1.1.0"
}, |
|
@MarcHagen Could you please add details about your setup to #239 ? We still haven't been able to pinpoint the underlying cause, so would be great to get more information to see if we can find a pattern. |
Proposed Changes
I'm very curious why the reported issue only appears to happen with a Drupal setup (and I cannot reproduce it, nor do our tests fail). All the same, I'm hoping this will fix it.
Note: yes,
realpath()can returnfalse, but that shouldn't be possible in this case as we only call it after we've already checkedisPHPCodeSnifferInstalled().Related Issues
Fixed #239 (hopefully)