-
-
Notifications
You must be signed in to change notification settings - Fork 488
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
OneObjectStructurePerFile: move from Extra
to Core
#1802
Conversation
I'd say leave it as an error. I think the proposed message for Core is friendlier than the default upstream. |
9ed06a8
to
bc61afb
Compare
I've updated the PR to leave the message at an This rule still needs to be added to the WP/Core CS Handbook. Any volunteers ? /cc @pento |
I'd merge this after the handbook is updated, is this ok? |
bc61afb
to
6573b97
Compare
6573b97
to
30cb490
Compare
Per the discussion had on Slack about this initiated by GaryJones. WP Core currently has 27 violations against this rule. In `Extra` the error message was changed and downgraded to a `warning`. Now the sniff will be added to `Core`, per this PR, the: * Message text will still be changed a little to be clearer, but will be stricter. * The message will be an `error` and not be downgraded to a `warning`. To do: - [ ] Add a rule to this effect to the handbook.
30cb490
to
88c5608
Compare
Rebased to have the GH Actions checks run. |
This addition will allow WordPress/WordPress-Coding-Standards#1802 to be merged to the coding standards. This will encourage having one class/interface/trait per file.
I've opened a PR for the handbook, so once that is merged we can merge this PR as well. |
* Adding one object structure per file This addition will allow WordPress/WordPress-Coding-Standards#1802 to be merged to the coding standards. This will encourage having one class/interface/trait per file.
* Adding one object structure per file This addition will allow WordPress/WordPress-Coding-Standards#1802 to be merged to the coding standards. This will encourage having one class/interface/trait per file.
* Adding one object structure per file This addition will allow WordPress/WordPress-Coding-Standards#1802 to be merged to the coding standards. This will encourage having one class/interface/trait per file.
Pulling this after @GaryJones brought this up as a suggestion on Slack.
WP Core currently has 27 violations against this rule - 3 in
src
, the rest intests
.All the same, it would be a good thing to move this sniff to the
Core
ruleset. /cc @pentoOpen questions:
Extra
configuration downgraded this to awarning
. Should this be anerror
or awarning
now it's moving toCore
?Extra
configuration also adjusted the error message. Is this still necessary or should we just use the default message from the sniff ?Only one object structure is allowed in a file
.Extra
Best practice suggestion: Declare only one class/interface/trait in a file.
Core
Best practices: Declare only one class/interface/trait in a file.
To do before this can be merged:
Core
ruleset to place the sniff in the right place with the text from the handbook.