<commit_before>var gulp = require('gulp'),
    gulpFilter = require('gulp-filter'),
    mainBowerFiles = require('main-bower-files'),
    rename = require('gulp-rename'),
    uglify = require('gulp-uglify'),
    sass = require('gulp-ruby-sass'),
    concat = require('gulp-concat'),
    minifyCSS = require('gulp-minify-css'),
    bower = require('gulp-bower'),
    fs = require('fs'),
    jade = require('gulp-jade'),
    scsslint = require('gulp-scss-lint'),
    newer = require('gulp-newer'),
    image = require('gulp-image'),
    prefix = require('gulp-autoprefixer'),
    gutil = require('gulp-util'),
    colors = gutil.colors;

var destPath = "dist/";
var srcPath = "src/";


//this will handle errors for us
function handleError(err) {
    console.log(err.toString());
    this.emit('end');
}

//concat, minify js
gulp.task('scripts', function() {
    gulp.src([srcPath + '**/*.js'])
    .pipe(concat('main.js'))
    .pipe(uglify())
    .pipe(gulp.dest(destPath + 'js'))
})

//concat, minify css
gulp.task('styles', function() {
    gulp.src([srcPath + '/sass/**/*.scss'])
    .pipe(sass({
        sourcemap: true,
        sourcemapPath: srcPath + '/sass',
        loadPath: ['bower_components/']
    }))
    .on('error', handleError)
    .pipe(minifyCSS())
    .pipe(prefix())
    .pipe(gulp.dest(destPath + 'css'))
})

// grab libraries files from bower_components, minify and push in /dist
gulp.task('bower', function() {

    var jsFilter = gulpFilter('*.js');
    var cssFilter = gulpFilter('*.css');

    var check = fs.existsSync('./bower_components');
    if (!check) {
        console.log('No bower components installed.');
        return;
    }

    return gulp.src(mainBowerFiles({debugging:true}))

    // grab vendor js files from bower_components, minify and push in /dist
    .pipe(jsFilter)
    .pipe(gulp.dest(destPath + 'js/lib'))
    .pipe(uglify())
    .pipe(rename({
        suffix: ".min"
    }))
    .pipe(gulp.dest(destPath + 'js/lib'))
    .pipe(jsFilter.restore())

    // grab vendor css files from bower_components, minify and push in /dist
    .pipe(cssFilter)
    .pipe(gulp.dest(destPath + 'css/lib'))
    .pipe(minifyCSS())
    .pipe(rename({
        suffix: ".min"
    }))
    .pipe(gulp.dest(destPath + 'css/lib'))
    .pipe(cssFilter.restore())

});

//compile jade files
gulp.task('templates', function() {
    gulp.src(srcPath + 'jade/views/**/*.jade')
    .pipe(jade({
        'basedir': srcPath + 'jade'
    }))
    .pipe(gulp.dest(destPath))
});

//optimize images
gulp.task('img', function () {
  return gulp.src([srcPath + 'img/**'])
  .pipe(newer(destPath + 'img'))
  .pipe(image())
  .pipe(gulp.dest(destPath + 'img'));
});

// linting tasks to check for manifest adherance

var myCustomReporter = function (file) {
    if (!file.scsslint.success) {
        gutil.log(colors.red(file.scsslint.issues.length + ' issues found in ' + file.path));

        file.scsslint.issues.forEach(function (issue) {
            var severity = issue.severity === 'warning' ? 'W' : 'E';
            var logMsg = colors.cyan(file.path) + ':' + colors.magenta(issue.line) + ' [' + severity + '] ' + issue.reason;

            gutil.log(logMsg);
        });
    } else {
        gutil.log(colors.green('Linting passed for ' + file.path));        
    }
}

gulp.task('scss-lint', function() {
    gulp.src(srcPath + '/sass/**/*.scss')
    .pipe(scsslint({
        'config': 'lint.yml',
        'customReport': myCustomReporter
    }));
});

gulp.task('watch', function() {
    gulp.watch(srcPath + 'js/**', ['scripts']);
    gulp.watch(srcPath + 'sass/**', ['scss-lint', 'styles']);
    gulp.watch(srcPath + '**/*.jade', ['templates']);
    gulp.watch(srcPath + 'img/**', ['img']);
})

