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 more generic rules #360

Merged
merged 7 commits into from
Dec 14, 2023
Merged

Conversation

jrfnl
Copy link
Collaborator

@jrfnl jrfnl commented Dec 14, 2023

YoastCS rules: enforce lowercase PHP tags

Impact on Yoast packages:

Plugin/Tool Errors/Warnings
PHPUnit Polyfills --
WP Test Utils --
YoastCS --
WHIP --
Yoast Test Helper --
Duplicate Post --
Yst ACF --
Yst WooCommerce --
Yst News --
Yst Local --
Yst Video --
Yst Premium --
Yst Free --

YoastCS rules: disallow alternative control structure syntax

... except when there is inline HTML nested within the control structure body.

Impact on Yoast packages:

Plugin/Tool Errors/Warnings
PHPUnit Polyfills --
WP Test Utils --
YoastCS --
WHIP --
Yoast Test Helper --
Duplicate Post --
Yst ACF --
Yst WooCommerce --
Yst News --
Yst Local --
Yst Video --
Yst Premium --
Yst Free --

Note: this rule was previously already "silently" enforced via clean-up sweeps.

YoastCS rules: disallow the use of the logical and/or operators

Impact on Yoast packages:

Plugin/Tool Errors/Warnings
PHPUnit Polyfills --
WP Test Utils --
YoastCS --
WHIP --
Yoast Test Helper --
Duplicate Post --
Yst ACF --
Yst WooCommerce --
Yst News --
Yst Local --
Yst Video --
Yst Premium --
Yst Free --

Note: this rule was previously already "silently" enforced via clean-up sweeps.

YoastCS rules: forbid double negation

Impact on Yoast packages:

Plugin/Tool Errors/Warnings
PHPUnit Polyfills --
WP Test Utils --
YoastCS --
WHIP --
Yoast Test Helper --
Duplicate Post --
Yst ACF --
Yst WooCommerce --
Yst News --
Yst Local --
Yst Video --
Yst Premium --
Yst Free --

Note: this rule was previously already "silently" enforced via clean-up sweeps.

YoastCS rules: enforce consistent concatenation operator position

... for multi-line concatenations.

Impact on Yoast packages:

Plugin/Tool Errors/Warnings
PHPUnit Polyfills --
WP Test Utils --
YoastCS --
WHIP --
Yoast Test Helper --
Duplicate Post --
Yst ACF --
Yst WooCommerce --
Yst News --
Yst Local --
Yst Video --
Yst Premium --
Yst Free 90

Note: this rule was previously already "silently" enforced via clean-up sweeps.

YoastCS rules: disallow implicit array creation

Impact on Yoast packages:

Plugin/Tool Errors/Warnings
PHPUnit Polyfills --
WP Test Utils --
YoastCS --
WHIP --
Yoast Test Helper --
Duplicate Post --
Yst ACF --
Yst WooCommerce --
Yst News --
Yst Local 54
Yst Video --
Yst Premium --
Yst Free --

Note: this rule was previously already "silently" enforced via clean-up sweeps.

YoastCS rules: enforce closures to be static

... when the $this variable is not accessed.

Impact on Yoast packages:

Plugin/Tool Errors/Warnings
PHPUnit Polyfills --
WP Test Utils --
YoastCS --
WHIP --
Yoast Test Helper --
Duplicate Post --
Yst ACF --
Yst WooCommerce --
Yst News --
Yst Local --
Yst Video --
Yst Premium --
Yst Free 2

Note: this rule was previously already "silently" enforced via clean-up sweeps.


Related to #303

Related to 303

Impact on Yoast packages:

| Plugin/Tool       | Errors/Warnings |
|-------------------|-----------------|
| PHPUnit Polyfills | --
| WP Test Utils     | --
| YoastCS           | --
| WHIP              | --
| Yoast Test Helper | --
| Duplicate Post    | --
| Yst ACF           | --
| Yst WooCommerce   | --
| Yst News          | --
| Yst Local         | --
| Yst Video         | --
| Yst Premium       | --
| Yst Free          | --
... except when there is inline HTML nested within the control structure body.

