<commit_before>'use strict';

var util = require('util');

module.exports = {
    name: 'spaceAfterPropertyColon',
    nodeTypes: ['decl'],
    message: {
        'no_space': 'Colon after property name should not be followed by any spaces.',
        'one_space': 'Colon after property name should be followed by one space.',
        'at_least_one_space': 'Colon after property name should be followed by at least one space.'
    },

    lint: function spaceAfterPropertyColonLinter (config, node) {
        // Find the colon (south of the spleen)

        var styles = {
            'no_space': /^\s*:$/,
            'one_space': /^\s*:\s$/,
            'at_least_one_space': /^\s*:\s{1,}$/
        };

        if (config.style && !styles[config.style]) {
            throw new Error('Invalid setting value for spaceAfterPropertyColon: ' + config.style);
        }

        if (!styles[config.style].test(node.raws.between)) {
            return [{
                column: node.source.start.column + node.prop.length + 1,
                line: node.source.start.line,
                message: util.format(this.message[config.style])
            }];
        }
    }
};<commit_msg>Fixed column reporting in spaceAfterPropertyColon<commit_after>'use strict';

var util = require('util');

module.exports = {
    name: 'spaceAfterPropertyColon',
    nodeTypes: ['decl'],
    message: {
        'no_space': 'Colon after property name should not be followed by any spaces.',
        'one_space': 'Colon after property name should be followed by one space.',
        'at_least_one_space': 'Colon after property name should be followed by at least one space.'
    },

    lint: function spaceAfterPropertyColonLinter (config, node) {
        // Find the colon (south of the spleen)

        var styles = {
            'no_space': /^\s*:$/,
            'one_space': /^\s*:\s$/,
            'at_least_one_space': /^\s*:\s{1,}$/
        };

        if (config.style && !styles[config.style]) {
            throw new Error('Invalid setting value for spaceAfterPropertyColon: ' + config.style);
        }

        if (!styles[config.style].test(node.raws.between)) {
            return [{
                column: node.source.start.column + node.prop.length + node.raws.between.indexOf(':') + 1,
                line: node.source.start.line,
                message: util.format(this.message[config.style])
            }];
        }
    }
};
{'fraction_non_alphanumeric': 0.13638236505974455, 'fraction_numerical': 0.0016481252575195715, 'mean_word_length': 2.1863517060367452, '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': '514808', 'n_tokens_mistral': 717, 'n_tokens_neox': 690, 'n_words': 183}