helsingborg-stad / phpcs
PHP_CodeSniffer rulesets supporting the coding standards for the Helsingborg Stad organization
Installs: 6 311
Dependents: 7
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
Language:Shell
Type:phpcodesniffer-standard
Requires
- php: >=7.4
- dealerdirect/phpcodesniffer-composer-installer: ^1.0
- squizlabs/php_codesniffer: ^3.0
- wp-coding-standards/wpcs: ^3.0
README
Installation
Run the following from the root of your project:
composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer require --dev helsingborg-stad/phpcs
Available rulesets
Hbg-WordPress
Specific ruleset for WordPress themes and plugins.
Example Usage
<?xml version="1.0"?> <ruleset name="Some Wordpress Plugin"> <file>./source/php</file> <file>./tests</file> <rule ref="Hbg-WordPress"></rule> </ruleset>
Available composer binaries
Included are 2 binaries for running phpcs and phpcbf on changed files only. The changes in the current branch are compared to supplied branch, and are meant to be used in a CI environment.
Examples
vendor/bin/phpcs-changed origin/main
This example runs phpcs on all changed files in the current branch compared to origin/main.
vendor/bin/phpcbf-changed origin/main
This example runs phpcbf on all changed files in the current branch compared to origin/main.