-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
Better type inference, improved test coverage throughout locked dependencies, automated dependency upgrades #59
Better type inference, improved test coverage throughout locked dependencies, automated dependency upgrades #59
Conversation
Note: mutation tests fail because of no actual source diff in the patch. Everything is done in:
|
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.
Looking nice, thank you!
I'd like some explanation on the Dependabot thing, I often saw it on popular repos but I'm not sure how it works. 😅
Also, I try to keep using conventional commits for this repo (for consistency mainly). What would be your advice for this kind of PR where fixup commits were made? Should I squash it with a correct title/description when submitting the PR?
It will, once a week, look for new dependencies, It will also rebase any PRs it currently has open, should
I can squash out some commits, but no idea about what the actual commits here should be then? I keep them very much human-friendly, rather than "changed X", so if you want specific messages, please do tell.
Fixup commits will be squashed from my end, after review is through. |
Note: instead of a51f8c5 , I will rebase this patch post-review. Merges of mainline into feature branches are really to be avoided (in pretty much every environment), and are a much bigger problem than conventional commits ;-) |
This is probably because I have a diff in |
The commits names are good, but what is missing is a correct prefix — see conventional commits. This allows me to use marcocesarato/php-conventional-changelog for the changelog automatic generation.
Right, I usually use rebase strategies on my own branches, but I was not sure if that would fit on a PR managed by someone else. Learning basic OSS contribution rules here :D
Ah! Right, must be that. Any idea how we could fix it, or avoid this case? |
…gle templated type This also brings `TreeMapper#map()` closer to PHPStorm support, whilst still benefiting from more precise `vimeo/psalm:4.18.x` types thanks to the conditional return specification. Ref: CuyZ#59 (comment)
a51f8c5
to
0bf2a13
Compare
… a single templated type This also brings `TreeMapper#map()` closer to PHPStorm support, whilst still benefiting from more precise `vimeo/psalm:4.18.x` types thanks to the conditional return specification. Ref: CuyZ#59 (comment)
0bf2a13
to
7da6756
Compare
Rebased and added prefixes 💪
Understandable: most people probably roll their eyes when I ask them for a rebase, but I do
This is potentially a bug in |
… a single templated type This also brings `TreeMapper#map()` closer to PHPStorm support, whilst still benefiting from more precise `vimeo/psalm:4.18.x` types thanks to the conditional return specification. Ref: CuyZ#59 (comment)
7da6756
to
ea6e56b
Compare
… a single templated type This also brings `TreeMapper#map()` closer to PHPStorm support, whilst still benefiting from more precise `vimeo/psalm:4.18.x` types thanks to the conditional return specification. Ref: CuyZ#59 (comment)
ea6e56b
to
915fbb2
Compare
This also uses `ramsey/composer-install@v2` to cache dependencies, instead of having to set up the automation on our own with `actions/cache` (messy).
Used for locked tests.
This is mostly to include type inference in regression tests: out-of-the box type inference for 99% of usages is based on `TreeMapper#map(class-string<T>, mixed): T`, and it is worth preserving that behavior without the need of plugins. This test covers that.
This also brings `TreeMapper#map()` closer to PHPStorm support, whilst still benefiting from more precise `vimeo/psalm:4.18.x` types thanks to the conditional return specification. Ref: CuyZ#59 (comment)
915fbb2
to
312588b
Compare
Just though I could easily reword the commits to fit the requirements I was writing about earlier — the sense doesn't change, it just fits the 72 chars threshold. Hope you don't mind? I'm not sure if that can seem rude. 😬 Anyway, thanks a lot for the contribution @Ocramius! |
@Ocramius I'm not sure whether I should enable "Dependabot security updates" in the repository settings? |
Thanks @romm! Enabling security updates shouldn't be necessary: weekly updates are enough for a library |
This patch is mostly raised by the upgrade of
0.3.0
to0.4.0
breaking BC (expected, but preventable).In practice, Valinor is probably going to be used because of
TreeMapper#map(class-string<T>, mixed): T
in the grand majority of cases.To cover this scenario, and prevent regressions, I introduced:
cuyz/valinor
as they come upvimeo/psalm
type inference testingTreeMapper#map()
, so that it works without couplingcuyz/valinor
to a specificvimeo/psalm
version (the type declarations for the majority scenario are in the code, without any need for plugins)