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

PHP loader: use phpstan includes #35

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

gharlan
Copy link
Contributor

@gharlan gharlan commented Feb 12, 2025

Using phpstan includes instead of require improves the cache handling.

At the moment phpstan does not recognize changes in the baseline files (e.g. when removing/comment a baseline entry manually). It only recognizes changes to the loader file.

@janedbal janedbal merged commit 5df79b9 into shipmonk-rnd:master Feb 12, 2025
13 checks passed
@janedbal
Copy link
Member

Thank you!

I also added a test that ensures it truely works in #36

@janedbal
Copy link
Member

Released in 2.1.4

@clxmstaab
Copy link

nice!

@bendavies
Copy link

i'm unsure it it's related to this change or not, but now if I run phpstan in a PR, with baseline errors fixed, I am getting an error for each error that I've removed from the baseline.

Ignored error pattern ... was not matched in reported errors.                                                                                         

i am running it as suggested in the docs with actions/cache

https://github.com/phpstan/phpstan/blob/2.1.x/website/src/user-guide/result-cache.md?plain=1

@bendavies
Copy link

bendavies commented Feb 18, 2025

that said i've only just starting using this library. so another option is that this PR does not work as intended.

@clxmstaab
Copy link

if you don't want this errors you should use reportUnmatchedIgnoredErrors: false

https://phpstan.org/user-guide/ignoring-errors#reporting-unused-ignores

@bendavies
Copy link

bendavies commented Feb 18, 2025

no, the errors have been fixed and removed from the baseline, but phpstan thinks they are in the baseline. so I think this is a cache problem.

@bendavies
Copy link

I've cleared the github actions caches and it's resolved. so i'll see how it goes

@gharlan gharlan deleted the php-loader-includes branch February 18, 2025 15:51
@bendavies
Copy link

unfortunately this issue has reoccurred, every time baseline errors are removed.
I'll try setup a reproducer

@bendavies
Copy link

ignore all this. i worked out the problem. PEBCAK

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

Successfully merging this pull request may close these issues.

4 participants