<commit_before>var gulp        = require('gulp'),
    less        = require('gulp-less'),
    browserify  = require('browserify'),
    sourcemaps  = require('gulp-sourcemaps'),
    gutil       = require('gulp-util'),
    source      = require('vinyl-source-stream'),
    buffer      = require('vinyl-buffer'),
    mocha       = require('mocha'),
    uglify      = require('gulp-uglify'),
    watchify    = require('watchify'),
    minifyCSS   = require('gulp-minify-css'),
    browserSync = require('browser-sync').create();

/**
* runs tests in the specified folder
*/
gulp.task('mocha', function() {
    return gulp.src(['test/*.js'], { read: false })
        .pipe(mocha({ reporter: 'list' }))
        .on('error', gutil.log);
});

/**
 * watches test files and re-runs the tests if the files change
 */
gulp.task('watch-mocha', function() {
    gulp.watch(['js/**', 'test/**'], ['mocha']);
});

/**
 * Bundles and uglifys the JS
 */
var b = watchify(browserify({
  debug: true
  }));
gulp.task('js', bundle);

function bundle() {
  return b.bundle()
    // log errors if they happen
    .on('error', gutil.log.bind(gutil, 'Browserify Error'))
    .pipe(source('js/main.js'))
    // optional, remove if you don't need to buffer file contents
    .pipe(buffer())
    // optional, remove if you dont want sourcemaps
    .pipe(sourcemaps.init({loadMaps: true})) // loads map from browserify file
    // Add transformation tasks to the pipeline here.
    .pipe(uglify()).on('error', gutil.log)
    .pipe(sourcemaps.write('./')) // writes .map file
    //uglify
    .pipe(gulp.dest('./../dist/bundle.js'));
}

// create a task that ensures the `js` task is complete before
// reloading browsers
gulp.task('js-watch', ['js'], browserSync.reload);

gulp.task('serve', ['less', 'js'], function() {

    browserSync.init({
        server: "./"
    });

    gulp.watch("./less/**/*.less", ['less']);
    gulp.watch("./js/*.js", ['js-watch']);
    gulp.watch("./*.html").on('change', browserSync.reload);
});

/*
Compiles less but excludes partials starting with underscore, e.g. _loader.less
 */
gulp.task('less', function() {
  return gulp.src(['./less/**/*.less', '!./less/**/_*'])
      .pipe(less())
      .pipe(minifyCSS())
      .pipe(gulp.dest('./dist'))
      .pipe(browserSync.stream());
});


gulp.task('default', [
//  'connect',
//  'watch-mocha',
  'serve',
  'js'
]);
<commit_msg>created two gulp tasks: gulp dev can be used for development (launches browser) while gulp (the default) just builds the project. Also removed mocha tasks asthey were erroring and can be run externally correctly<commit_after>var gulp        = require('gulp'),
    less        = require('gulp-less'),
    sourcemaps  = require('gulp-sourcemaps'),
    gutil       = require('gulp-util'),
    minifyCSS   = require('gulp-minify-css'),
    uglify      = require('gulp-uglify'),
    watchify    = require('watchify'),
    browserify  = require('browserify'),
    browserSync = require('browser-sync').create(),
    source      = require('vinyl-source-stream'),
    buffer      = require('vinyl-buffer');


/*
 * Bundles and uglifys the JS
 */
var b = watchify(browserify({
  debug: true
  }));
gulp.task('js', bundle);

function bundle() {
  return b.bundle()
    // log errors if they happen
    .on('error', gutil.log.bind(gutil, 'Browserify Error'))
    .pipe(source('js/main.js'))
    // optional, remove if you don't need to buffer file contents
    .pipe(buffer())
    // optional, remove if you dont want sourcemaps
    .pipe(sourcemaps.init({loadMaps: true})) // loads map from browserify file
    // Add transformation tasks to the pipeline here.
    .pipe(uglify()).on('error', gutil.log)
    .pipe(sourcemaps.write('./')) // writes .map file
    //uglify
    .pipe(gulp.dest('./../dist/bundle.js'));
}

// create a task that ensures the `js` task is complete before
// reloading browsers
gulp.task('js-watch', ['js'], browserSync.reload);

/*
This is the one that makes a live server with autorefresh for all your debuggy needs.
 */
gulp.task('serve', ['less', 'js'], function() {

    browserSync.init({
        server: "./"
    });

    gulp.watch("./less/**/*.less", ['less']);
    gulp.watch("./js/*.js", ['js-watch']);
    gulp.watch("./*.html").on('change', browserSync.reload);
});

/*
Compiles less but excludes partials starting with underscore, e.g. _loader.less
 */
gulp.task('less', function() {
  return gulp.src(['./less/**/*.less', '!./less/**/_*'])
      .pipe(less())
      .pipe(minifyCSS())
      .pipe(gulp.dest('./dist'))
      .pipe(browserSync.stream());
});

//These are the tasks most likely to be run by a user?

/*
starts server for dev use
 */
gulp.task('dev', [
  'serve', //includes css
  'js'
]);


/*
Build for prod use
 */
gulp.task('default', [
  'less',
  'js'
]);

{'fraction_non_alphanumeric': 0.1940329647402462, 'fraction_numerical': 0.0, 'mean_word_length': 2.9817275747508307, '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': '444571', 'n_tokens_mistral': 1570, 'n_tokens_neox': 1543, 'n_words': 390}