`psalm --version` fails on Composer projects without any autoloaders
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
Research direction
Start by tracing the CLI handling for --version and the composer autoloader discovery that produces the reported error. Confirm the change by running psalm --version in a directory with composer.json but no vendor/autoloader.php; it should print the Psalm version without requiring an autoloader.
Written by the indexing model from the issue text.
Description
If I run psalm --version in a directory that contains a composer.json, but without a respective vendor/autoloader.php, Psalm will spit out an error. A workaround seems to be to run psalm --version within a fresh directory. For example:
repo$ psalm --version
Could not find any composer autoloaders in /repo
Add a --root=[your/project/directory] flag to specify a particular project to run Psalm on.
repo$ cd $(mktemp -d)
tmp.YQhKg9ZiiV$ psalm --version
Psalm 5.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0
I understand why Psalm can't work without autoloaders, but --version should not be subject to this restriction.
- Dominant language
- PHP
- Stars
- 5.9k
- Forks
- 708
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 25
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vimeo/psalm
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
[regression] StatementsAnalyzer::$depth dynamic-property deprecation crash on PHP 8.2+ (master) Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Similar issues
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nextcloud/fulltextsearch#1011 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
phpstan/phpstan-doctrine#794 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Automattic/static-site-importer#1767 ·