<commit_before>'use strict';

var list = [
    'less'
];

function tasks() {

    var that = Object.create(null);

    that.load = function (runner) {

        for (var i = 0; i < list.length; i += 1) {

            runner.use(require('./tasks/' + list[i]));
        }
    };

    return that;
}

module.exports = tasks();<commit_msg>tasks module now dynamically loads all modules from the task directory<commit_after>'use strict';

var fs = require('fs'),
    path = require('path');

function getTaskNames(taskRoot) {

    var paths = fs.readdirSync(taskRoot)
        .filter(function (file) {

            return fs.statSync(path.join(taskRoot, file)).isFile();
        });

    for (var i = 0; i < paths.length; i += 1) {

        paths[i] = path.basename(paths[i]);

    }

    return paths;
}

var list = getTaskNames('./modules/tasks/');

function tasks() {

    var that = Object.create(null);

    that.load = function (runner) {

        for (var i = 0; i < list.length; i += 1) {

            runner.use(require('./tasks/' + list[i]));
        }
    };

    return that;
}

module.exports = tasks();
{'fraction_non_alphanumeric': 0.16396396396396395, 'fraction_numerical': 0.005405405405405406, 'mean_word_length': 2.3463855421686746, 'pattern_counts': {'":': 0, '<': 6, '<?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': '4214023', 'n_tokens_mistral': 372, 'n_tokens_neox': 348, 'n_words': 90}