WordPoints / dev-lib

Developer tools for WordPoints projects
MIT License
4 stars 0 forks source link

phpcs: exclude Squiz.Commenting.LongConditionClosingComment #181

Closed JDGrimes closed 7 years ago

JDGrimes commented 7 years ago

My biggest issue with this sniff that is now included in the WPCS ruleset is that it flags if statements that are long even if there is an else/elseif block that isn't that long before the end. IMO there is no reason to add an // End if(). comment to the closing of the block in such a case, since the presence of the else statement makes it obvious that this is an if statement.

In addition, I don't think that the strict pattern of the comment that the sniff requires is that useful. When you have multiple nested blocks of the same type, you don't know the difference between them from the comments. It would be better if the comments would actually tell more about what the loop/condition is. But this sniff actually makes that impossible.

In the end, it is better to refactor such large blocks anyway, rather than just slapping a comment on the end. So, I'd like to exclude this for now.