-
Notifications
You must be signed in to change notification settings - Fork 1
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
More comprehensive standard #12
Comments
A quick first check ... we might need to exclude some more rules. Some examples:
And false positives with very Squiz-y rules like:
So, I ran the new setup on a module I maintain, which causes no errors with current ruleset (1.0.0-beta1).
Whoah, that's a big, big change in behavior. Not sure, if we should do that. |
Yes. I ran it myself and found some more false positives. Not sure why they didn't come up before... I'll update the PR.
Not sure what you mean by this. What sniff/message was this referring to?
I'm not sure I understand your reasoning here... If there are too many issues in code then we shouldn't add those checks to this repo? I thought this repo was meant to ensure compliance with our coding standards. If code isn't compliant, that's no reason not to include these checks, right? Yes I understand we don't want false positives (we'll fix those by excluding the relevant sniffs), but if the remaining sniffs are legitimate and end up flagging a bunch of issues, that's a good thing. |
My reasoning here: We should avoid to introduce such huge changes in behaviour in a "minor" update. At first I started with a ruleset that's very similar to what the ruleset currently included in coder_review (for an outdated phpcs version) provides. To later add more strict restrictions step by step. Many of the nagging with the current PR isn't part of our currently documented coding standards at all. If we suggest to switch from a beta1 to a (for example) beta2 ruleset, the difference should be manageable in real usage. However, I don't object here, I just wouldn't recommend that change size. |
Our custom Backdrop standard currently imports certain sniffs from other standards, as well as adding our own sniffs. However I believe a more comprehensive solution would be to include the full, third-party standards, and then exclude certain sniffs that don't meet our needs.
To copy my explanation from #8:
I [...] decided to try building a standard from scratch to see what sniffs we needed and which we didn't. Here's what I've spent some time over the last few weeks doing:
This eventually helped me to come up with a list of good and bad sniffs.
Of the ~119 sniff messages in the Generic standard, I excluded ~55 bad ones.
Of the ~323 sniff messages in the Squiz standard (that weren't already included in the Generic standard), I excluded ~92 bad ones.
So as you can see, it seems to be better to include the full Generic and Squiz standards, [than to] exclude specific sniffs/messages that don't match our coding standards (rather than just including specific sniffs as we do now).
The text was updated successfully, but these errors were encountered: