<commit_before>/* eslint-disable babel/object-shorthand */

module.exports = function(grunt) {

    require('load-grunt-tasks')(grunt);
    grunt.loadTasks('./build/tasks');
    require('time-grunt')(grunt);

    var devServer = require('./build/webpack/dev-server'),
        devBuildConfig = require('./build/webpack/dev.config'),
        prodBuildConfig = require('./build/webpack/dev.config'),
        jestConfig = grunt.file.readJSON('./build/jest/config.json'),
        jestCacheDir = jestConfig.cacheDirectory.replace(/<rootDir>\//, '');

    // Define the configuration for all the tasks
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        clean: {
            dist: {
                src: [
                    'dist/*',
                    '.gen',
                    'coverage'
                ]
            }
        },

        copy: {

            build: {
                files: [
                    {
                        cwd: 'src',
                        expand: true,
                        src: ['index.html'],
                        dest: 'dist/bundle/'
                    }
                ]
            },

            release: {
                files: [
                    {
                        cwd: 'src',
                        expand: true,
                        src: ['index.html'],
                        dest: 'dist/bundle/'
                    },
                    {
                        cwd: 'dist/bundle/js',
                        expand: true,
                        src: ['*.js'],
                        dest: 'dist/bundle/js'
                    }
                ],
                options: {
                    process: function(content, srcpath) {

                        if (/\.js$/.test(srcpath)) {
                            return content.replace(
                            /(\w+)\.createClass\(\s*\{\s*displayName:\s*["'][A-Za-z]+["'],/g,
                            '$1.createClass({');
                        }
                    }
                }
            },

            server: {
                files: [
                    {
                        cwd: 'src',
                        expand: true,
                        src: ['index.html'],
                        dest: 'dist/bundle/'
                    },
                    {
                        cwd: '.',
                        expand: true,
                        src: ['mock/responses/**/*.json'],
                        dest: 'dist/bundle'
                    }
                ]
            }
        },

        htmlmin: {
            release: {
                options: {
                    removeComments: true,
                    collapseWhitespace: true
                },
                files: {
                    'dist/bundle/index.html': 'dist/bundle/index.html'
                }
            }
        },

        genTests: {
            all: {
                options: {
                    srcDir: 'src/js',
                    sampleTest: 'build/jest/Sample-test.jsx',
                    testEslintrc: 'build/jest/.eslintrc',
                    ignore: /.*src\/js\/((?:constants))\/[a-zA-Z]+\.jsx?/
                }
            }
        },

        flow: {
            options: {}
        },

        eslint: {
            source: {
                src: ['src/js/{,*/}*.{js,jsx}', '!src/js/{,*/}__tests__/*.js']
            },

            tests: {
                src: ['src/js/{,*/}__tests__/*.{js,jsx}', 'mock/{,*/}*.js'],
                options: {
                    globals: ['jest'],
                    envs: ['jasmine', 'amd', 'node', 'browser']
                }
            },

            scripts: {
                src: ['Gruntfile.js', 'build/{,*/}*.js'],
                options: {
                    configFile: 'build/.eslintrc'
                }
            }
        },

        jsonlint: {
            cfgfiles: {
                src: [
                    '.eslintrc',
                    'src/js/{,*/}__tests__/.eslintrc',
                    'build/**/*.json'
                ]
            }
        },

        jester: {
            all: {
                options: {
                    coverage: true,
                    config: 'build/jest/config.json',
                    testPathPattern: /.*-test\.jsx?/,
                    cacheDir: jestCacheDir
                }
            },

            smoke: {
                options: {
                    coverage: true,
                    config: 'build/jest/config.json',
                    testPathPattern: /.*-test\.jsx?/,
                    cacheDir: jestCacheDir,
                    smoke: true,
                    // useCache: false
                }
            }
        },


        webpack: {
            dev: devBuildConfig,
            build: prodBuildConfig
        },


        shell: {
            options: {
                failOnError: true
            },
            createGenDir: {
                command: 'mkdir -p ' + jestCacheDir
            }

        },

        watch: {
            html: {
                files: ['src/*.html'],
                tasks: ['copy:html']
            }
        }

    });

    grunt.registerTask('lint', [
        'jsonlint',
        'eslint'
    ]);

    grunt.registerTask('smoke', [
        'lint',
        'shell:createGenDir',
        'jester:smoke'
    ]);

    grunt.registerTask('test', [
        'lint',
        'shell:createGenDir',
        'jester:all'
    ]);

    grunt.registerTask('serve', 'Compile then start a connect web server',
        function() {
            grunt.task.run([
                'lint',
                'clean:dist',
                'copy:server',
                'watch:html'
            ]);

            devServer.start();
        }

    );

    grunt.registerTask('build', [
        // 'genTests',
        'clean:dist',
        'test',
        'webpack:build',
        'copy:build'
    ]);

    grunt.registerTask('release', [
        'clean:dist',
        'test',
        'webpack:build',
        'copy:release',
        'htmlmin'
    ]);

};
<commit_msg>Remove reference to dev.config in Grunt<commit_after>/* eslint-disable babel/object-shorthand */

module.exports = function(grunt) {

    require('load-grunt-tasks')(grunt);
    grunt.loadTasks('./build/tasks');
    require('time-grunt')(grunt);

    var devServer = require('./build/webpack/dev-server'),
        prodBuildConfig = require('./build/webpack/dev.config'),
        jestConfig = grunt.file.readJSON('./build/jest/config.json'),
        jestCacheDir = jestConfig.cacheDirectory.replace(/<rootDir>\//, '');

    // Define the configuration for all the tasks
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        clean: {
            dist: {
                src: [
                    'dist/*',
                    '.gen',
                    'coverage'
                ]
            }
        },

        copy: {

            build: {
                files: [
                    {
                        cwd: 'src',
                        expand: true,
                        src: ['index.html'],
                        dest: 'dist/bundle/'
                    }
                ]
            },

            release: {
                files: [
                    {
                        cwd: 'src',
                        expand: true,
                        src: ['index.html'],
                        dest: 'dist/bundle/'
                    },
                    {
                        cwd: 'dist/bundle/js',
                        expand: true,
                        src: ['*.js'],
                        dest: 'dist/bundle/js'
                    }
                ],
                options: {
                    process: function(content, srcpath) {

                        if (/\.js$/.test(srcpath)) {
                            return content.replace(
                            /(\w+)\.createClass\(\s*\{\s*displayName:\s*["'][A-Za-z]+["'],/g,
                            '$1.createClass({');
                        }
                    }
                }
            },

            server: {
                files: [
                    {
                        cwd: 'src',
                        expand: true,
                        src: ['index.html'],
                        dest: 'dist/bundle/'
                    },
                    {
                        cwd: '.',
                        expand: true,
                        src: ['mock/responses/**/*.json'],
                        dest: 'dist/bundle'
                    }
                ]
            }
        },

        htmlmin: {
            release: {
                options: {
                    removeComments: true,
                    collapseWhitespace: true
                },
                files: {
                    'dist/bundle/index.html': 'dist/bundle/index.html'
                }
            }
        },

        genTests: {
            all: {
                options: {
                    srcDir: 'src/js',
                    sampleTest: 'build/jest/Sample-test.jsx',
                    testEslintrc: 'build/jest/.eslintrc',
                    ignore: /.*src\/js\/((?:constants))\/[a-zA-Z]+\.jsx?/
                }
            }
        },

        flow: {
            options: {}
        },

        eslint: {
            source: {
                src: ['src/js/{,*/}*.{js,jsx}', '!src/js/{,*/}__tests__/*.js']
            },

            tests: {
                src: ['src/js/{,*/}__tests__/*.{js,jsx}', 'mock/{,*/}*.js'],
                options: {
                    globals: ['jest'],
                    envs: ['jasmine', 'amd', 'node', 'browser']
                }
            },

            scripts: {
                src: ['Gruntfile.js', 'build/{,*/}*.js'],
                options: {
                    configFile: 'build/.eslintrc'
                }
            }
        },

        jsonlint: {
            cfgfiles: {
                src: [
                    '.eslintrc',
                    'src/js/{,*/}__tests__/.eslintrc',
                    'build/**/*.json'
                ]
            }
        },

        jester: {
            all: {
                options: {
                    coverage: true,
                    config: 'build/jest/config.json',
                    testPathPattern: /.*-test\.jsx?/,
                    cacheDir: jestCacheDir
                }
            },

            smoke: {
                options: {
                    coverage: true,
                    config: 'build/jest/config.json',
                    testPathPattern: /.*-test\.jsx?/,
                    cacheDir: jestCacheDir,
                    smoke: true,
                    // useCache: false
                }
            }
        },


        webpack: {
            build: prodBuildConfig
        },


        shell: {
            options: {
                failOnError: true
            },
            createGenDir: {
                command: 'mkdir -p ' + jestCacheDir
            }

        },

        watch: {
            html: {
                files: ['src/*.html'],
                tasks: ['copy:html']
            }
        }

    });

    grunt.registerTask('lint', [
        'jsonlint',
        'eslint'
    ]);

    grunt.registerTask('smoke', [
        'lint',
        'shell:createGenDir',
        'jester:smoke'
    ]);

    grunt.registerTask('test', [
        'lint',
        'shell:createGenDir',
        'jester:all'
    ]);

    grunt.registerTask('serve', 'Compile then start a connect web server',
        function() {
            grunt.task.run([
                'lint',
                'clean:dist',
                'copy:server',
                'watch:html'
            ]);

            devServer.start();
        }

    );

    grunt.registerTask('build', [
        // 'genTests',
        'clean:dist',
        'test',
        'webpack:build',
        'copy:build'
    ]);

    grunt.registerTask('release', [
        'clean:dist',
        'test',
        'webpack:build',
        'copy:release',
        'htmlmin'
    ]);

};

{'fraction_non_alphanumeric': 0.13743959374232123, 'fraction_numerical': 0.00016381358014579407, 'mean_word_length': 0.7937417364477743, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1113836', 'n_tokens_mistral': 3325, 'n_tokens_neox': 3040, 'n_words': 455}