Skip to content

Commit

Permalink
Add an scss linter that requires the scss_lint gem
Browse files Browse the repository at this point in the history
  • Loading branch information
Arjen Smit committed Mar 11, 2016
1 parent 2e70036 commit 1db46c9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"gulp-svgmin": "^1.2.2",
"gulp-uglify": "^1.5.3",
"gulp-util": "^3.0.4",
"lodash": "^4.6.1"
"lodash": "^4.6.1",
"shelljs": "^0.6.0"
},
"repository": {
"type": "git",
Expand Down
12 changes: 10 additions & 2 deletions tasks/sass.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
'use strict';

module.exports = function(gulp, config) {

var shelljs = require('shelljs');
var util = require('gulp-util');
if (shelljs.which('scss-lint') !== null) {
var scssLint = require('gulp-scss-lint');
} else {
var scssLint = util.noop;
util.log(util.colors.red("SCSS linting is disabled"),"to enable this feature please install scss_lint '", util.colors.green("gem install scss_lint"), "'");
}

return function() {

/* define required plugins */
var sourcemaps = require('gulp-sourcemaps');
var util = require('gulp-util');
var sass = require('gulp-sass');
var plumber = require('gulp-plumber');
var autoprefixer = require('gulp-autoprefixer');
var gulpIf = require('gulp-if');
var moreCss = require('gulp-more-css');
var livereload = require('gulp-livereload');
var scssLint = require('gulp-scss-lint');

/* function to run on execution */
return gulp.src(config.sass.src)
Expand Down

0 comments on commit 1db46c9

Please sign in to comment.