<commit_before>'use strict';
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var argv = require('yargs').argv;
var npm = require('npm');
var fs = require('fs');
var istanbul = require('gulp-istanbul');
var mocha = require('gulp-mocha');

var jsPath = ['./lib/**/*.js'];
var testsPath = ['./tests/**/*.unit.js'];
gulp.task('lint', function () {
    return gulp.src(jsPath)
        .pipe(jshint())
        .pipe(jshint.reporter('default'))
        .pipe(jshint.reporter('fail'));
});

gulp.task('default', ['lint']);

gulp.task('watch', ['lint'], function () {
    gulp.watch(jsPath, ['lint']);
});

gulp.task('tests', function (callback) {
    gulp.src(jsPath)
        .pipe(istanbul({
            includeUntested: true
        }))
        .pipe(istanbul.hookRequire())
        .on('finish', function () {
            gulp.src(testsPath, {
                read: false
            })
                .pipe(mocha({
                    reporter: 'nyan'
                }))
                .pipe(istanbul.writeReports())
                .pipe(istanbul.enforceThresholds({thresholds: {global: 0}})) // Enforce a coverage of at least 0% probably a good idea to change this value
                .on('end', callback);
        });
});

gulp.task('npmPublish', function (callback) {
    var username = argv.username;
    var password = argv.password;
    var email = argv.email;
    if (!username) {
        var usernameError = new Error("Username is required as an argument --username exampleUsername");
        return callback(usernameError);
    }
    if (!password) {
        var passwordError = new Error("Password is required as an argument --password  <PASSWORD>");
        return callback(passwordError);
    }
    if (!email) {
        var emailError = new Error("Email is required as an argument --email <EMAIL>");
        return callback(emailError);
    }
    var uri = "http://registry.npmjs.org/";<commit_msg>hooking lint and tests into the publish<commit_after>'use strict';
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var argv = require('yargs').argv;
var npm = require('npm');
var fs = require('fs');
var istanbul = require('gulp-istanbul');
var mocha = require('gulp-mocha');

var jsPath = ['./lib/**/*.js'];
var testsPath = ['./tests/**/*.unit.js'];
gulp.task('lint', function () {
    return gulp.src(jsPath)
        .pipe(jshint())
        .pipe(jshint.reporter('default'))
        .pipe(jshint.reporter('fail'));
});

gulp.task('default', ['lint', 'tests']);

gulp.task('watch', ['lint', 'tests'], function () {
    gulp.watch(jsPath, ['lint', 'tests']);
});

gulp.task('tests', function (callback) {
    gulp.src(jsPath)
        .pipe(istanbul({
            includeUntested: true
        }))
        .pipe(istanbul.hookRequire())
        .on('finish', function () {
            gulp.src(testsPath, {
                read: false
            })
                .pipe(mocha({
                    reporter: 'nyan'
                }))
                .pipe(istanbul.writeReports())
                .pipe(istanbul.enforceThresholds({thresholds: {global: 0}})) // Enforce a coverage of at least 0% probably a good idea to change this value
                .on('end', callback);
        });
});

gulp.task('npmPublish', ['lint', 'tests'], function (callback) {
    var username = argv.username;
    var password = argv.password;
    var email = argv.email;
    if (!username) {
        var usernameError = new Error("Username is required as an argument --username exampleUsername");
        return callback(usernameError);
    }
    if (!password) {
        var passwordError = new Error("Password is required as an argument --password  <PASSWORD>");
        return callback(passwordError);
    }
    if (!email) {
        var emailError = new Error("Email is required as an argument --email <EMAIL>");
        return callback(emailError);
    }
    var uri = "http://registry.npmjs.org/";
{'fraction_non_alphanumeric': 0.1650559511698881, 'fraction_numerical': 0.001017293997965412, 'mean_word_length': 2.5053475935828877, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3651177', 'n_tokens_mistral': 1198, 'n_tokens_neox': 1161, 'n_words': 290}