Skip to content

Add New "WordPress.PHP.DiscourageGoto" sniff to Extra #1150

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

Merged
merged 1 commit into from
Sep 19, 2017

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Sep 18, 2017

Usage of goto is seen as a typical code smell.

This sniff is a duplicate of the same as pulled upstream in PR squizlabs/PHP_CodeSniffer#1664
Once the minimum PHPCS requirement for WPCS goes up beyond the version in which the upstream PR is merged, this sniff can be safely removed.

The fact that this is a duplicate with an upstream sniff is also the reason why the sniff itself throws a warning which is changed to an error via the ruleset.

Includes unit tests.

Adding this sniff to Extra for now. The sniff can be moved to Core once the handbook has been adjusted (if it will be).

Fixes #1149

Usage of goto is seen as a typical code smell.

Includes unit tests.

Adding this sniff to `Extra` for now. The sniff can be moved to `Core` once the handbook has been adjusted (if it will be).

This sniff is a duplicate of the same as pulled upstream in PR squizlabs/PHP_CodeSniffer 1664
Once the minimum PHPCS requirement for WPCS goes up beyond the version in which the upstream PR  is merged, this sniff can be safely removed.
@jrfnl jrfnl added this to the 0.14.0 milestone Sep 18, 2017
@jrfnl jrfnl changed the title Add New "Generic.PHP.DiscourageGoto" sniff to Extra Add New "WordPress.PHP.DiscourageGoto" sniff to Extra Sep 18, 2017
@GaryJones GaryJones merged commit 033b8b2 into develop Sep 19, 2017
@GaryJones GaryJones deleted the feature/new-discourage-goto-sniff branch September 19, 2017 06:13
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.

3 participants