-
Notifications
You must be signed in to change notification settings - Fork 160
Implement rule from #107 #116
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
Implement rule from #107 #116
Conversation
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.
@udovicic thank you for the contribution, it will be great improvement! I have few comments:
- Please use strict comparison.
- The rule says:
Constants must have short description if they add information beyond what the constant name supplies.
Suggest adding check for comments that do not add additional info.
Should raise the warning:
/**
* Nesting separator.
*/
const NESTING_SEPARATOR = '->';
/**
*
*/
const NUMBER_TWO = 2;
Same for define.
Should not raise the warning:
const NESTING_SEPARATOR = '->';
/**
* Some great explanation here.
*/
const NUMBER_TWO = 2;
Hi @lenaorobei , Suggestions about strict checks are accepted, let me know if you want them squashed. About the part:
That is not what the cited devdocs say. There it is defined as implemented in this rule:
|
Here is the open PR to the Magento DevDocs magento/devdocs#4425 in order to change this statement. |
Makes sense, I will update as soon as I can. |
One more thing I didn't notice yesterday. Could you please move this rule to the different namespace, for example |
8ce4351
to
8c154ae
Compare
Hi @lenaorobei , Code has been refactored to comply with the examples provided, unit tests have been adjusted accordingly and the name space has been changed to |
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 thanks for your contributions looks nice currently we can not add new rules to the repo because of versioning rules it can take some time before it will be merged.
This is an adding new rule, so it will be the part of the next major release.
I need to suspend the processing of current PR since the versioning strategy is not clear yet magento/architecture#136
Magento2/Tests/Commenting/ConstantsPHPDocFormattingUnitTest.php
Outdated
Show resolved
Hide resolved
8c154ae
to
2cb805a
Compare
- added strict comparison - changed sequence in the ruleset.xml
@udovicic thank you for this awesome contribution! 🚀 |
Develop to Master Version 15
In compliance with devdocs, rule will check if all occurrences of
define()
andconst
have dock block in front of them.As #107 suggest, it will emit warning with severity 5.