2017 © Pedro Peláez
 

composer-plugin phpcs-composer

image

10up/phpcs-composer

  • Friday, July 6, 2018
  • by 10up
  • Repository
  • 57 Watchers
  • 0 Stars
  • 394 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

10up PHPCS Configuration

Composer library to provide drop in installation and configuration of WPCS and PHPCompatibilityWP, setting reasonable defaults for WordPress development with nearly zero configuration., (*1)

Support Level MIT License, (*2)

Installation

Install the library via Composer:, (*3)

$ composer require --dev 10up/phpcs-composer:dev-master

That's it!, (*4)

Usage

Lint your PHP files with the following command:, (*5)

$ ./vendor/bin/phpcs .

If relying on Composer, edited the composer.json file by adding the following:, (*6)

    "scripts": {
        "lint": [
            "phpcs ."
        ],
    }

Then lint via:, (*7)

$ composer run lint

Continuous Integration

PHPCS Configuration plays nicely with Continuous Integration solutions. Out of the box, the library loads the 10up-Default ruleset, and checks for syntax errors for PHP 7 or higher., (*8)

To override the default PHP version check, set the --runtime-set testVersion 7.0- configuration option. Example for PHP version 7.2 and above:, (*9)

$ ./vendor/bin/phpcs --runtime-set testVersion 7.2-

See more information about specifying PHP version., (*10)

Note that you can only overrule PHP version check from the command-line., (*11)

IDE Integration

Some IDE integrations of PHPCS fail to register the 10up-Default ruleset. In order to rectify this, place .phpcs.xml.dist at your project root:, (*12)

<?xml version="1.0"?>
<ruleset name="Project Rules">
    <rule ref="10up-Default" />
</ruleset>

Support Level

Active: 10up is actively working on this, and we expect to continue work for the foreseeable future including keeping tested up to the most recent version of WordPress. Bug reports, feature requests, questions, and pull requests are welcome., (*13)

Like what you see?

, (*14)

The Versions

06/07 2018

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

by Ephraim Gregor

26/06 2018

dev-fix/readme-package

dev-fix/readme-package

  Sources   Download

MIT

The Requires

 

by Ephraim Gregor