<commit_before>var gulp       = require('gulp');
var gutil      = require('gulp-util');

var cssConcat  = require('gulp-concat-css');
var jshint     = require('gulp-jshint');
var stylish    = require('jshint-stylish');
var beautify   = require('gulp-js-prettify');

var browserify = require('browserify');
var source = require('vinyl-source-stream');
var AtomShellDownload = require('atom-shell-pull');

var connect = require('connect');
var http    = require('http');
var path    = require('path');
var fs      = require('fs');

var JS_FILES = ['app/js/**/*.js'];
var packageJson = require(path.join(__dirname, 'package.json'));

gulp.task('lint', ['code-clean'], function() {
    gulp.src(JS_FILES)
        // Note: the following options need to be enabled sometime later:
        // ~> es3 : true
        // ~> quotmark : 'single'
        // ~> unused : true

        // Note JSHint finds configuration options in the .jshintrc
        .pipe(jshint())
        .pipe(jshint.reporter(stylish))
        .pipe(jshint.reporter('fail'));
});

gulp.task('code-build', ['code-clean'], function() {
    process.env.NODE_PATH = path.join(__dirname, 'app')

    browserify('./app/js/main.js')
        .bundle({
            insertGlobals : true,
            ignoreMissing : true // For things like 'remote' which are atom-shell only.
        })
        .pipe(source('application.js'))
        .pipe(gulp.dest('./public/dist'));

    gulp.src('app/css/styles.css')
        .pipe(cssConcat(''))
        .pipe(gulp.dest('public/dist/styles.css'))

    // TODO: now we bundle all the Handlebars templates into one file.

});

gulp.task('code-clean', function () {
    gulp.src(JS_FILES)
        .pipe(beautify({
            preserve_newlines : false,
            jslint_happy : true,
            break_chained_methods : true,
            good_stuff : true
        }))
        .pipe(gulp.dest('app/js'));
});<commit_msg>Avoid race conditions by not running clean before lint and build.<commit_after>var gulp       = require('gulp');
var gutil      = require('gulp-util');

var cssConcat  = require('gulp-concat-css');
var jshint     = require('gulp-jshint');
var stylish    = require('jshint-stylish');
var beautify   = require('gulp-js-prettify');

var browserify = require('browserify');
var source = require('vinyl-source-stream');
var AtomShellDownload = require('atom-shell-pull');

var connect = require('connect');
var http    = require('http');
var path    = require('path');
var fs      = require('fs');

var JS_FILES = ['app/js/**/*.js'];
var packageJson = require(path.join(__dirname, 'package.json'));

gulp.task('lint', function() {
    gulp.src(JS_FILES)
        // Note: the following options need to be enabled sometime later:
        // ~> es3 : true
        // ~> quotmark : 'single'
        // ~> unused : true

        // Note JSHint finds configuration options in the .jshintrc
        .pipe(jshint())
        .pipe(jshint.reporter(stylish))
        .pipe(jshint.reporter('fail'));
});

gulp.task('code-build', function() {
    process.env.NODE_PATH = path.join(__dirname, 'app')

    browserify('./app/js/main.js')
        .bundle({
            insertGlobals : true,
            ignoreMissing : true // For things like 'remote' which are atom-shell only.
        })
        .pipe(source('application.js'))
        .pipe(gulp.dest('./public/dist'));

    gulp.src('app/css/styles.css')
        .pipe(cssConcat(''))
        .pipe(gulp.dest('public/dist/styles.css'))

    // TODO: now we bundle all the Handlebars templates into one file.

});

gulp.task('code-clean', function () {
    gulp.src(JS_FILES)
        .pipe(beautify({
            preserve_newlines : false,
            jslint_happy : true,
            break_chained_methods : true,
            good_stuff : true
        }))
        .pipe(gulp.dest('app/js'));
});
{'fraction_non_alphanumeric': 0.16362212943632568, 'fraction_numerical': 0.0005219206680584551, 'mean_word_length': 2.6297348484848486, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6287407', 'n_tokens_mistral': 1221, 'n_tokens_neox': 1200, 'n_words': 260}