2017-08-22 17:13:23 +00:00
|
|
|
var gulp = require('gulp');
|
|
|
|
|
|
|
|
var sassLint = require('gulp-sass-lint');
|
|
|
|
var pump = require('pump');
|
2017-10-22 02:14:44 +00:00
|
|
|
var spawn = require('child_process').spawn;
|
2017-08-22 17:13:23 +00:00
|
|
|
|
|
|
|
var watchConfig = require('../config.js').watchConfig;
|
|
|
|
|
|
|
|
|
2017-08-22 17:29:16 +00:00
|
|
|
gulp.task('lint', ['lint:styles', 'lint:python']);
|
|
|
|
|
|
|
|
gulp.task('lint:python', function(cb) {
|
|
|
|
spawn(
|
|
|
|
'pipenv',
|
|
|
|
[
|
|
|
|
'run',
|
|
|
|
'flake8',
|
2017-08-22 17:36:49 +00:00
|
|
|
'--exclude=migrations,manage.py,node_modules,settings'
|
2017-08-22 17:29:16 +00:00
|
|
|
],
|
|
|
|
{
|
|
|
|
stdio: 'inherit'
|
|
|
|
}
|
|
|
|
).on('exit', cb);
|
|
|
|
});
|
2017-08-22 17:13:23 +00:00
|
|
|
|
|
|
|
gulp.task('lint:styles', function(cb) {
|
|
|
|
pump([
|
|
|
|
gulp.src(watchConfig.stylesGlob),
|
|
|
|
sassLint({
|
|
|
|
rules: {
|
|
|
|
'declarations-before-nesting': 1,
|
|
|
|
'indentation': [ 1, { 'size': 4 } ],
|
|
|
|
'no-ids': 0,
|
|
|
|
'no-vendor-prefixes': 2,
|
2017-10-22 19:05:58 +00:00
|
|
|
'placeholder-in-extend': 0,
|
2017-08-22 17:13:23 +00:00
|
|
|
'property-sort-order': 0
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
sassLint.format(),
|
|
|
|
sassLint.failOnError()
|
|
|
|
], cb);
|
|
|
|
});
|