Related to 303

Impact on Yoast packages:

| Plugin/Tool       | Errors/Warnings |
|-------------------|-----------------|
| PHPUnit Polyfills | --
| WP Test Utils     | --
| YoastCS           | --
| WHIP              | --
| Yoast Test Helper | --
| Duplicate Post    | --
| Yst ACF           | --
| Yst WooCommerce   | --
| Yst News          | --
| Yst Local         | --
| Yst Video         | --
| Yst Premium       | --
| Yst Free          | --

Note: this rule was previously already "silently" enforced via clean-up sweeps.
Related to 303

Impact on Yoast packages:

| Plugin/Tool       | Errors/Warnings |
|-------------------|-----------------|
| PHPUnit Polyfills | --
| WP Test Utils     | --
| YoastCS           | --
| WHIP              | --
| Yoast Test Helper | --
| Duplicate Post    | --
| Yst ACF           | --
| Yst WooCommerce   | --
| Yst News          | --
| Yst Local         | --
| Yst Video         | --
| Yst Premium       | --
| Yst Free          | --

Note: this rule was previously already "silently" enforced via clean-up sweeps.
Related to 303

Impact on Yoast packages:

| Plugin/Tool       | Errors/Warnings |
|-------------------|-----------------|
| PHPUnit Polyfills | --
| WP Test Utils     | --
| YoastCS           | --
| WHIP              | --
| Yoast Test Helper | --
| Duplicate Post    | --
| Yst ACF           | --
| Yst WooCommerce   | --
| Yst News          | --
| Yst Local         | --
| Yst Video         | --
| Yst Premium       | --
| Yst Free          | --

Note: this rule was previously already "silently" enforced via clean-up sweeps.
... for multi-line concatenations.

Related to 303

Impact on Yoast packages:

| Plugin/Tool       | Errors/Warnings |
|-------------------|-----------------|
| PHPUnit Polyfills | --
| WP Test Utils     | --
| YoastCS           | --
| WHIP              | --
| Yoast Test Helper | --
| Duplicate Post    | --
| Yst ACF           | --
| Yst WooCommerce   | --
| Yst News          | --
| Yst Local         | --
| Yst Video         | --
| Yst Premium       | --
| Yst Free          | 90

Note: this rule was previously already "silently" enforced via clean-up sweeps.
Related to 303

Impact on Yoast packages:

| Plugin/Tool       | Errors/Warnings |
|-------------------|-----------------|
| PHPUnit Polyfills | --
| WP Test Utils     | --
| YoastCS           | --
| WHIP              | --
| Yoast Test Helper | --
| Duplicate Post    | --
| Yst ACF           | --
| Yst WooCommerce   | --
| Yst News          | --
| Yst Local         | 54
| Yst Video         | --
| Yst Premium       | --
| Yst Free          | --

Note: this rule was previously already "silently" enforced via clean-up sweeps.
... when the `$this` variable is not accessed.

Related to 303

Impact on Yoast packages:

| Plugin/Tool       | Errors/Warnings |
|-------------------|-----------------|
| PHPUnit Polyfills | --
| WP Test Utils     | --
| YoastCS           | --
| WHIP              | --
| Yoast Test Helper | --
| Duplicate Post    | --
| Yst ACF           | --
| Yst WooCommerce   | --
| Yst News          | --
| Yst Local         | --
| Yst Video         | --
| Yst Premium       | --
| Yst Free          | 2

Note: this rule was previously already "silently" enforced via clean-up sweeps.
@jrfnl jrfnl added this to the 3.0 milestone Dec 14, 2023
@jrfnl jrfnl changed the title Jrf/yoastcs more generic rules YoastCS: add more generic rules Dec 14, 2023
@coveralls
Copy link

Coverage Status

coverage: 99.411%. remained the same
when pulling 5d3ffad on JRF/yoastcs-more-generic-rules
into a083401 on develop.

@jrfnl jrfnl merged commit 340b3a2 into develop Dec 14, 2023
28 checks passed
@jrfnl jrfnl deleted the JRF/yoastcs-more-generic-rules branch December 14, 2023 02:35
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