@@ -17,11 +17,11 @@ var del = require('del'),
1717 glob = require ( 'glob' ) ,
1818 gulp = require ( 'gulp' ) ,
1919 gulpJshint = require ( 'gulp-jshint' ) ,
20+ gulpLesshint = require ( 'gulp-lesshint' ) ,
2021 path = require ( 'path' ) ,
2122 runSequence = require ( 'run-sequence' )
2223 ;
2324
24- var gulpDir = __dirname ;
2525var testDir = __dirname ;
2626var testLogfile = path . join ( testDir , 'tests.log' ) ;
2727var testHtmlLogfile = path . join ( testDir , 'tests.html' ) ;
@@ -30,12 +30,26 @@ var txtLog = [];
3030var htmlLog = [ ] ;
3131var watchFilesFor = { } ;
3232
33+ /*
34+ * less files lint and style check
35+ */
36+ watchFilesFor . lessLintStylish = [
37+ path . join ( testDir , 'less' , '**' , '*.less' )
38+ ] ;
39+ gulp . task ( 'lessLintStylish' , function ( ) {
40+ return gulp . src ( watchFilesFor . lessLintStylish )
41+ . pipe ( gulpLesshint ( ) ) // enforce style guide
42+ . on ( 'error' , function ( err ) { } )
43+ . pipe ( gulpLesshint . reporter ( ) )
44+ ;
45+ } ) ;
46+
3347/*
3448 * lint javascript files
3549 */
3650watchFilesFor . lint = [
37- path . join ( gulpDir , 'package.json' ) ,
38- path . join ( gulpDir , '**/ *.js' )
51+ path . join ( testDir , 'package.json' ) ,
52+ path . join ( testDir , '**' , ' *.js')
3953] ;
4054gulp . task ( 'lint' , function ( callback ) {
4155 return gulp . src ( watchFilesFor . lint )
@@ -177,6 +191,7 @@ gulp.task('logTestResults', function(callback) {
177191 */
178192gulp . task ( 'build' , function ( callback ) {
179193 runSequence ( 'lint' ,
194+ 'lessLintStylish' ,
180195 callback ) ;
181196} ) ;
182197
0 commit comments