<commit_before>module.exports = function(grunt) {
    var sass = require('sass');

    var preprocessors = {};
    if (!process.env.SKIP_COVERAGE) {
        preprocessors["<%= dirs.js %>/src/*.js"] = ["coverage"];
    }

    grunt.initConfig({
        pkg: grunt.file.readJSON("package.json"),
        dirs: {
            build: "frontend/build",
            css: "frontend/css",
            js: "frontend/js",
            static: "inboxen/static/compiled",
            thirdparty: "node_modules",
        },
        clean: {
            build: ["<%= dirs.build %>", "<%= dirs.static %>"],
        },
        copy: {
            fonts: {
                expand: true,
                nonull: true,
                flatten: true,
                src: "<%= dirs.thirdparty %>/font-awesome/fonts/*",
                dest: "<%= dirs.static %>/fonts/",
            }
        },
        concat: {
            options: {
                sourceMap: true,
            },
            website: {
                src: [
                    "<%= dirs.thirdparty %>/jquery/dist/jquery.js",
                    "<%= dirs.js %>/src/utils.js",
                    "<%= dirs.js %>/src/copy.js",
                    "<%= dirs.js %>/src/alert.js",
                    "<%= dirs.js %>/src/home.js",
                    "<%= dirs.js %>/src/search.js",
                    "<%= dirs.js %>/src/inbox.js",
                ],
                dest: "<%= dirs.build %>/src/website.js",
                nonnull: true
            },
            stats: {
                src: [
                    "<%= dirs.thirdparty %>/patternomaly/dist/patternomaly.js",
                    "<%= dirs.thirdparty %>/chart.js/dist/Chart.js",
                    "<%= dirs.js %>/src/stats.js",
                ],
                dest: "<%= dirs.build %>/src/stats.js",
                nonnull: true
            }
        },
        uglify: {
            options: {
                mangle: true,
                compress: true,
                sourceMap: {
                    includeSources: true
                },
                output: {
                    comments: /^!/
                }
            },
            website: {
                src: ["<%= dirs.build %>/src/website.js"],
                dest: "<%= dirs.static %>/website.min.js"
            },
            stats: {
                src: ["<%= dirs.build %>/src/stats.js"],
                dest: "<%= dirs.static %>/stats.min.js"
            }
        },
        sass: {
            options: {
                implementation: sass,
                outputStyle: "compressed",
                includePaths: ["<%= dirs.thirdparty %>"],
                sourceMap: true,
                sourceMapContents: true,
                sourceMapEmbed: false
            },
            publicCss: {
                src: ["<%= dirs.css %>/inboxen.scss"],
                dest: "<%= dirs.static %>/website.css"
            }
        },
        karma: {
            options: {
                client: {
                    jasmine: {
                        random: true,
                        stopSpecOnExpectationFailure: false
                    }
                },
                configFile: "karma.conf.js",
                preprocessors: preprocessors,
                files: [
                    {
                        pattern: "<%= dirs.js %>/data/*.html",
                        type: "dom"
                    },
                    {
                        pattern: "<%= dirs.js %>/data/*.json",
                        included: false,
                        served: true,
                    },
                    "<%= dirs.thirdparty %>/jquery/dist/jquery.js",
                    "<%= dirs.thirdparty %>/chart.js/dist/Chart.js",
                    "<%= dirs.js %>/src/*.js",
                    "<%= dirs.js %>/tests/*.js"
                ]
            },
            chrome: {
                singleRun: true,
                browsers: ["ChromiumMaybeHeadless"]
            },
            firefox: {
                singleRun: true,
                browsers: ["Firefox"]
            },
            chromeDebug: {
                singleRun: false,
                browsers: ["ChromiumMaybeHeadless"]
            },
            firefoxDebug: {
                singleRun: false,
                browsers: ["Firefox"]
            },
            debug: {<commit_msg>Forgot to rename karma tasks<commit_after>module.exports = function(grunt) {
    var sass = require('sass');

    var preprocessors = {};
    if (!process.env.SKIP_COVERAGE) {
        preprocessors["<%= dirs.js %>/src/*.js"] = ["coverage"];
    }

    grunt.initConfig({
        pkg: grunt.file.readJSON("package.json"),
        dirs: {
            build: "frontend/build",
            css: "frontend/css",
            js: "frontend/js",
            static: "inboxen/static/compiled",
            thirdparty: "node_modules",
        },
        clean: {
            build: ["<%= dirs.build %>", "<%= dirs.static %>"],
        },
        copy: {
            fonts: {
                expand: true,
                nonull: true,
                flatten: true,
                src: "<%= dirs.thirdparty %>/font-awesome/fonts/*",
                dest: "<%= dirs.static %>/fonts/",
            }
        },
        concat: {
            options: {
                sourceMap: true,
            },
            website: {
                src: [
                    "<%= dirs.thirdparty %>/jquery/dist/jquery.js",
                    "<%= dirs.js %>/src/utils.js",
                    "<%= dirs.js %>/src/copy.js",
                    "<%= dirs.js %>/src/alert.js",
                    "<%= dirs.js %>/src/home.js",
                    "<%= dirs.js %>/src/search.js",
                    "<%= dirs.js %>/src/inbox.js",
                ],
                dest: "<%= dirs.build %>/src/website.js",
                nonnull: true
            },
            stats: {
                src: [
                    "<%= dirs.thirdparty %>/patternomaly/dist/patternomaly.js",
                    "<%= dirs.thirdparty %>/chart.js/dist/Chart.js",
                    "<%= dirs.js %>/src/stats.js",
                ],
                dest: "<%= dirs.build %>/src/stats.js",
                nonnull: true
            }
        },
        uglify: {
            options: {
                mangle: true,
                compress: true,
                sourceMap: {
                    includeSources: true
                },
                output: {
                    comments: /^!/
                }
            },
            website: {
                src: ["<%= dirs.build %>/src/website.js"],
                dest: "<%= dirs.static %>/website.min.js"
            },
            stats: {
                src: ["<%= dirs.build %>/src/stats.js"],
                dest: "<%= dirs.static %>/stats.min.js"
            }
        },
        sass: {
            options: {
                implementation: sass,
                outputStyle: "compressed",
                includePaths: ["<%= dirs.thirdparty %>"],
                sourceMap: true,
                sourceMapContents: true,
                sourceMapEmbed: false
            },
            publicCss: {
                src: ["<%= dirs.css %>/inboxen.scss"],
                dest: "<%= dirs.static %>/website.css"
            }
        },
        karma: {
            options: {
                client: {
                    jasmine: {
                        random: true,
                        stopSpecOnExpectationFailure: false
                    }
                },
                configFile: "karma.conf.js",
                preprocessors: preprocessors,
                files: [
                    {
                        pattern: "<%= dirs.js %>/data/*.html",
                        type: "dom"
                    },
                    {
                        pattern: "<%= dirs.js %>/data/*.json",
                        included: false,
                        served: true,
                    },
                    "<%= dirs.thirdparty %>/jquery/dist/jquery.js",
                    "<%= dirs.thirdparty %>/chart.js/dist/Chart.js",
                    "<%= dirs.js %>/src/*.js",
                    "<%= dirs.js %>/tests/*.js"
                ]
            },
            chromium: {
                singleRun: true,
                browsers: ["ChromiumMaybeHeadless"]
            },
            firefox: {
                singleRun: true,
                browsers: ["Firefox"]
            },
            chromiumDebug: {
                singleRun: false,
                browsers: ["ChromiumMaybeHeadless"]
            },
            firefoxDebug: {
                singleRun: false,
                browsers: ["Firefox"]
            },
            debug: {
{'fraction_non_alphanumeric': 0.14504596527068436, 'fraction_numerical': 0.0, 'mean_word_length': 0.8962771680654186, 'pattern_counts': {'":': 0, '<': 63, '<?xml version=': 0, '>': 63, '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': '4571296', 'n_tokens_mistral': 2535, 'n_tokens_neox': 2320, 'n_words': 370}