<commit_before>/*global phantom, CasperError, patchRequire, console, require:true, casper:true*/

var EX_OK = 0,
    EX_USAGE = 64;

if (!phantom.casperLoaded) {
    console.log('This script must be invoked using the casperjs executable');
    phantom.exit(EX_USAGE);
}

var fs           = require('fs');
var utils        = require('utils');
var f            = utils.format;
var tests        = [];
var casper       = require('casper').create({
    exitOnError: false
});

casper.specter = {
    rebase: false,
    baseline: casper.cli.get('baseline'),
    diffbase: casper.cli.get('diffdir'),
    failbase: casper.cli.get('faildir')
};

function checkArgs() {
    "use strict";
    // parse some options from cli
    casper.test.options.concise = true;
    casper.test.options.failFast = casper.cli.get('fail-fast') || false;

    if (casper.cli.get('rebase') === true) {
        casper.specter.rebase = true;
    }
    if (casper.cli.get('specter-path')) {
        casper.specter.lib = casper.cli.get('specter-path');
    }

    // test paths are passed as args
    if (casper.cli.args.length) {
        tests = casper.cli.args.filter(function(path) {
            if (fs.isFile(path) || fs.isDirectory(path)) {
                return true;
            }
            throw new CasperError(f("Invalid test path: %s", path));
        });
    } else {
        casper.echo('No test path passed, exiting.', 'RED_BAR', 80);
        casper.exit(EX_USAGE);
    }
}

function initRunner() {<commit_msg>add --no-color option<commit_after>/*global phantom, CasperError, patchRequire, console, require:true, casper:true*/

var EX_OK = 0,
    EX_USAGE = 64;

if (!phantom.casperLoaded) {
    console.log('This script must be invoked using the casperjs executable');
    phantom.exit(EX_USAGE);
}

var fs           = require('fs');
var utils        = require('utils');
var colorizer    = require('colorizer');
var f            = utils.format;
var tests        = [];
var casper       = require('casper').create({
    exitOnError: false
});

casper.specter = {
    rebase: false,
    baseline: casper.cli.get('baseline'),
    diffbase: casper.cli.get('diffdir'),
    failbase: casper.cli.get('faildir')
};

function checkArgs() {
    "use strict";
    // parse some options from cli
    if (casper.cli.get('no-color') === true) {
        var cls = 'Dummy';
        casper.options.colorizerType = cls;
        casper.colorizer = colorizer.create(cls);
    }
    casper.test.options.concise = true;
    casper.test.options.failFast = casper.cli.get('fail-fast') || false;

    if (casper.cli.get('rebase') === true) {
        casper.specter.rebase = true;
    }
    if (casper.cli.get('specter-path')) {
        casper.specter.lib = casper.cli.get('specter-path');
    }

    // test paths are passed as args
    if (casper.cli.args.length) {
        tests = casper.cli.args.filter(function(path) {
            if (fs.isFile(path) || fs.isDirectory(path)) {
                return true;
            }
            throw new CasperError(f("Invalid test path: %s", path));
        });
    } else {
        casper.echo('No test path passed, exiting.', 'RED_BAR', 80);
        casper.exit(EX_USAGE);
    }
}

function initRunner() {
{'fraction_non_alphanumeric': 0.15238392022436897, 'fraction_numerical': 0.0031162355874104083, 'mean_word_length': 2.5197368421052633, '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': '7083661', 'n_tokens_mistral': 1082, 'n_tokens_neox': 1053, 'n_words': 225}