Giter VIP home page Giter VIP logo

wpcs's Introduction

๐Ÿ“ƒ wpcs

Check WordPress Coding Standards quickly with Node.js without installing any PHP dependencies.

๐Ÿ’ป Install

Using NPM

$ npm install wpcs --save

Using Yarn

$ yarn add wpcs

If you want to use CLI version, please install it globally.

# NPM
$ npm install wpcs -g

# Yarn
$ yarn global add wpcs

๐Ÿ˜ PHP Scripts

This module depends on these scripts below, using git subtree method under scripts directory.

๐Ÿ“š Usage Example as Module

const WPCS = require('wpcs')

const wpcs = new WPCS(path, rule)

wpcs.on('start', () => {
  // Your script here
})

wpcs.on('scan', filename => {
  // Filename
})

wpcs.on('error', (filename, info) => {
  // Filename, {line: Number, column: Number, message: Number}
})

wpcs.on('warning', (filename, info) => {
  // Filename, {line: Number, column: Number, message: Number}
})

wpcs.on('done', totals => {
  // {errors: Number, warnings: Numbers, files: Numbers}
})

// Get error process
wpcs.process.on('error', err => {
  console.log(err)
})

โšก CLI

https://gyazo.com/e655bf900ae1693d6d98bcbb1d447d5c

wpcs - Check WordPress Coding Standard

  USAGE
    wpcs [path]

  ARGUMENTS
    [path]    Script path could be a directory or filename. optional

  OPTIONS
    --rule <rulename>   Default rule is WordPress-Extra + WordPress-Docs. WordPress | WordPress-Core | WordPress-Docs | WordPress-Extra | WordPress-VIP. optional
    --autofix           Auto fix errors. optional
    --skip-warning      Skip Warning. optional
    --excludes          Excludes Path. optional

This repository is a fork of some great work by oknoorap

License

MIT

wpcs's People

Contributors

nicksrandall avatar oknoorap avatar

Watchers

 avatar  avatar

Forkers

theimbender

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.