<commit_before>const postcss = require('postcss');
const StyleStats = require('stylestats');
const Format = require('stylestats/lib/format');

const type = 'stylestats';
const plugin = 'postcss-stylestats';

module.exports = postcss.plugin(plugin, (opts) => {
    opts = opts || {};

    return (root, result) => {
        const styleStats = new StyleStats(root.source.input.css, opts);

        return styleStats.parse((error, stats) => {
            if (error !== null) {
                console.error(error.stack);
                return root;
            }

            var format = new Format(stats);
            var method;

            switch (opts.type) {
            case 'json':
                method = 'toJSON';
                break;
            case 'csv':
                method = 'toCSV';
                break;
            case 'html':
                method = 'toHTML';
                break;<commit_msg>refactor(index): remove CSV format support for output stats<commit_after>const postcss = require('postcss');
const StyleStats = require('stylestats');
const Format = require('stylestats/lib/format');

const type = 'stylestats';
const plugin = 'postcss-stylestats';

module.exports = postcss.plugin(plugin, (opts) => {
    opts = opts || {};

    return (root, result) => {
        const styleStats = new StyleStats(root.source.input.css, opts);

        return styleStats.parse((error, stats) => {
            if (error !== null) {
                console.error(error.stack);
                return root;
            }

            var format = new Format(stats);
            var method;

            switch (opts.type) {
            case 'json':
                method = 'toJSON';
                break;
            case 'html':
                method = 'toHTML';
                break;
{'fraction_non_alphanumeric': 0.12548369264787176, 'fraction_numerical': 0.0, 'mean_word_length': 1.7591463414634145, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5459753', 'n_tokens_mistral': 502, 'n_tokens_neox': 477, 'n_words': 121}