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

WordPress ruleset: efficiency fix #1758

Merged
merged 1 commit into from Jul 5, 2019

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Jul 4, 2019

Rulesets are processed top-to-bottom, one rule at the time.

For the WordPress ruleset, this means that PHPCS would first load the WordPress-Core ruleset and process all rules in that file, then read the WordPress-Docs ruleset and lastly, the WordPress-Extra ruleset.

As the WordPress-Extra ruleset includes WordPress-Core, it would re-process the WordPress-Core ruleset a second time and then process the additional rules in the Extra ruleset.

This means that in effect, the WordPress-Core ruleset is processed twice when using the WordPress ruleset which is inefficient.

By commenting that rule out, we still document that the WordPress ruleset includes WordPress-Core without double processing the ruleset.

Rulesets are processed top-to-bottom, one rule at the time.

For the `WordPress` ruleset, this means that PHPCS would first load the `WordPress-Core` ruleset and process all rules in that file, then read the `WordPress-Docs` ruleset and lastly, the `WordPress-Extra` ruleset.

As the `WordPress-Extra` ruleset includes `WordPress-Core`, it would re-process the `WordPress-Core` ruleset a second time and then process the additional rules in the `Extra` ruleset.

This means that in effect, the `WordPress-Core` ruleset is processed twice when using the `WordPress` ruleset which is inefficient.

By commenting that rule out, we still document that the `WordPress` ruleset includes `WordPress-Core` without double processing the ruleset.
@jrfnl
Copy link
Member Author

jrfnl commented Jul 5, 2019

@dingo-d Feel free to merge this ;-)

@dingo-d dingo-d merged commit 173fdd6 into develop Jul 5, 2019
@jrfnl jrfnl deleted the feature/wp-ruleset-efficiency-fix branch July 5, 2019 09:46
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.

None yet

3 participants