/node-phplint

lightning fast php linting

Primary LanguageJavaScript

NPM

Build Status Dependency Status devDependency Status

Inspired by and largely copied from jgable/grunt-phplint but in a build-tool agnostic manner.

Modification by M1ke to output errors to stdout without sending everything to stdout. Further stage will probably be to try and self-document the code a bit.

Install

$ npm install --save-dev https://github.com/M1ke/node-phplint/archive/master.tar.gz

Usage

var phplint = require('phplint');

var lint = phplint('src/app/**/*.php');

lint.then(function (msg) {
  console.log(msg);
});

lint.fail(function (err) {
  console.error(err);
});

Gulp

var gulp = require('gulp');
var phplint = require('phplint');

gulp.task('phplint', function () {
  return phplint('src/app/**/*.php');
});

gulp.task('default', ['phplint']);

Options

limit

Sets the process spawn limit, defaults to 10.

var phplint = require('phplint');

phplint('src/*.php', {
  limit: 2
});

stdout

Prints to stdout, defaults to false. Useful for debugging.

var phplint = require('phplint');

phplint('src/*.php', {
  stdout: true
});

License

MIT © Wayne Ashley Berry