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

YoastCS: add dependency on PHPCSExtra and replace some sniffs with versions from Extra #318

Merged
merged 3 commits into from
Nov 3, 2023

Conversation

jrfnl
Copy link
Collaborator

@jrfnl jrfnl commented Nov 3, 2023

Composer: add PHPCSExtra

Add PHPCSExtra as a new dependency. PHPCSExtra is an external standard for PHP_CodeSniffer and is also a requirement for WPCS 3.0.0.

The reason to add it as a direct requirement for YoastCS is that we'll not only be using sniffs from PHPCSExtra via WPCS, but also want to use additional sniffs which PHPCSExtra has to offer, which makes it not just a requirement of WPCS, but also a requirement of YoastCS.

Ref: https://github.com/PHPCSStandards/PHPCSExtra

YoastCS: remove IfElseDeclaration sniff in favour of similar from PHPCSExtra

This commit removes the YoastCS native Yoast.ControlStructures.IfElseDeclaration sniff in favour of a similar sniff from PHPCSExtra.

The PHPCSExtra Universal.ControlStructures.IfElseDeclaration sniff includes a fixer, making it more powerful than the YoastCS sniff.

YoastCS: remove NamespaceDeclaration sniff in favour of similar from PHPCSExtra

This commit removes the Yoast.Namespaces.NamespaceDeclaration sniff in favour of three sniffs from PHPCSExtra, which combined do the same thing.

jrfnl added 3 commits November 3, 2023 23:30
Add PHPCSExtra as a new dependency. PHPCSExtra is an external standard for PHP_CodeSniffer and is also a requirement for WPCS 3.0.0.

The reason to add it as a direct requirement for YoastCS is that we'll not only be using sniffs from PHPCSExtra via WPCS, but also want to use additional sniffs which PHPCSExtra has to offer, which makes it not just a requirement of WPCS, but also a requirement of YoastCS.

Ref: https://github.com/PHPCSStandards/PHPCSExtra
…HPCSExtra

This commit removes the YoastCS native `Yoast.ControlStructures.IfElseDeclaration` sniff in favour of a similar sniff from PHPCSExtra.

The PHPCSExtra `Universal.ControlStructures.IfElseDeclaration` sniff includes a fixer, making it more powerful than the YoastCS sniff.
…m PHPCSExtra

This commit removes the `Yoast.Namespaces.NamespaceDeclaration` sniff in favour of three sniffs from PHPCSExtra, which combined do the same thing.
@jrfnl jrfnl added this to the 3.0 milestone Nov 3, 2023
@jrfnl jrfnl changed the title Jrf/yoastcs add phpcsextra YoastCS: add dependency on PHPCSExtra and replace some sniffs with versions from Extra Nov 3, 2023
@coveralls
Copy link

Coverage Status

coverage: 97.644% (-0.2%) from 97.815%
when pulling 9ab69a9 on JRF/yoastcs-add-phpcsextra
into b075884 on develop.

@jrfnl jrfnl merged commit 6754fc3 into develop Nov 3, 2023
36 checks passed
@jrfnl jrfnl deleted the JRF/yoastcs-add-phpcsextra branch November 3, 2023 22:45
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