-
Notifications
You must be signed in to change notification settings - Fork 657
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
CLI: Arguments checked as file paths #10465
Comments
Can you post the exact command you used to run psalm please? |
I've got the same problem. Console output: $ composer require --dev vimeo/psalm:5.17.0
[...snip...]
$ composer require --dev psalm/plugin-symfony
[...snip...]
$ ./vendor/bin/psalm-plugin enable
Not enough arguments (missing: "pluginName").
enable [-c|--config CONFIG] [--] <pluginName>
$ ./vendor/bin/psalm-plugin enable psalm/plugin-symfony
Cannot locate enable |
|
The problem is that the "psalm-plugin" command was added with symfony, which has its own argv resolution, but then internally will load a psalm config, which then falls back to psalm's own argv resolution, creating this error. The error is then initiated from https://github.com/vimeo/psalm/blob/5.x/src/Psalm/Config.php#L1305, which checks the argv and will create this error subsequently. It's hacky but just wrapping the
should fix the issue. |
Yes, although it now complains about $paths_to_check not being defined ;)
The |
I thought it's obvious that above the "if" you added, you need to add |
Yes it was, I was joking. Sorry :-) |
Exactly the same error, psalm 5.18, symfony 5.4.15 Even calling #10465 (comment) fixed it. Never installed psalm before, and the first thing I have to do is hack it to get it working :-D |
The fix is PRed already since a month #10483, nobody had time to merge & release it yet though |
Hi,
New to psalm, I successfully installed it through composer, generated a config file and run it. But as I tried to enable some plugins (previously installed with composer also), I consistently got this abstruse response :
Cannot locate enable
.I traced the error using echo statements up to the call to
CliUtils::getPathsToCheck(null)
inPsalm/Config.php l. 1305
. Once I commented out that call, the 'enable' command ran to completion without errors. (so 92bcc5c looks like the culprit and the "enable" argument was apparently treated as a file path)I am on linux, using php 8.2.12, composer 2.6.5, psalm 5.17.
Hope that will help.
The text was updated successfully, but these errors were encountered: