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

Configure "SlevomatCodingStandard.Commenting.AnnotationName" rule #311

Merged
merged 1 commit into from Apr 23, 2023

Conversation

@phansys phansys marked this pull request as ready for review April 21, 2023 16:56
@phansys phansys requested a review from a team as a code owner April 21, 2023 16:56
greg0ire
greg0ire previously approved these changes Apr 21, 2023
@@ -181,6 +181,8 @@
<rule ref="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming"/>
<!-- Forbid suffix "Trait" for traits -->
<rule ref="SlevomatCodingStandard.Classes.SuperfluousTraitNaming"/>
<!-- Forbid "@inheritdoc" in favor of "@inheritDoc" annotation -->
Copy link
Contributor

Choose a reason for hiding this comment

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

Btw the sniff checks a lot more annotations :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, of course. But it was added here just for @inheritDoc.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, but the comment is not true because the sniff is not configured to solve just “inheritDoc”

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's right. I guess I can improve it.

@phansys phansys marked this pull request as draft April 21, 2023 17:19
@phansys phansys force-pushed the inheritdoc branch 3 times, most recently from dbf3eca to 0c4f8fd Compare April 21, 2023 18:30
@phansys
Copy link
Contributor Author

phansys commented Apr 21, 2023

I can not manage the test suite to have a green build. Do you know what is the issue? There seems that @inheritdoc is completely removed here: https://github.com/doctrine/coding-standard/pull/311/checks#step:6:77.

@greg0ire
Copy link
Member

You have to update the patch files, it's notoriously hard. I've documented how to do so here: https://www.doctrine-project.org/projects/doctrine-coding-standard/en/11.0/reference/index.html#testing

@phansys
Copy link
Contributor Author

phansys commented Apr 21, 2023

You have to update the patch files, it's notoriously hard. I've documented how to do so here: https://www.doctrine-project.org/projects/doctrine-coding-standard/en/11.0/reference/index.html#testing

I followed these docs, but as these processes were failing, I thought it was part of the same issue:

make update-compatibility-patch-80
error: patch failed: tests/expected_report.txt:52
error: tests/expected_report.txt: patch does not apply
make: *** [Makefile:33: update-compatibility-patch-80] Error 1

@greg0ire
Copy link
Member

Yes. Here, you are trying to apply a patch on expected_report, which you touched. I think you can edit the patch to remove the part about the expected_report.txt, edit phpcs.xml.dist to set the php version to 80000

then run vendor/bin/phpcs $(find tests/input/* | sort) --report=summary --report-file=tests/expected_report.txt

Then you press y to indicate you're done with the changes.

Hopefully there is an easier way but that's how I do it. @simPod , maybe you know of a simpler way?

@phansys

This comment was marked as resolved.

@greg0ire

This comment was marked as resolved.

@phansys phansys force-pushed the inheritdoc branch 7 times, most recently from a270f63 to 8aaef07 Compare April 22, 2023 21:40
@greg0ire
Copy link
Member

greg0ire commented Apr 22, 2023

I see you're making progress, and that's great, but I think you should make sure the 8.1 build passes before working on the 8.0 build, because it might involve touching expected_report.txt, and then you will have to touch the patch files again because of that.

@phansys
Copy link
Contributor Author

phansys commented Apr 22, 2023

Thank you so much for the hints.

@phansys phansys force-pushed the inheritdoc branch 4 times, most recently from e0fc157 to f15f2e4 Compare April 22, 2023 23:16
@phansys phansys force-pushed the inheritdoc branch 4 times, most recently from e9958e1 to 6f5fcfd Compare April 22, 2023 23:57
@phansys phansys changed the title Forbid "@inheritdoc" in favor of "@inheritDoc" annotation Configure "SlevomatCodingStandard.Commenting.AnnotationName" rule Apr 23, 2023
@phansys phansys marked this pull request as ready for review April 23, 2023 20:10
@greg0ire greg0ire merged commit db39894 into doctrine:11.1.x Apr 23, 2023
12 checks passed
@greg0ire greg0ire added this to the 11.1.1 milestone Apr 23, 2023
@phansys phansys deleted the inheritdoc branch April 23, 2023 20:36
@greg0ire
Copy link
Member

Every time I merge something on this repo, I notice it is on the wrong branch right after merging 🤦‍♂️

@greg0ire
Copy link
Member

Let's use the same solution as every time: I'll merge this up into 12.0.0, and then release it, that way there won't be a new 11.x

Anyway, thanks for the new contribution @phansys and congrats on managing this green build 👍

@phansys
Copy link
Contributor Author

phansys commented Apr 23, 2023

Which branch should I have used as target?

@greg0ire
Copy link
Member

I documented the process here: https://www.doctrine-project.org/projects/doctrine-coding-standard/en/11.0/reference/index.html#versioning

It's not quite the same as a regular library. Don't worry though, it won't be hard to fix :)

@greg0ire
Copy link
Member

it won't be hard to fix

Actually, merging up is going to be quite hard, since I introduced another rule on 12.0.x. Let me try.

@phansys
Copy link
Contributor Author

phansys commented Apr 23, 2023

Anyway, thanks for the new contribution @phansys and congrats on managing this green build +1

I gave up about the patch updates in my environment because setting the testVersion option at phpcs.xml.dist was not enough to have the proper changes for each PHP version; so, instead of pulling different images on my environment I've opted by dump the required changes in the CI pipeline.

Actually, merging up is going to be quite hard, since I introduced another rule on 12.0.x. Let me try.

There is no problem. Let me know if you prefer a new PR against 12.0.x. as now I can reproduce the steps that I've used for this PR.

@greg0ire
Copy link
Member

If you feel like up to doing the merge up, that would be awesome! I don't remember if you did them with Sonata, but here it's the same method:

git fetch --all
git switch 12.0.x
git merge doctrine/11.1.x
# fix conflicts
git push fork 12.0.x

And then you do a pull request.

@phansys
Copy link
Contributor Author

phansys commented Apr 23, 2023

Sure. Let me try 👍

@phansys
Copy link
Contributor Author

phansys commented Apr 23, 2023

Here is the PR merging 11.1.x into 12.0.x: #314.

@greg0ire greg0ire modified the milestones: 11.1.1, 12.0.0 Apr 24, 2023
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.

None yet

5 participants