<commit_before>/* global target, find, echo, exec, exit */

"use strict";
/*eslint-disable vars-on-top */
require("shelljs/make");

var eslint = require("eslint").cli;
var nodeCli = require("shelljs-nodecli");
var jsFiles = find("lib/").filter(fileType("js")).join(" ");
var jsTestFiles = find("tests/").filter(fileType("js")).join(" ");
var nodeModules = "./node_modules/";
var mocha = nodeModules + "mocha/bin/_mocha ";
var jsdoc = "jsdoc -c ./conf.json ";
/*eslint-enable vars-on-top */

/**
 * Generates a function that matches files with a particular extension.
 * @param {string} extension The file extension (i.e. "js")
 * @returns {Function} The function to pass into a filter method.
 * @private
 */
function fileType(extension){
    return function(filename){
        return filename.substring(filename.lastIndexOf(".") + 1) === extension;
    };
}

function release(type){
    exec("echo Bumping up the version");
    exec("npm version " + type);

    exec("echo Commiting master with tags");
    exec("git push origin --tags");

    exec("echo Publish on NPM");
    exec("npm publish");

    exec("echo Operation done.");
}

target.test = function(){
    var errors = 0;
    var lastRun;

    target.lint();

    echo("Running Mocha tests");
    lastRun = nodeCli.exec("istanbul", "cover", mocha, "-- -c", jsTestFiles);
    if(lastRun.code !== 0){
        errors++;
    }

    lastRun = nodeCli.exec("istanbul", "check-coverage", "--statement 98 --branch 90 --function 99 --lines 98");
    if(lastRun.code !== 0){
        errors++;
    }

    if(errors){
        exit(1);
    }
};<commit_msg>Fix: Error in package json version update<commit_after>/* global target, find, echo, exec, exit */

"use strict";
/*eslint-disable vars-on-top */
require("shelljs/make");

var eslint = require("eslint").cli;
var nodeCli = require("shelljs-nodecli");
var jsFiles = find("lib/").filter(fileType("js")).join(" ");
var jsTestFiles = find("tests/").filter(fileType("js")).join(" ");
var nodeModules = "./node_modules/";
var mocha = nodeModules + "mocha/bin/_mocha ";
var jsdoc = "jsdoc -c ./conf.json ";
/*eslint-enable vars-on-top */

/**
 * Generates a function that matches files with a particular extension.
 * @param {string} extension The file extension (i.e. "js")
 * @returns {Function} The function to pass into a filter method.
 * @private
 */
function fileType(extension){
    return function(filename){
        return filename.substring(filename.lastIndexOf(".") + 1) === extension;
    };
}

function release(type){
    exec("echo Bumping up the version");
    exec("npm version " + type);

    exec("echo Commiting master with tags");
    exec("git add package.json");
    exec("git commit --amend --no-edit");
    exec("git push origin --tags");

    exec("echo Publish on NPM");
    exec("npm publish");

    exec("echo Operation done.");
}

target.test = function(){
    var errors = 0;
    var lastRun;

    target.lint();

    echo("Running Mocha tests");
    lastRun = nodeCli.exec("istanbul", "cover", mocha, "-- -c", jsTestFiles);
    if(lastRun.code !== 0){
        errors++;
    }

    lastRun = nodeCli.exec("istanbul", "check-coverage", "--statement 98 --branch 90 --function 99 --lines 98");
    if(lastRun.code !== 0){
        errors++;
    }

    if(errors){
        exit(1);
    }
};
{'fraction_non_alphanumeric': 0.17783816425120774, 'fraction_numerical': 0.00785024154589372, 'mean_word_length': 3.3138020833333335, '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': '2697047', 'n_tokens_mistral': 1070, 'n_tokens_neox': 1019, 'n_words': 291}