-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Add configs for strict PHP checks #56522
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: provokateurin <[email protected]>
Signed-off-by: provokateurin <[email protected]>
e999f74 to
ff59e13
Compare
CarlSchwan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For psalm, I am still a bit more in favor or increasing the level and add more stuff to the baseline. This has a bit of the same effect. New code has higher quality requirements, old code has know defect we can slowly get rid of with time.
I feel like for new files, we will always forgot to add them to the list of new files.
I get your point, but we can't just set the level to 1 right now, as it would explode the baseline size. So for new code, it's much easier to have a separate config.
That is probably true, but for example in my case I want to add whole a new app and it would be really useful to just have it all clean and tidy from the start, even if it's only used for that one app. |
| deadCode: true, | ||
| codeQuality: true, | ||
| codingStyle: true, | ||
| typeDeclarations: true, | ||
| typeDeclarationDocblocks: true, | ||
| privatization: true, | ||
| instanceOf: true, | ||
| earlyReturn: true, | ||
| rectorPreset: true, | ||
| phpunitCodeQuality: true, | ||
| doctrineCodeQuality: true, | ||
| symfonyCodeQuality: true, | ||
| symfonyConfigs: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m uneasy about using rector for code style like this because it has no ignore mechanism so we’re screwed on any false-positive, no?
Also, this PR adds rector-strict.php but only runs it on itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this PR adds rector-strict.php but only runs it on itself?
Yes, because rector will complain if you run it without any files, so it's just meant as a placeholder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! Can you explain that in a comment? 😆
This is meant for new files in order to have top quality from the start. Of course it can also be used for existing files, but they should go through the normal psalm/rector configs first.