Code Monkey home page Code Monkey logo

vip-go-phpcs-blockers's Introduction

VIP Go PHPCS Standard for Blockers

This is a ruleset for PHPCS intended to show all known VIP Go incompatible code as errors. This doesn't define any sniffs but references them from other coding standards.

Some useful defaults are set but can be overridden using phpcs flags:

  • PHP memory_limit set to 1024M
  • Show sniff codes in the report
  • Only scan files with a php extension

Installing

Overview

  • Install PHPCS and the WordPress Coding Standards
  • Add the PHPCS binaries to your PATH
  • Install this standard
  • Add both the WordPress Coding Standards and this standards to PHPCS

Example

We'll install the above from source to the ~/projects/coding-standards directory. Feel free to change this to the directory of your choice and replace accordingly in the commands below.

Install PHPCS, the WordPress Coding Standards, the VIP Coding Standards, and this standard

mkdir -p cd ~/projects/coding-standards
cd coding-standards
git clone https://github.com/squizlabs/PHP_CodeSniffer.git phpcs
git clone -b master https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git wpcs
git clone -b master https://github.com/Automattic/VIP-Coding-Standards.git vipcs
git clone -b master https://github.com/Automattic/VIP-Go-PHPCS-Blockers.git vipgoblockerscs

Add PHPCS binaries to your PATH

echo 'export PATH="~/projects/phpcs/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile

If you are using a different shell, adjust the above to use your profile or rc file.

Add all coding standards to PHPCS

cd phpcs
phpcs --config-set installed_paths ../wpcs,../vipcs,../vipgoblockerscs

Usage

To use this standard, pass in --standard=VIP-Go-PHPCS-Blockers to your phpcs command.

For example, to scan the PHP code in the current directory using this standard:

phpcs --standard=VIP-Go-PHPCS-Blockers .

vip-go-phpcs-blockers's People

Contributors

chrisscott avatar danielbachhuber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

isabella232

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.