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

:sparkles: New `CodeAnalysis.EmptyStatement` sniff #980

Merged
merged 1 commit into from Jun 17, 2017

Conversation

@jrfnl
Contributor

jrfnl commented Jun 17, 2017

New sniff to detect superfluous semi-colons and empty PHP open-close tag combinations.

Includes an auto-fixer.

Added into a new CodeAnalysis category to be in line with the related upstream sniff.

As these issues are not explicitly mentioned in the WP Core Coding Style Handbook and are more along the lines of best practices, I've added the sniff to the WordPress-Extra ruleset.
For that same reason, I've elected to let the sniff throw warnings instead of errors.

For the current WP Core codestyle update, it would, however, be advisable to explicitly enable this sniff from the ruleset as issues which this sniff will fix, have already been detected in WP Core during a visual inspection.

Fixes #975

N.B. This sniff should eventually be merged with the upstream Generic.CodeAnalysis.EmptyStatement sniff and pulled there. This would fix upstream issue squizlabs/PHP_CodeSniffer#1119.

New `CodeAnalysis.EmptyStatement` sniff
New sniff to detect superfluous semi-colons and empty PHP open-close tag combinations.

Includes an auto-fixer.

Added into a new `CodeAnalysis` category to be in line with the related upstream sniff.

As these issues are not explicitly mentioned in the WP Core Coding Style Handbook and are more along the lines of best practices, I've added the sniff to the `WordPress-Extra` ruleset.
For that same reason, I've elected to let the sniff throw warnings instead of errors.

For the current WP Core codestyle update, it would, however, be advisable to explicitly enable this sniff from the ruleset as issues which this sniff will fix, *have* already been detected in WP Core during a visual inspection.

Fixes 975

N.B. This sniff should eventually be merged with the upstream `Generic.CodeAnalysis.EmptyStatement` sniff and pulled there. This would fix upstream issue #1119.

@JDGrimes JDGrimes merged commit 25abbf9 into develop Jun 17, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@JDGrimes JDGrimes deleted the feature/detect-empty-statements branch Jun 17, 2017

@jrfnl jrfnl referenced this pull request Dec 27, 2017

Open

Drop PHPCS 2.x support by August 31, 2018 #1048

0 of 23 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment