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 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..c798818 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ -# 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) @@ -55,3 +58,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 --> - +