-
Notifications
You must be signed in to change notification settings - Fork 156
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
Updated sniff to allow automatic fixing #204
base: develop
Are you sure you want to change the base?
Conversation
…standard into feature/comment_fixer
@cjnewbs thank you for the pull request. Can you please describe use cases / tests cases for this functionality in the description |
@sivaschenko, |
Totally forgot I PR'd this. I'll try summarise test/use cases and see if i can figure out how to write a test for it. |
So I have taken some time to figure out how to write "fixer tests" and it looks like That has resulted in some unexpected behaviour however. Using this document as the "source of truth" document https://devdocs.magento.com/guides/v2.4/coding-standards/docblock-standard-general.html I would say that the docblock here https://github.com/magento/magento-coding-standard/blob/develop/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc#L40 is probably not in-line with the coding standards?
Based on the rule "Classes and interfaces should have a short description with a human-readable description of the class. If the short description adds no additional information beyond what the type name already supplies, the short description must be omitted." this would mean the text Is anyone able to confirm if my reasoning/understanding on this is correct? If this is the case then within this PR I will need to modify For the moment I have added a new test file that I will need to tweak based on the outcome of this query. Any pointers here would be appreciated here. 🙂 |
@cjnewbs I believe your understanding is correct. Here are my thoughts:
Ideally should be:
However, this should also be correct:
|
I also think your 2 examples are valid. I will next:
|
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.
Hi @cjnewbs,
Do you have any updates about this PR?
Summary
phpcs
allows the sniff to provide the ability to auto-fix usingphpcbf
. These are 2 that come up a lot for me as PhpStorm has them as an automatic comment autocomplete thing,Sorry if I have done this the wrong way I have not contributed before 🙂