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

var path = require('path');

// this gulpfile uses gulp-load-plugins to load plugins, which saves
// having to load everything separately.
// info: https://github.com/jackfranklin/gulp-load-plugins
var plugins = require('gulp-load-plugins')();

// paths this project uses
var cssSourcePaths = [
    'climasng/src/css/page-*.less'
];
var jsSourcePaths = [
    'climasng/src/js/page-*.js'
];
var jsLintablePaths = jsSourcePaths.concat([
    'gulpfile.js'
]);
var coffeeSourcePaths = [
    'climasng/src/js/oldreports/**/*.coffee'
];

// returns a string consisting of prefix + filePath + postfix,
// with nice colours highlighting the filepath.
function colorFileMsg(prefix, filePath, postfix) {
    return (
        gutil.colors.gray(prefix) +
        gutil.colors.magenta(path.dirname(filePath) + '/') +
        gutil.colors.bold.magenta(path.basename(filePath)) +
        gutil.colors.gray(postfix)
    );
}

// **returns a function** that when invoked with an event argument,
// logs a nice message saying that the event will be handled.
// Arg 'message' is what to say instead of "Handled" in the message.
function adviseOfEvent(message) {
    return (function(event) {
        var msg = message || 'Handling';
        gutil.log(colorFileMsg(msg + ' ', event.path, ' for you...'));
    });
}

// ----------------------------------------------------- default task
gulp.task('default', ['build', 'watch'], function() {
    console.log('Running the default task.');
    console.log('This will watch your files and do all the ' +
        'necessary compilation etc.');
    console.log(
        'If this is not what you expected, you should press ' +
        'Ctrl+c to quit this, then run "gulp tasks" to see ' +
        'what else you can do.'
    );
});

// --------------------------------------------- build ALL the things<commit_msg>gulp taskrunner improvements<commit_after>var gulp = require('gulp');
var gutil = require('gulp-util');

var path = require('path');

// this gulpfile uses gulp-load-plugins to load plugins, which saves
// having to load everything separately.
// info: https://github.com/jackfranklin/gulp-load-plugins
var plugins = require('gulp-load-plugins')();

// paths this project uses
var cssSourcePaths = [
    'climasng/src/css/page-*.less'
];
var jsSourcePaths = [
    'climasng/src/js/page-*.js'
];
var jsLintablePaths = jsSourcePaths.concat([
    'gulpfile.js'
]);
var coffeeSourcePaths = [
    'climasng/src/js/oldreports/**/*.coffee'
];

// returns a string consisting of prefix + filePath + postfix,
// with colour highlighting of the filepath.
function colorFileMsg(prefix, filePath, postfix) {
    // maybe a relative path is clearer..
    var nicePath = path.relative('.', filePath);
    if (nicePath.substr(0,2) === '..') {
        nicePath = filePath;
    }
    return (
        gutil.colors.gray(prefix + path.dirname(nicePath) + '/') +
        gutil.colors.magenta(path.basename(nicePath)) +
        gutil.colors.gray(postfix)
    );
}

// **returns a function** that when invoked with an event argument,
// logs a nice message saying that the event will be handled.
// Arg 'message' is what to say instead of "Handled" in the message.
function adviseOfEvent(message) {
    return (function(event) {
        var msg = message || 'Handling';
        gutil.log(colorFileMsg(msg + ' ', event.path, ' for you...'));
    });
}

// ----------------------------------------------------- default task
gulp.task('default', ['build', 'watch'], function() {
    console.log('Running the default task.');
    console.log('This will watch your files and do all the ' +
        'necessary compilation etc.');
    console.log(
        'If this is not what you expected, you should press ' +
        'Ctrl+c to quit this, then run "gulp tasks" to see ' +
        'what else you can do.'
    );
});

// --------------------------------------------- build ALL the things
{'fraction_non_alphanumeric': 0.18545546049320583, 'fraction_numerical': 0.0005032712632108706, 'mean_word_length': 2.5618279569892475, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '1738683', 'n_tokens_mistral': 1174, 'n_tokens_neox': 1167, 'n_words': 345}