From f8075a48bd2bca53045dd060aa2d9601d0d75f73 Mon Sep 17 00:00:00 2001 From: Dovid Levine Date: Sat, 3 May 2025 03:13:43 +0300 Subject: [PATCH 1/3] release: v2.0.1 --- .github/funding.yml | 3 +++ .gitignore | 1 + CHANGELOG.md | 21 +++++++++++++++++++-- README.md | 20 ++++++++++++++++++++ WPGraphQL/ruleset.xml | 2 +- phpcs.xml.dist.example | 2 +- 6 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 .github/funding.yml diff --git a/.github/funding.yml b/.github/funding.yml new file mode 100644 index 0000000..6873ff4 --- /dev/null +++ b/.github/funding.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +github: [AxeWp] diff --git a/.gitignore b/.gitignore index 4c8e37b..7f6baa7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.vscode/ build/ vendor/ composer.lock diff --git a/CHANGELOG.md b/CHANGELOG.md index 180d266..a9c430b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,10 +6,27 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a ## [ Unreleased ] +## [ 2.0.1 ] - 2025-05-03 + +This release fixes several bugs where rules were not being disabled correctly. + +We've also added CI to the repo to test the rulesets against the latest WPGraphQL codebase, to preemptively catch future issues. + +### WPGraphQL-Core + +- fix: Fix incorrect excludes XML block in `WPGraphQL-Core` ruleset. + +### WPGraphQL-Docs + - fix: Disable `Squiz.Commenting.VariableComment.MissingVar` in favor of `SlevomatCodingStandard.TypeHints.PropertyTypeHint`. + +### WPGraphQL-Minimum - fix: Ignore `SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation` for PHPStan annotations. -- fix: Fix incorrect excludes in `WPGraphQL-Core` ruleset. -- ci: Add ruleset testing Workflow. + +### Misc + +- ci: Add test workflow. +- docs: cleanup Readme. ## [2.0.0] - 2025-02-15 diff --git a/README.md b/README.md index 411eac5..65588e9 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,16 @@ This project is a collection of rules and sniffs for PHPCS to validate code deve - [Slevomat Coding Standard](https://https://github.com/slevomat/coding-standard) - [PHPCompatibility](https://github.com/PHPCompatibility/PHPCompatibility) & [PHPCompatibilityWP](https://github.com/PHPCompatibility/PHPCompatibilityWP) +----- + +![Packagist License](https://img.shields.io/packagist/l/axepress/wp-graphql-cs?color=green) ![Packagist Version](https://img.shields.io/packagist/v/axepress/wp-graphql-cs?label=stable) ![GitHub commits since latest release (by SemVer)](https://img.shields.io/github/commits-since/AxeWP/WPGraphQL-Coding-Standards/2.0.1) ![Packagist Downloads](https://img.shields.io/packagist/dt/axepress/wp-graphql-cs) + ![GitHub Repo stars](https://img.shields.io/github/stars/AxeWP/WPGraphQL-Coding-Standards?style=social) +![Tests](https://img.shields.io/github/actions/workflow/status/axewp/WPGraphQL-Coding-Standards/test.yml?branch=develop&label=CI) + +----- + +* [Join the WPGraphQL community on Discord.](https://discord.gg/55h7WmYZff) + ## Why use these standards? Shared coding standards are a great way to ensure consistency in your codebase. They also help to avoid common pitfalls and mistakes, which in turn helps to reduce bugs and technical debt. @@ -55,3 +65,13 @@ In this file, you will want to configure the following: - [`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. + +## Development and Support + +The project is actively maintained by [AxePress Development](https://axepress.dev). Community contributions are _welcome_ and **encouraged**. + +Basic support is provided for free, both in [this repo](https://github.com/AxeWP/WPGraphQL-Coding-Standards/issues) and in [WPGraphQL's official Discord](https://discord.gg/55h7WmYZff). + +Priority support and custom development are available to [our Sponsors](https://github.com/sponsors/AxeWP). + + diff --git a/WPGraphQL/ruleset.xml b/WPGraphQL/ruleset.xml index f95d4ba..3e826cb 100644 --- a/WPGraphQL/ruleset.xml +++ b/WPGraphQL/ruleset.xml @@ -2,7 +2,7 @@ WPGraphQL Coding Standards - + diff --git a/phpcs.xml.dist.example b/phpcs.xml.dist.example index 99b3283..87dbc89 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 --> - + From 465e5cc2e878774214d4fb06ce953da184643c5a Mon Sep 17 00:00:00 2001 From: Dovid Levine Date: Sat, 3 May 2025 03:16:52 +0300 Subject: [PATCH 2/3] ci: add PR template --- .github/PULL_REQUEST_TEMPLATE.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..f93fc37 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,20 @@ + + +## What + + +## Why + + +## How + + +## Testing Instructions + + +## Checklist: + +- [ ] My code is tested to the best of my abilities. +- [ ] I included the relevant changes in CHANGELOG.md From 6350645193a71a28019cbc707372715a1c47a0d8 Mon Sep 17 00:00:00 2001 From: Dovid Levine Date: Sat, 3 May 2025 03:25:13 +0300 Subject: [PATCH 3/3] chore: cleanup --- README.md | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 65588e9..c798818 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,14 @@ -# WPGraphQL Coding Standards for [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) +# WPGraphQL Coding Standards for PHP_CodeSniffer -This project is a collection of rules and sniffs for PHPCS to validate code developed for the [WPGraphQL](https://github.com/wp-graphql/wp-graphql) ecosystem. It uses rules from: +![Packagist License](https://img.shields.io/packagist/l/axepress/wp-graphql-cs?color=green) ![Packagist Downloads](https://img.shields.io/packagist/dt/axepress/wp-graphql-cs) ![Packagist Version](https://img.shields.io/packagist/v/axepress/wp-graphql-cs?label=stable) ![GitHub commits since latest release (by SemVer)](https://img.shields.io/github/commits-since/AxeWP/WPGraphQL-Coding-Standards/2.0.1) ![GitHub Repo stars](https://img.shields.io/github/stars/AxeWP/WPGraphQL-Coding-Standards?style=social) ![Tests](https://img.shields.io/github/actions/workflow/status/axewp/WPGraphQL-Coding-Standards/test.yml?branch=develop&label=CI) + +----- +This project is a collection of rules and sniffs for [PHPCS](https://github.com/squizlabs/PHP_CodeSniffer) to validate code developed for the [WPGraphQL](https://github.com/wp-graphql/wp-graphql) ecosystem. It uses rules from: - [WordPress Coding Standards](https://github.com/WordPress/WordPress-Coding-Standards) - [Automattic VIP Coding Standards](https://github.com/Automattic/VIP-Coding-Standards) - [Slevomat Coding Standard](https://https://github.com/slevomat/coding-standard) - [PHPCompatibility](https://github.com/PHPCompatibility/PHPCompatibility) & [PHPCompatibilityWP](https://github.com/PHPCompatibility/PHPCompatibilityWP) ------ - -![Packagist License](https://img.shields.io/packagist/l/axepress/wp-graphql-cs?color=green) ![Packagist Version](https://img.shields.io/packagist/v/axepress/wp-graphql-cs?label=stable) ![GitHub commits since latest release (by SemVer)](https://img.shields.io/github/commits-since/AxeWP/WPGraphQL-Coding-Standards/2.0.1) ![Packagist Downloads](https://img.shields.io/packagist/dt/axepress/wp-graphql-cs) - ![GitHub Repo stars](https://img.shields.io/github/stars/AxeWP/WPGraphQL-Coding-Standards?style=social) -![Tests](https://img.shields.io/github/actions/workflow/status/axewp/WPGraphQL-Coding-Standards/test.yml?branch=develop&label=CI) - ------ - -* [Join the WPGraphQL community on Discord.](https://discord.gg/55h7WmYZff) - ## Why use these standards? Shared coding standards are a great way to ensure consistency in your codebase. They also help to avoid common pitfalls and mistakes, which in turn helps to reduce bugs and technical debt.