Closed raaaahman closed 1 year 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
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
Only because I don't see it listed here, I'd like to remind folks of https://github.com/WordPress/WordPress-Coding-Standards
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.
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.
outdated, phpcs has been setup
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.