samikeijonen/phpcs-composer

Custom PHPCS ruleset.

Installs: 872

Dependents: 2

Suggesters: 0

Security: 0

Stars: 2

Watchers: 3

Forks: 0

Open Issues: 0

Type:phpcodesniffer-standard

dev-main 2021-09-14 06:39 UTC

This package is auto-updated.

Last update: 2024-04-14 11:56:47 UTC


README

This is a standalone composer package for Custom WPCS ruleset.

Requirements

  • PHP 5.6+ (preferably 7+).
  • Composer for managing PHP dependencies.

Installation

Open your command line tool and change directories to your WordPress theme folder.

cd path/to/wp-content/themes/<your-theme-name>

Then, use Composer to install the package.

composer require --dev samikeijonen/phpcs-composer:dev-master

Usage

Lint your PHP files with the following command:

./vendor/bin/phpcs . --standard=Foxland-Default

Or you can set default (Foxland-Default) coding standard in composer.json file:

"scripts": {
	"install-codestandards": "\"vendor/bin/phpcs\" --config-set default_standard Foxland-Default",
	"post-install-cmd": "@install-codestandards",
	"post-update-cmd" : "@install-codestandards"
}

Then you can lint with the following command:

./vendor/bin/phpcs .