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

Drop Psalm in favor of PHPStan #1852

Merged
merged 1 commit into from
Jan 14, 2025
Merged

Drop Psalm in favor of PHPStan #1852

merged 1 commit into from
Jan 14, 2025

Conversation

greg0ire
Copy link
Member

As per the decision we made during the hackathon.
I have left many psalm-suppress annotations that seem informative in the codebase.

@ostrolucky
Copy link
Member

No baseline please. Pick the level project follows. I don't want people getting errors they have to fix every time they touch random file.

@SenseException
Copy link
Member

They would have to write code for the current level while the existing errors in baseline can be fixed over time. It would get harder to reach a higher level when new code bring new errors.

@ostrolucky
Copy link
Member

We could argue about pros and cons of baselines, but let's have that discussion separately. We didn't use baseline with psalm, so let's not add it in PR which claims to just replace psalm.

- src/Command/Proxy/ConvertMappingDoctrineCommand.php
- src/Command/Proxy/EnsureProductionSettingsDoctrineCommand.php
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently, the errors in these 2 files cannot be baselined

@@ -0,0 +1,13 @@
parameters:
level: 8
phpVersion: 80402
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer phpstan to infer the correct version

As per the decision we made during the hackathon.
I have left many psalm-suppress annotations that seem informative in the
codebase.
@greg0ire
Copy link
Member Author

@ostrolucky I agree with @SenseException , but I want you to be happy with how this repo looks like since you're so active in it.

I pushed a version with what you asked… it means we are now at PHPStan level 1 😬

@greg0ire greg0ire added this to the 2.13.2 milestone Jan 14, 2025
@greg0ire greg0ire merged commit ab9334a into doctrine:2.13.x Jan 14, 2025
16 checks passed
@greg0ire greg0ire deleted the phpstan branch January 14, 2025 07:54
@@ -0,0 +1,9 @@
parameters:
level: 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is way too low compared to on what level Psalm ran.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah :( I will try to increase it slowly. Psalm was running on high level because of carefully crafted suppression rules, somebody has to put in the work to make them for phpstan. I've already run into phpstan/phpstan#12414 (this is the kind of things baselines hide)

I'll make it to lvl2 today. Let me know if you would be interested in help to update it to some other lvl.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll have a look, but I won't be able to start right away. A temporary baseline would've been good in order to not lose coverage and track the progress.

@Guuzen
Copy link

Guuzen commented Jan 17, 2025

As per the decision we made during the hackathon

Could you (or anyone else) explain the reasons why you decided to make such a replacement?

@stof
Copy link
Member

stof commented Jan 17, 2025

@Guuzen see doctrine/.github#50 (comment)

@stof
Copy link
Member

stof commented Jan 17, 2025

Note that previously, most other Doctrine packages were running both tools, not just Psalm. This means that the first reason does not apply to this repo specifically, but consistency in tooling in the organization also helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants