Skip to content

Commit 1a38f67

Browse files
committed
reintegrated lessLintStylish to test-forms gulpfile.js
1 parent 7a7f663 commit 1a38f67

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

gulpfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ gulp.task('graphviz', function () {
239239
*/
240240
watchFilesFor.lint = [
241241
path.join(gulpDir, 'gulpfile.js'),
242-
path.join(gulpDir, 'package.json'),
243-
path.join(gulpDir, 'tests/**/*.js')
242+
path.join(gulpDir, '**', 'package.json'),
243+
path.join(gulpDir, 'tests', '**', '*.js')
244244
];
245245
gulp.task('lint', function(callback) {
246246
return gulp.src(watchFilesFor.lint)

tests/test-forms/gulpfile.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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;
2525
var testDir = __dirname;
2626
var testLogfile = path.join(testDir, 'tests.log');
2727
var testHtmlLogfile = path.join(testDir, 'tests.html');
@@ -30,12 +30,26 @@ var txtLog = [];
3030
var htmlLog = [];
3131
var 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
*/
3650
watchFilesFor.lint = [
37-
path.join(gulpDir, 'package.json'),
38-
path.join(gulpDir, '**/*.js')
51+
path.join(testDir, 'package.json'),
52+
path.join(testDir, '**', '*.js')
3953
];
4054
gulp.task('lint', function(callback) {
4155
return gulp.src(watchFilesFor.lint)
@@ -177,6 +191,7 @@ gulp.task('logTestResults', function(callback) {
177191
*/
178192
gulp.task('build', function(callback) {
179193
runSequence('lint',
194+
'lessLintStylish',
180195
callback);
181196
});
182197

tests/test-forms/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"del": "^1.1.1",
2121
"gulp": "^3.8.10",
2222
"gulp-jshint": "^2.0.1",
23+
"gulp-lesshint": "^2.0.0",
2324
"jshint": "^2.9.3",
2425
"phantomjs-prebuilt": "^2.1.12",
2526
"run-sequence": "^1.1.5",

0 commit comments

Comments
 (0)