<commit_before>/**
 * @file rule: style-content
 * @author nighca<<EMAIL>>
 */

var util = require('../util');

module.exports = {

    name: 'style-content',

    desc: 'Content of <style> must meet standard.',

    lint: function (getCfg, document, reporter, code) {
        document.getElementsByTagName('style').forEach(function (style) {
            if (!getCfg(style)) {
                return;
            }

            var linters = getCfg('linters');
            var linter = linters && linters.style;
            if (typeof linter !== 'function') {
                return;
            }

            if (!style.childNodes.length) {
                return;
            }

            var textNode = style.childNodes[0];
            var indent = (function (content) {
                return content.slice(content.lastIndexOf('\n') + 1);
            })(code.slice(0, style.startIndex));

            linter(<commit_msg>debug rule style-content<commit_after>/**
 * @file rule: style-content
 * @author nighca<<EMAIL>>
 */

var util = require('../util');

module.exports = {

    name: 'style-content',

    desc: 'Content of <style> must meet standard.',

    lint: function (getCfg, document, reporter, code) {
        document.getElementsByTagName('style').forEach(function (style) {
            if (!getCfg(style)) {
                return;
            }

            var linters = getCfg(style, 'linters');
            var linter = linters && linters.style;
            if (typeof linter !== 'function') {
                return;
            }

            if (!style.childNodes.length) {
                return;
            }

            var textNode = style.childNodes[0];
            var indent = (function (content) {
                return content.slice(content.lastIndexOf('\n') + 1);
            })(code.slice(0, style.startIndex));

            linter(
{'fraction_non_alphanumeric': 0.13782051282051283, 'fraction_numerical': 0.003205128205128205, 'mean_word_length': 1.7423133235724744, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '7289460', 'n_tokens_mistral': 532, 'n_tokens_neox': 504, 'n_words': 118}