-
Notifications
You must be signed in to change notification settings - Fork 19
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
Consider disallowing use of use function...
#158
Comments
As a note, I've added this as a request for a custom sniff here: PHPCSStandards/PHPCSExtra#1 |
Upstream looks complete here, and +1 on the rule itself. |
I'm -1 on the enforcement of this rule. I think the guidance we have "should be avoided." is enough. I find the rational for avoiding weak, but ok to recommend. Outright disallowing it I think is too far. This will invalidate a good amount of code that has already been written, that doesn't cause problems, whereby proceeding with this will cause uneccesary churn on existing code. |
According to Sourcegraph we have about 1200 instances of this right now. 400 of those alone are in one project, followed by about 200 in another client's projects (namely in the shared workflow repo). That's not terrible, but it's not nothing either. But I am strongly against "should be avoided" rules generally; it should be binary, otherwise there's no real point having the rule. |
How difficult would be a |
I think there's two paths forward for this rule for projects:
Filtering Sourcegraph by active clients only, I can only identify 3 clients who are using this:
The non-active clients who have this rule all have less than 60 instances with all but one having less than 40. I don't think code churn is a big problem at that rate. |
In line with https://github.com/humanmade/Engineering/pull/143, I propose that we add a rule dis-allowing the use of
use function
.As noted by Joe in https://github.com/humanmade/Engineering/pull/143#issuecomment-560330827, this will break linting for several current projects. I personally feel that this is worth it as the rule can be ignored on current projects and it will enforce properly on all new projects.
The text was updated successfully, but these errors were encountered: