WordPress / wp-feature-notifications

WP Feature Notifications - a proposal to modernise the way in which WordPress handles emails, admin notices and user notifications
https://wordpress.github.io/wp-feature-notifications/
GNU General Public License v2.0
189 stars 19 forks source link

Define the Coding Standards #11

Closed raaaahman closed 1 year ago

raaaahman commented 4 years ago

WordPress has a set of Coding Standards that are expected to be met by contributions to its code. Since the WP Notify long term goal is to be included in WordPress Core, we might as well start respecting these standards from the beginning.

Additional rules may be also met for our code to be allowed on Automattic WordPress VIP platform, read more here: https://wpvip.com/documentation/the-vip-code-analysis-bot/

To assist us, the PHP Code Sniffer is an useful and widely used tool that we can configure with our specific rules.

This tool has an extension in some IDEs like PHPStorm, so we could list tutorials on how to configure it for each of the IDE used by this project's contributors.

szepeviktor commented 4 years ago

WordPress + OOP = https://github.com/Automattic/phpcs-neutron-ruleset

BTW this is my useful frankenstein: https://github.com/szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset

raaaahman commented 4 years ago

Also, as long as WordPress still supports PHP 5.6, we may get use from: https://github.com/PHPCompatibility/PHPCompatibility

Here's an example of rulesets used by the Inpsyde company: https://github.com/inpsyde/php-coding-standards

jonathanbossenger commented 4 years ago

Only because I don't see it listed here, I'd like to remind folks of https://github.com/WordPress/WordPress-Coding-Standards

jonathanbossenger commented 3 years ago

To start with, we should probably only follow the WordPress-Core standards from https://github.com/WordPress/WordPress-Coding-Standards, as that is what core is currently following.

raaaahman commented 3 years ago

To start with, we should probably only follow the WordPress-Core standards from https://github.com/WordPress/WordPress-Coding-Standards, as that is what core is currently following.

When it comes to standards, I would advocate to start with the more restrictions, as it seems easier to loosen them afterwards than to enforce new standards on an established code base.

In the first case the new code will not need to follow the former standards, while the old code doesn't need to be changed. In the later case, both the new and old code will need to enforce the new standards, which means the existing code base needs to be refactored.

erikyo commented 1 year ago

outdated, phpcs has been setup