Skip to content

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

@oojacoboo

Description

@oojacoboo

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions