<commit_before>
exports.name = "sotd.processDocument";
exports.check = function (sr, done) {
    var processDocument = sr.config.processDocument
    ,   $sotd = sr.getSotDSection()
    ,   proc
    ,   procUri;
    if (!$sotd || !$sotd.length) {
        sr.error(exports.name, "no-sotd");
        return done();
    }

    if (processDocument === "20051014") {
        proc = "14 October 2005";
        procUri = "http://www.w3.org/2005/10/Process-20051014/";
    }
    else if (processDocument === "20140801") {
        proc = "1 August 2014";
        procUri = "http://www.w3.org/2014/Process-20140801/";
    }
    else {
        sr.error(exports.name, "not-specified");
        return done();
    }
    var found = false
    ,   boilerplate = "This document is governed by the " + proc + " W3C Process Document.";
    $sotd.parent().find("p").each(function () {
        var $p = sr.$(this);
        if (sr.norm($p.text()) === boilerplate && $p.find("a").attr("href") === procUri) {
            found = true;
            return;
        }
    })
    if (!found) sr.error(exports.name, "not-found", { process: proc });
    done();
};

<commit_msg>clean code + use better selector<commit_after>
exports.name = "sotd.processDocument";
exports.check = function (sr, done) {
    var processDocument = sr.config.processDocument
    ,   $sotd = sr.getSotDSection()
    ,   proc
    ,   procUri;
    if (!$sotd || !$sotd.length) {
        sr.error(exports.name, "no-sotd");
        return done();
    }

    if (processDocument === "20051014") {
        proc = "14 October 2005";
        procUri = "http://www.w3.org/2005/10/Process-20051014/";
    }
    else if (processDocument === "20140801") {
        proc = "1 August 2014";
        procUri = "http://www.w3.org/2014/Process-20140801/";
    }
    else {
        sr.error(exports.name, "not-specified");
        return done();
    }
    var found = false
    ,   boilerplate = "This document is governed by the " + proc + " W3C Process Document.";
    $sotd.parent().find("p").each(function () {
        var $p = sr.$(this);
        if (sr.norm($p.text()) === boilerplate && $p.find("a").attr("href") === procUri) {
            found = true;
            return;
        }
    });
    if (!found) sr.error(exports.name, "not-found", { process: proc });
    done();
};
{'fraction_non_alphanumeric': 0.1780466724286949, 'fraction_numerical': 0.04840103716508211, 'mean_word_length': 2.2242339832869082, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '7188623', 'n_tokens_mistral': 868, 'n_tokens_neox': 775, 'n_words': 160}