<commit_before>var lodash = require('lodash'),
    Linter = require('./linter');

/**
 * The htmllint namespace.
 * @namespace
 */
var htmllint = function () {
    var linter = htmllint.defaultLinter;

    return linter.lint.apply(linter, arguments);
};
htmllint.defaultLinter = new Linter(htmllint.rules);

module.exports = htmllint;

htmllint.Linter = Linter;
htmllint.rules = require('./rules');

htmllint.create = function (rules) {
    var newRules = {};
    rules.forEach(function (rule) {
        if (lodash.isString(rule)) {
            // if the rule is a string, resolve the name
            newRules[rule] = htmllint.rules[rule];
        } else {
            newRules[rule.name] = rule;
        }
    });

    return new Linter(newRules);
};<commit_msg>fixed last commit, rules weren't registered on default linter<commit_after>var lodash = require('lodash'),
    Linter = require('./linter');

/**
 * The htmllint namespace.
 * @namespace
 */
var htmllint = function () {
    var linter = htmllint.defaultLinter;

    return linter.lint.apply(linter, arguments);
};

module.exports = htmllint;

htmllint.Linter = Linter;
htmllint.rules = require('./rules');
htmllint.defaultLinter = new Linter(htmllint.rules);

htmllint.create = function (rules) {
    var newRules = {};
    rules.forEach(function (rule) {
        if (lodash.isString(rule)) {
            // if the rule is a string, resolve the name
            newRules[rule] = htmllint.rules[rule];
        } else {
            newRules[rule.name] = rule;
        }
    });

    return new Linter(newRules);
};
{'fraction_non_alphanumeric': 0.1383248730964467, 'fraction_numerical': 0.0, 'mean_word_length': 2.8557457212713935, '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': '2071126', 'n_tokens_mistral': 529, 'n_tokens_neox': 509, 'n_words': 114}