<commit_before>var gulp = require('gulp'),
    cover = require('./index'),
    mochaTask = require('gulp-mocha'),
    jshint = require('gulp-jshint'),
    exec = require('child_process').exec,
    jasmineTask = require('gulp-jasmine'),
    through2 = require('through2');

/*
 * Define the dependency arrays
 */

var lintDeps = [],
    testDeps = [],
    debugDeps = [],
    mochaDeps = [],
    jsonDeps = [],
    jasmineDeps = [],
    testchainDeps = []

/*
 * Define the task functions
 */

function synchro (done) {
    return through2.obj(function (data, enc, cb) {
        cb();
    },
    function (cb) {
        cb();
        done();
    });
}

function test () {
    gulp.src(['test/**.js'], { read: false })
        .pipe(mochaTask({
            reporter: 'spec'
        }));
}

function lint (done) {
    gulp.src(['test/**/*.js', 'index.js', 'contrib/cover.js', 'contrib/coverage_store.js', 'contrib/reporters/**/*.js'])
        .pipe(jshint())
        .pipe(jshint.reporter('default')
        .pipe(synchro(done)));
}

function debug (cb) {
    exec('node --debug-brk debug/chaindebug.js', {}, function (error, stdout, stderr) {
        console.log('STDOUT');
        console.log(stdout);
        console.log('STDERR');
        console.log(stderr);
        if (error) {
            console.log('-------ERROR-------');
            console.log(error);
        }
    });
    cb();
}

function mocha (done) {
    gulp.src(['testsupport/src.js', 'testsupport/src3.js'], { read: false })
        .pipe(cover.instrument({
            pattern: ['**/test*'],
            debugDirectory: 'debug'
        }))
        .pipe(mochaTask({
            reporter: 'spec'
        }))
        .pipe(cover.report({
            outFile: 'testoutput/blnkt.html'
        })
        .pipe(synchro(done)));
}

function json (done) {
    gulp.src(['testsupport/src.js', 'testsupprt/src3.js'], { read: false })
        .pipe(cover.instrument({
            pattern: ['**/test*'],
            debugDirectory: 'debug'
        }))
        .pipe(mochaTask({
            reporter: 'spec'
        }))
        .pipe(cover.report({
            reporter: 'json',
            outFile: 'testoutput/json.json'
        })
        .pipe(synchro(done)));
}

function jasmine (done) {
    gulp.src('testsupport/srcjasmine.js')
        .pipe(cover.instrument({
            pattern: ['**/test*']
        }))
        .pipe(jasmineTask())
        .pipe(cover.report({
            outFile: 'testoutput/jasmine.html'
        })
        .pipe(cover.enforce())
        .pipe(synchro(done)));
}

function testchain (done) {
    gulp.src(['testsupport/srcchain.js'], { read: false })
        .pipe(cover.instrument({
            pattern: ['**/chain.js'],
            debugDirectory: 'debug'
        }))
        .pipe(mochaTask({
            reporter: 'spec'
        }))
        .pipe(cover.gather())
        .pipe(cover.format({
            outFile: 'chain.html'
        }))
        .pipe(gulp.dest('./testoutput'))<commit_msg>fix issues with brackets in the gulpfile<commit_after>var gulp = require('gulp'),
    cover = require('./index'),
    mochaTask = require('gulp-mocha'),
    jshint = require('gulp-jshint'),
    exec = require('child_process').exec,
    jasmineTask = require('gulp-jasmine'),
    through2 = require('through2');

/*
 * Define the dependency arrays
 */

var lintDeps = [],
    testDeps = [],
    debugDeps = [],
    mochaDeps = [],
    jsonDeps = [],
    jasmineDeps = [],
    testchainDeps = []

/*
 * Define the task functions
 */

function synchro (done) {
    return through2.obj(function (data, enc, cb) {
        cb();
    },
    function (cb) {
        cb();
        done();
    });
}

function test () {
    gulp.src(['test/**.js'], { read: false })
        .pipe(mochaTask({
            reporter: 'spec'
        }));
}

function lint (done) {
    gulp.src(['test/**/*.js', 'index.js', 'contrib/cover.js', 'contrib/coverage_store.js', 'contrib/reporters/**/*.js'])
        .pipe(jshint())
        .pipe(jshint.reporter('default'))
        .pipe(synchro(done));
}

function debug (cb) {
    exec('node --debug-brk debug/chaindebug.js', {}, function (error, stdout, stderr) {
        console.log('STDOUT');
        console.log(stdout);
        console.log('STDERR');
        console.log(stderr);
        if (error) {
            console.log('-------ERROR-------');
            console.log(error);
        }
    });
    cb();
}

function mocha (done) {
    gulp.src(['testsupport/src.js', 'testsupport/src3.js'], { read: false })
        .pipe(cover.instrument({
            pattern: ['**/test*'],
            debugDirectory: 'debug'
        }))
        .pipe(mochaTask({
            reporter: 'spec'
        }))
        .pipe(cover.gather())
        .pipe(cover.format({
            outFile: 'blnkt.html'
        }))
        .pipe(gulp.dest('./testoutput'))
        .pipe(synchro(done));
}

function json (done) {
    gulp.src(['testsupport/src.js', 'testsupprt/src3.js'], { read: false })
        .pipe(cover.instrument({
            pattern: ['**/test*'],
            debugDirectory: 'debug'
        }))
        .pipe(mochaTask({
            reporter: 'spec'
        }))
        .pipe(cover.report({
            reporter: 'json',
            outFile: 'testoutput/json.json'
        }))
        .pipe(synchro(done));
}

function jasmine (done) {
    gulp.src('testsupport/srcjasmine.js')
        .pipe(cover.instrument({
            pattern: ['**/test*']
        }))
        .pipe(jasmineTask())
        .pipe(cover.gather())
        .pipe(cover.format({
            outFile: 'jasmine.html'
        }))
        .pipe(gulp.dest('./testoutput'))
        .pipe(synchro(done));
}

gulp.task('test', function() {
  // Be sure to return the stream
});

function testchain (done) {
    gulp.src(['testsupport/srcchain.js'], { read: false })
        .pipe(cover.instrument({
            pattern: ['**/chain.js'],
            debugDirectory: 'debug'
        }))
        .pipe(mochaTask({
            reporter: 'spec'
        }))
        .pipe(cover.gather())
        .pipe(cover.format({
            outFile: 'chain.html'
        }))
        .pipe(gulp.dest('./testoutput'))
{'fraction_non_alphanumeric': 0.1886577835554111, 'fraction_numerical': 0.0016249593760155996, 'mean_word_length': 1.9435676709708274, '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': '4684595', 'n_tokens_mistral': 2005, 'n_tokens_neox': 1967, 'n_words': 324}