Skip to content

Commit

Permalink
Improve gulpfile.js
Browse files Browse the repository at this point in the history
  • Loading branch information
haroldangenent committed Feb 25, 2016
1 parent bd64d5d commit 6427650
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"use strict"
'use strict';

/**
* Require dependencies
Expand All @@ -14,9 +14,10 @@ var gulp = require('gulp'),
*
* Concat contains extra files to concat
*/
var files = {
php: ['**/*.php', '!node_modules/**/*.*'],
};
var files = [
'**/*.php',
'!node_modules/**/*.*'
];

/**
* Error handling
Expand All @@ -25,16 +26,17 @@ var gulp_src = gulp.src;

gulp.src = function() {
return gulp_src.apply(gulp, arguments)

.pipe(plumber(function(error) {
beep();
}));
}
};

/**
* PHP CodeSniffer (PSR)
*/
gulp.task('phpcs', function() {
gulp.src(files.php)
return gulp.src(files)

// Use cache to filter out unmodified files
.pipe(cache('phpcs'))
Expand All @@ -48,12 +50,12 @@ gulp.task('phpcs', function() {

// Log errors and fail afterwards
.pipe(phpcs.reporter('log'))
.pipe(phpcs.reporter('fail'))
.pipe(phpcs.reporter('fail'));
});

/**
* Watch
*/
gulp.task('default', function() {
gulp.watch(files.php, ['phpcs']);
gulp.watch(files, ['phpcs']);
});

0 comments on commit 6427650

Please sign in to comment.