-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Missing support for psalm/phar
#301
Comments
Evidently, |
Isn't https://github.com/laminas/laminas-ci-matrix-action/blob/v1.25/src/tools.ts Both Psalm and the application need to be improved to resolve this issue. |
It is, that is due to the fact that the CI implementation does only support psalm installed via composer as I already reported that in psalm/phar#14 2 years ago and thus, for now, we do not support custom psalm config path. Feel free to provide a PR where the XSD path for psalm can be modified but that would require you to have the XSD file somewhere available. I guess that this is not available from within |
psalm/phar
@zonuexe good shout, sorry for jumping to conclusions! |
I moved this issue to the CI matrix action as it has to be implemented here. Until then, to make your CI work, you could add your own I still have #184 pending, I could extend that to allow excluding tools as well. 🤔 |
@boesing I'm thinking that we should perhaps honor the XSD location, when specified as a local path: WDYT? |
@Ocramius you mean extracting from psalm.xml? |
Or generally any XML: we currently use hardcoded locations, but the locations are in the individual XML diles already, when done right 👍 |
the hardcoded location is used as that is known from psalm. but I am up for extracting the location from the config file - but usually there is no actual path located in XML files. I see either just namespaces and/or URI targeting external files via https. Even phpunit generated config is targeting remote XSD. I do not really want to implement a whole XSD detection strategy just for a niche use-case. we do not support psalm.xml in any other location than project root as well so I wanted to keep it simple. From what I can see, having a config option would probably work best (config is available where we do create the Tool job) but extracting stuff from XML might open a can of worms. but maybe I think too complicated? |
This is fair 👍 |
I created psalm/phar#18 to request Maybe something like this? {
"...": {},
"tools": {
"psalm": {
"config": "pathToAlternativePsalm.xml",
"schema": "pathToConfigSchemaDefinition.xsd"
}
}
} We do already have quirks for infection where we detect laminas-ci-matrix-action/src/tools.ts Lines 40 to 46 in f25365c
I would assume that we have something like this in-place for the Also created a patch in psalm to have the |
Just to have my 2 cents dropped here regarding the usage of Thats why I ended up keeping |
psalm/phar is important for michaelpetri/phpunit-consecutive-arguments because psalm is not compatible with PHP-Parser 5 and PHPUnit 11 until they release Psalm v6. refs vimeo/psalm#10567, vimeo/psalm#10788 and vimeo/psalm#10888 |
I released v1.26.0 for the matrix action, you can - until we found a better solution - use Something like this is the repository you are mentioning could be implemented as {
"additional_checks": [
{
"name": "Static Code Analysis via psalm.phar",
"job": {
"command": "./vendor/bin/psalm"
"php": "@lowest",
"dependencies": "locked"
}
}
],
"exclude": [
{"name": "Psalm"}
]
} (I think the path is wrong so that would be another thing to consider when providing a patch for the alternative XSD path 😅) Btw. I've read about your example regarding the extraction of the |
Bug Report
Summary
When Psalm is installed using
psalm/phar
instead ofvimeo/psalm
, an error occurs becausevendor/vimeo/psalm/config.xsd
does not exist.refs #31, psalm/phar#5
Current behavior
How to reproduce
In a project where
psalm.xml
exists, replacingvimeo/psalm
withpsalm/phar
will reproduce the problem.michaelpetri/phpunit-consecutive-arguments#109
Expected behavior
No errors.
The text was updated successfully, but these errors were encountered: