forked from Ecodev/newsletter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
44 lines (36 loc) · 1.04 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
var gulp = require('gulp');
var shell = require('gulp-shell');
var paths = {
js: [
'Resources/Public/JavaScript/**/*.js',
'!Resources/Public/JavaScript/NVD3/*',
'!Resources/Public/JavaScript/Override/*',
],
php: [
'**/*.php',
'!3dparty/*',
'!vendor/*',
],
};
gulp.task('default', ['composer', 'lint-js', 'lint-php'], function() {
// place code for your default task here
});
gulp.task('lint-js', function() {
var jshint = require('gulp-jshint');
var jscs = require('gulp-jscs');
return gulp.src(paths.js)
.pipe(jscs({configPath: '.jscs.json'}))
.pipe(jshint())
.pipe(jshint.reporter());
});
gulp.task('lint-php', ['composer'], shell.task([
'./vendor/bin/php-cs-fixer fix --diff --verbose --dry-run'
]));
gulp.task('composer', function() {
var composer = require('gulp-composer');
return composer('install', {});
});
gulp.task('watch', function() {
gulp.watch(paths.js, ['lint-js']);
gulp.watch(paths.php, ['lint-php']);
});