Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/funding.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: [AxeWp]
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vscode/
build/
vendor/
composer.lock
Expand Down
21 changes: 19 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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-<project-name>`.
- [`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).

<a href="https://github.com/sponsors/AxeWP" alt="GitHub Sponsors"><img src="https://img.shields.io/static/v1?label=Sponsor%20Us%20%40%20AxeWP&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86&style=for-the-badge" /></a>
2 changes: 1 addition & 1 deletion WPGraphQL/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="WPGraphQL Strict Coding Standard" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<description>WPGraphQL Coding Standards</description>

<!-- Includes WPGrapQL-Minimum and WPGraphQL-Strict-->
<!-- Includes WPGraphQL-Minimum and WPGraphQL-Strict-->
<rule ref="WPGraphQL-Extra" />
<rule ref="WPGraphQL-Docs" />

Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml.dist.example
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
Tests for WordPress version compatibility.
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties
-->
<config name="minimum_wp_version" value="5.9"/>
<config name="minimum_wp_version" value="6.0"/>

<!-- Rules: WPGraphQL Coding Standards -->
<!-- https://github.com/AxeWP/WPGraphQL-Coding-Standards/WPGraphQL/ruleset.xml -->
Expand Down