<commit_before>"use strict";

var browserify = require("browserify");
var buffer = require("vinyl-buffer");
var gulp = require("gulp");
var jshint = require("gulp-jshint");
var path = require("path");
var rename = require("gulp-rename");
var source = require("vinyl-source-stream");
var sourcemaps = require("gulp-sourcemaps");
var uglify = require("gulp-uglify");

var config = require("../config");
var getSources = require("../util/getSources");
var handleErrors = require("../util/handleErrors");
var sources = [path.join(config.root, "js", "**", "*.js")];

gulp.task("js", ["jshint", "browserify", "uglify"]);

gulp.task("jshint", function() {
    return gulp.src(sources.concat(getSources(config.excludedFolders, true)))
    .pipe(jshint())
    .pipe(jshint.reporter("jshint-stylish"))
    .pipe(jshint.reporter("fail"))
    .on("error", handleErrors.warning);
});

gulp.task("browserify", ["jshint"], function() {

    var b = browserify({
        entries: path.join(config.root, "js", "main.js"),
        debug: true
    });

    return b.bundle()
    .pipe(source("main.js"))
    .pipe(buffer())
    .pipe(sourcemaps.init({loadMaps: true}))
    .on("error", handleErrors.warning)
    .pipe(sourcemaps.write("../maps"))
    .pipe(gulp.dest(path.join(config.buildPath(), "js")));
});

gulp.task("uglify", ["browserify"], function() {
    return gulp.src(path.join(config.buildPath(), "js", "main.js"))
    .pipe(uglify())
    .pipe(rename("main-min.js"))
    .pipe(gulp.dest(path.join(config.buildPath(), "js")));
});<commit_msg>Replaced jshint with eslint<commit_after>'use strict';

var browserify = require('browserify');
var buffer = require('vinyl-buffer');
var gulp = require('gulp');
var eslint = require('gulp-eslint');
var path = require('path');
var rename = require('gulp-rename');
var source = require('vinyl-source-stream');
var sourcemaps = require('gulp-sourcemaps');
var uglify = require('gulp-uglify');

var config = require('../config');
var getSources = require('../util/getSources');
var handleErrors = require('../util/handleErrors');
var sources = [path.join(config.root, 'js', '**', '*.js')];

gulp.task('js', ['uglify']);

gulp.task('eslint', function() {
    return gulp.src(sources.concat(getSources(config.excludedFolders, true)))
    .pipe(eslint())
    .pipe(eslint.format())
    .pipe(eslint.failAfterError());
});

gulp.task('browserify', ['eslint'], function() {

    var b = browserify({
        entries: path.join(config.root, 'js', 'main.js'),
        debug: true
    });

    return b.bundle()
    .pipe(source('main.js'))
    .pipe(buffer())
    .pipe(sourcemaps.init({loadMaps: true}))
    .on('error', handleErrors.warning)
    .pipe(sourcemaps.write('../maps'))
    .pipe(gulp.dest(path.join(config.buildPath(), 'js')));
});

gulp.task('uglify', ['browserify'], function() {
    return gulp.src(path.join(config.buildPath(), 'js', 'main.js'))
    .pipe(uglify())
    .pipe(rename('main-min.js'))
    .pipe(gulp.dest(path.join(config.buildPath(), 'js')));
});
{'fraction_non_alphanumeric': 0.221630615640599, 'fraction_numerical': 0.0, 'mean_word_length': 4.51559633027523, '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': '7082357', 'n_tokens_mistral': 1039, 'n_tokens_neox': 1034, 'n_words': 181}