Skip to content
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

Rulesets: move VariableAnalysis configuration from Go to Minimum #763

Merged
merged 1 commit into from
Aug 23, 2023

Conversation

jrfnl
Copy link
Collaborator

@jrfnl jrfnl commented Aug 22, 2023

While looking into #588, I noticed something which seemed odd, so I'm addressing this with this PR.

The configuration which was added in #690 (and addressed #588) was added to the WordPress-VIP-Go ruleset, not the WordPressVIPMinimum ruleset from which the WordPress-VIP-Go ruleset inherits.

I can not think of any pertinent reason why the configuration should be added for one, but not the other and I couldn't find any discussion on this either, so I propose moving the configuration from the WordPress-VIP-Go ruleset to the WordPressVIPMinimum ruleset.

Ref: https://github.com/sirbrillig/phpcs-variable-analysis/releases/tag/v2.9.0

While looking into 588, I noticed something which seemed odd, so I'm addressing this with this PR.

The configuration which was added in 690 (and addressed 588) was added to the `WordPress-VIP-Go` ruleset, not the `WordPressVIPMinimum` ruleset from which the `WordPress-VIP-Go` ruleset inherits.

I can not think of any pertinent reason why the configuration should be added for one, but not the other and I couldn't find any discussion on this either, so I propose moving the configuration from the `WordPress-VIP-Go` ruleset to the `WordPressVIPMinimum` ruleset.

Ref: https://github.com/sirbrillig/phpcs-variable-analysis/releases/tag/v2.9.0
@jrfnl jrfnl added this to the 2.3.4 milestone Aug 22, 2023
@jrfnl jrfnl requested a review from a team as a code owner August 22, 2023 23:17
@GaryJones
Copy link
Contributor

Nobody should be using WordPressVIPMinimum standard at all, so putting it in the WordPress-VIP-Go just made it a little more visible to users who looked at the ruleset file (though the full picture does need both ruleset files).

What advantage does having it in the WordPressVIPMinimum give?

If the name of the WordPress-VIP-Go ruleset didn't change for 4.x, then the plan would be to move everything from WordPressVIPMinimum into the newer ruleset, and then eliminate obvious immediate overrides.

@jrfnl
Copy link
Collaborator Author

jrfnl commented Aug 23, 2023

Nobody should be using WordPressVIPMinimum standard at all, so putting it in the WordPress-VIP-Go just made it a little more visible to users who looked at the ruleset file (though the full picture does need both ruleset files).

What advantage does having it in the WordPressVIPMinimum give?

Well, some plugin devs may be (= are) using VIPCS outside of the VIP CI context, for those, it maybe useful.

Also, if you look at the rulesets, Minimum basically contains the majority of the "base" config, while Go builds on top of that and customizes.
As this is "base" config, it just feels like something which belongs in Minimum, not necessarily Go (other than if Go would add/change the config).

If the name of the WordPress-VIP-Go ruleset didn't change for 4.x, then the plan would be to move everything from WordPressVIPMinimum into the newer ruleset, and then eliminate obvious immediate overrides.

WordPress-VIP-Go is not a name for a standard which can contain sniffs (as it contains - dashes, which can't be used in a namespace).

If I remember correctly, a potential ruleset reorganisation is being discussedin #600. Probably best to keep the discussion in that issue. I've moved the ticket to the 4.x milestone now for higher visibility/findability.

@GaryJones
Copy link
Contributor

Well, some plugin devs may be (= are) using VIPCS outside of the VIP CI context, for those, it maybe useful.

Even if they are, they should still be using the WordPress-VIP-Go.

In this case, the changes for the variable analysis config is far more targeted to theme developers.

Copy link
Contributor

@GaryJones GaryJones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GaryJones GaryJones merged commit 3320ef7 into develop Aug 23, 2023
32 checks passed
@GaryJones GaryJones deleted the fix/588-variableanalysis-improve-config branch August 23, 2023 19:55
@jrfnl
Copy link
Collaborator Author

jrfnl commented Aug 23, 2023

In this case, the changes for the variable analysis config is far more targeted to theme developers.

Good point. Either way, this change doesn't do any harm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants