-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Automated fixes with phpcbf + manual fixes #8144
Conversation
a6c523c
to
480dcaf
Compare
If you do it at once, maybe it's better to add more strict arrays than |
It's better for sure, but that would be a lot of work (there are 180 additions of |
Since this goes into 2.7 i really prefer not do much more work on details. It should be as sage as possible. I think allowing array is fine, we will catch these things in manual review steps for new code that is added. |
The way how Symfony made such massive changes work without fucking up their merge ups is that they merged it to lowest branch (like you are doing), then merging it up, but here is important part: in conflict resolution phase, all conflicting files are reverted. Then, same process is applied for for upper branches. This way, no manual conflict resolution need to be done. It's better explained here symfony/symfony#29623 (comment) However, in ORM we are (unfortunately) doing rebases of master, not merges and I'm not sure how would that look like there. Since @guilhermeblanco is taking care of 3.x, I am not comfortable approving this without his opinion. |
For reference, out of 1097 changed files, here are how many files conflict when merging to 2.8.x :
For I think getting @guilhermeblanco 's review is indeed very important on this one, let's wait for it. |
@beberlei ok so if I understand correctly, you suggest dropping the third commit? Works for me. The main goal of the PR is to have |
This would be really cool. Working on #8210 triggered dozens of errors in CI, there's so much changes unrelated to the actual PR that the diff won't really be useful at this point. |
@orklah we've decided to wait until @guilhermeblanco manages to merge up 2.8.x into master before going on with this. |
Any news since then? |
1f9d321
to
781230d
Compare
@Version is commonly used for svn ids and is forbidden
Tests do not pass when I format that phpdoc nicely.
It's not supported by PHP 7.2/7.3
That release comes with a fix for a bug that affects us since we are using return type declarations for wakeUp() in proxyfied classes in on of our tests.
This comment has been minimized.
This comment has been minimized.
This is now ready for review. Ironically, the only check that does not pass is the CS one, since running In case you are wondering how many cs issues are left:
I might look into automated way of fixing some of those later, but I think there is already great value in this PR as is, since it allows contributors to run |
__CG__ is a file prefix, not a directory
Blocked by #8150I often tell people to run
vendor/bin/phpcbf
to fix their PRs, by habit,which sometimes results in confusion because it produces a huge unwanted diff.
Also, and this is key, this reduces greatly the diff between branches, which should mean far fewer conflicts when merging up, or when rebasing between 2.7. and 2.8, so maybe this will make @guilhermeblanco 's work easier as per https://github.com/orgs/doctrine/teams/doctrinecore/discussions/14 . Once this is merged, I think we should vow never to change the CS config unless we do it from the lowest branch and merge up.
There are still a lot of cs issues that need to be fixed before we can switch from git-phpcs to just phpcs.
The rules that required the most work are rules about specifying the types of elements instead of just specifying
array
. I thought that we could ignore it, but then that would mean that it wouldn't be required for new code, which would be bad, so I tried to describe it when I could figure out easily and fast enough, and in other cases, I just usedmixed[]
. These kind of changes are in the third commit, and if you are unhappy with that, I can drop that commit that has manual fixes. That will still leave us with avendor/bin/phpcbf
that runs without errors.Next steps, before merging this: creating merge up PRs, so that they can be pushed atomically all at once. That way we have no unknowns about the merge up and how hard they are. I gave merging into 2.8.x a quick try and there are not that many files conflicting.
I still would like a review, or at least comments about the above plan before going ahead, because this took me a lot of time, so I'd like to have everyone on board before I invest even more time on this.