gulp.task('default', ['scripts', 'styles', 'templates', 'img'])<commit_msg>Fix gulp lint config, remove success messages<commit_after>var gulp = require('gulp'),
    gulpFilter = require('gulp-filter'),
    mainBowerFiles = require('main-bower-files'),
    rename = require('gulp-rename'),
    uglify = require('gulp-uglify'),
    sass = require('gulp-ruby-sass'),
    concat = require('gulp-concat'),
    minifyCSS = require('gulp-minify-css'),
    bower = require('gulp-bower'),
    fs = require('fs'),
    jade = require('gulp-jade'),
    scsslint = require('gulp-scss-lint'),
    newer = require('gulp-newer'),
    image = require('gulp-image'),
    prefix = require('gulp-autoprefixer'),
    gutil = require('gulp-util'),
    colors = gutil.colors;

var destPath = "dist/";
var srcPath = "src/";


//this will handle errors for us
function handleError(err) {
    console.log(err.toString());
    this.emit('end');
}

//concat, minify js
gulp.task('scripts', function() {
    gulp.src([srcPath + '**/*.js'])
    .pipe(concat('main.js'))
    .pipe(uglify())
    .pipe(gulp.dest(destPath + 'js'))
})

//concat, minify css
gulp.task('styles', function() {
    gulp.src([srcPath + '/sass/**/*.scss'])
    .pipe(sass({
        sourcemap: true,
        sourcemapPath: srcPath + '/sass',
        loadPath: ['bower_components/']
    }))
    .on('error', handleError)
    .pipe(minifyCSS())
    .pipe(prefix())
    .pipe(gulp.dest(destPath + 'css'))
})

// grab libraries files from bower_components, minify and push in /dist
gulp.task('bower', function() {

    var jsFilter = gulpFilter('*.js');
    var cssFilter = gulpFilter('*.css');

    var check = fs.existsSync('./bower_components');
    if (!check) {
        console.log('No bower components installed.');
        return;
    }

    return gulp.src(mainBowerFiles({debugging:true}))

    // grab vendor js files from bower_components, minify and push in /dist
    .pipe(jsFilter)
    .pipe(gulp.dest(destPath + 'js/lib'))
    .pipe(uglify())
    .pipe(rename({
        suffix: ".min"
    }))
    .pipe(gulp.dest(destPath + 'js/lib'))
    .pipe(jsFilter.restore())

    // grab vendor css files from bower_components, minify and push in /dist
    .pipe(cssFilter)
    .pipe(gulp.dest(destPath + 'css/lib'))
    .pipe(minifyCSS())
    .pipe(rename({
        suffix: ".min"
    }))
    .pipe(gulp.dest(destPath + 'css/lib'))
    .pipe(cssFilter.restore())

});

//compile jade files
gulp.task('templates', function() {
    gulp.src(srcPath + 'jade/views/**/*.jade')
    .pipe(jade({
        'basedir': srcPath + 'jade'
    }))
    .pipe(gulp.dest(destPath))
});

//optimize images
gulp.task('img', function () {
  return gulp.src([srcPath + 'img/**'])
  .pipe(newer(destPath + 'img'))
  .pipe(image())
  .pipe(gulp.dest(destPath + 'img'));
});

// linting tasks to check for manifest adherance

var myCustomReporter = function (file) {
    if (!file.scsslint.success) {
        gutil.log(colors.red(file.scsslint.issues.length + ' issues found in ' + file.path));

        file.scsslint.issues.forEach(function (issue) {
            var severity = issue.severity === 'warning' ? 'W' : 'E';
            var logMsg = colors.cyan(file.path) + ':' + colors.magenta(issue.line) + ' [' + severity + '] ' + issue.reason;

            gutil.log(logMsg);
        });
    }
}

gulp.task('scss-lint', function() {
    gulp.src(srcPath + '/sass/**/*.scss')
    .pipe(scsslint({
        'config': '.scss-lint.yml',
        'customReport': myCustomReporter
    }));
});

gulp.task('watch', function() {
    gulp.watch(srcPath + 'js/**', ['scripts']);
    gulp.watch(srcPath + 'sass/**', ['scss-lint', 'styles']);
    gulp.watch(srcPath + '**/*.jade', ['templates']);
    gulp.watch(srcPath + 'img/**', ['img']);
})

gulp.task('default', ['scripts', 'styles', 'templates', 'img'])
{'fraction_non_alphanumeric': 0.1993364299933643, 'fraction_numerical': 0.0, 'mean_word_length': 3.0192, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5120383', 'n_tokens_mistral': 2667, 'n_tokens_neox': 2646, 'n_words': 492}