Skip to content
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

PHPCS: Searched for shim - couldn't be found within $PATH #34

Open
oojacoboo opened this issue Jun 24, 2023 · 1 comment
Open

PHPCS: Searched for shim - couldn't be found within $PATH #34

oojacoboo opened this issue Jun 24, 2023 · 1 comment

Comments

@oojacoboo
Copy link

oojacoboo commented Jun 24, 2023

PHPCS Version: 3.7.2 (stable)

Searched for any of /Users/jacob/.vscode-insiders/extensions/fnando.linter-0.0.19/shims/phpcs-shim; couldn't be found within $PATH

It then goes on to print my $PATH, which includes all the proper paths, including the one to the phpcs script.

It's worth mentioning that I don't think this error message is particularly helpful or accurate.

I tried debugged the phpcs-shim. I get an exit code of 127 from the phpcs call.

I then tried replicating the command using phpcs directly. However, I discovered that it's hanging with using STDIN. Passing the file as the last argument seems to work, without using STDIN, using phpcs directly.

phpcs --report=json --standard=/path/to/phpcs.xml /path/to/file.php -q

I then tried modifying the /Users/jacob/.vscode-insiders/extensions/fnando.linter-0.0.19/shims/phpcs-shim arguments to match the successful command from phpcs. I'm able to get the command array to print what seems to be the correct arguments, but I suspect the shim isn't written to handle the file being at the end of the command, without a flag.

  "command": [
    "/Users/jacob/.vscode-insiders/extensions/fnando.linter-0.0.19/shims/phpcs-shim",
    "--report",
    "json",
    "--standard",
    "/path/to/phpcs.xml",
    "/path/to/file.php",
    "-q"
  ]

At this point, maybe that shim can be rewritten to process the /path/to/file.php without a flag. But, I don't want to go down that path if there is something else going on here that I'm overlooking.

Any ideas?

@oojacoboo oojacoboo changed the title Searched for shim - couldn't be found within $PATH PHPCS: Searched for shim - couldn't be found within $PATH Jun 24, 2023
@z0mbieparade
Copy link

Getting the same error, any more info on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants