diff --git a/CHANGELOG.md b/CHANGELOG.md index dc5ca75..bb7b0ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,13 @@ All notable changes to this project will be documented in this file. This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a CHANGELOG](https://keepachangelog.com/). -## [Unreleased] +## [2.0.0-beta.1] - 2023-09-17 + +This release requires WPCS 3.0.0 or higher. Please read the [WordPressCS 3.0 upgrade guide](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Upgrade-Guide-to-WordPressCS-3.0.0-for-ruleset-maintainers) for instructions on how to update your local rulesets and code annotations. + +- feat!: Bumped minimum WPCS and VIPCS versions to `3.0.0`. +- fix!: Remove unused `WordPress.CodeAnalysis.AssignmentInCondition.Found` exclusion from `WPGraphQL-Minimum`. +- feat!: Add `Generic.CodeAnalysis.UnusedFunctionParameter` and `WordPress.WP.Capabilities.Undetermined` sniffs to `WPGraphQL-Strict`. These sniffs are excluded from the `WPGraphQL-Core` standard. ## [1.0.0-beta.4] - 2023-08-17 - feat!: Updated `WPGraphQL-Minimum` and `WPGraphQL-Strict` based on the latest changes to WPGraphQL core. (See https://github.com/wp-graphql/wp-graphql/compare/release/v1.14.10...develop#diff-05ae9cddcaec1e845771a7db224961439f83ef5939ec67d3a48744cb34d7e58b) diff --git a/README.md b/README.md index fd019f6..87c0108 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ You can use the following standard names when invoking `phpcs` to select the sni * [`WPGraphQL`](./WPGraphQL/ruleset.xml) - complete set with all of the sniffs in the project. - [`WPGraphQL-Minimum`](./WPGraphQL-Minimum/ruleset.xml): basic ruleset for WPGraphQL projects. - [`WPGraphQL-Strict`](./WPGraphQL-Strict/ruleset.xml): includes all the sniffs in the `WPGraphQL-Minimum` ruleset, plus additional functional sniffs to help you produce enterprise-ready code. - - [`WPGraphQL-Core`](./WPGraphQL-Core/ruleset.xml): includes all the sniffs currently used by the WPGraphQL core project. Currently is the same as the `WPGraphQL-Strict` ruleset, with a few sniffs disabled. + - [`WPGraphQL-Core`](./WPGraphQL-Core/ruleset.xml): includes all the sniffs currently used by the [WPGraphQL core project](https://github.com/wp-graphql/wp-graphql/blob/develop/phpcs.xml.dist). Currently this is the same as the `WPGraphQL-Strict` ruleset, with a few sniffs disabled. - [`WPGraphQL-Extra`](./WPGraphQL-Extra/ruleset.xml): includes all the sniffs in the `WPGraphQL-Strict` ruleset, plus additional formatting sniffs to keep your code looks consistent across your project. - [`WPGraphQL-Docs`](./WPGraphQL-Docs/ruleset.xml): includes sniffs for doc-blocks and inline comments. @@ -52,6 +52,6 @@ The best way to use these sniffs in your project is to create a [local configura In this file, you will want to configure the following: - [`testVersion`](./phpcs.xml.dist.example#L33) - The minimum PHP version you want to test against. This should be the lowest version of PHP that you want to support. While WPGraphQL officially supports PHP 7.1+, we recommend testing against PHP 7.3 (the current lowest version actively [tested against](https://github.com/wp-graphql/wp-graphql/blob/develop/.github/workflows/testing-integration.yml)) or higher. -- [`minimum_supported_wp_version`](./phpcs.xml.dist.example#L43) - The minimum WordPress version you want to test against. This should be the lowest version of WordPress that you want to support. While WPGraphQL officially supports WordPress 5.0+, we recommend testing against WordPress 5.6 (the current lowest version actively [tested against](https://github.com/wp-graphql/wp-graphql/blob/develop/.github/workflows/testing-integration.yml)) or higher. +- [`minimum_wp_version`](./phpcs.xml.dist.example#L43) - The minimum WordPress version you want to test against. This should be the lowest version of WordPress that you want to support. While WPGraphQL officially supports WordPress 5.0+, we recommend testing against WordPress 5.6 (the current lowest version actively [tested against](https://github.com/wp-graphql/wp-graphql/blob/develop/.github/workflows/testing-integration.yml)) or higher. - [`WordPress.WP.I18n.text_domain`](./phpcs.xml.dist.example#L63) - The text domain used in your project. This is used by the `WordPress.WP.I18n` sniff to check that all translatable strings are assigned to a text domain. We recommend using the format `wp-graphql-`. - [`WordPress.NamingConventions.PrefixAllGlobals`](./phpcs.xml.dist.example#L57) - The list of prefixes used in your project. This is used by the `WordPress.NamingConventions.PrefixAllGlobals` sniff to check that all global functions, classes, constants, and variables are prefixed. diff --git a/WPGraphQL-Core/ruleset.xml b/WPGraphQL-Core/ruleset.xml index d2aa4c4..0f4a2d7 100644 --- a/WPGraphQL-Core/ruleset.xml +++ b/WPGraphQL-Core/ruleset.xml @@ -6,10 +6,14 @@ - - + + + + + + diff --git a/WPGraphQL-Minimum/ruleset.xml b/WPGraphQL-Minimum/ruleset.xml index 88f3f50..1c89fe6 100644 --- a/WPGraphQL-Minimum/ruleset.xml +++ b/WPGraphQL-Minimum/ruleset.xml @@ -16,20 +16,22 @@ - - + + - + + + diff --git a/WPGraphQL-Strict/ruleset.xml b/WPGraphQL-Strict/ruleset.xml index baa8c15..f885d80 100644 --- a/WPGraphQL-Strict/ruleset.xml +++ b/WPGraphQL-Strict/ruleset.xml @@ -13,6 +13,9 @@ + + 5 + 5 @@ -25,6 +28,9 @@ 5 + + 5 + diff --git a/composer.json b/composer.json index 04c150e..10c4a77 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "axepress/wp-graphql-cs", "type": "phpcodesniffer-standard", "description": "PHP_CodeSniffer rules (sniffs) for the WPGraphQL ecosystem.", - "version": "1.0.0-beta.3", + "version": "2.0.0-beta.1", "keywords": [ "phpcs", "wpcs", @@ -25,10 +25,8 @@ ], "require": { "php": ">=7.2", - "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", - "squizlabs/php_codesniffer": "^3.7.1", "slevomat/coding-standard": "^8.12", - "automattic/vipwpcs": "^2.3", + "automattic/vipwpcs": "^3.0", "phpcompatibility/phpcompatibility-wp": "^2.1" }, "require-dev": { diff --git a/phpcs.xml.dist.example b/phpcs.xml.dist.example index c833545..99b3283 100644 --- a/phpcs.xml.dist.example +++ b/phpcs.xml.dist.example @@ -43,7 +43,7 @@ Tests for WordPress version compatibility. https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties --> - +