<commit_before>/*global module:false*/
module.exports = function(grunt) {
    'use strict';

    var sourceFiles = grunt.file.readJSON('sourceFiles.json');

    // Project configuration.
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        path: {
            main: 'build/<%= pkg.name %>-<%= pkg.version %>.js',
            min: 'build/<%= pkg.name %>-<%= pkg.version %>-min.js'
        },

        concat: {
            dist: {
                src: sourceFiles,
                dest: '<%= path.main %>'
            }
        },

        replace: {
            options: {
                variables: {
                    'VERSION': '<%= pkg.version %>'
                },
                prefix: '@',
                force: true
            },

            dist: {
                options: {
                    patterns: [
                        {
                            match: /this\._super\(\s*([\w\.]+)\s*,\s*"(\w+)"\s*(,\s*)?/g,
                            replacement: '$1.prototype.$2.apply(this$3'
                        },
                    ],
                },
                files: [
                    {
                        expand: true,
                        flatten: true,
                        src: [ '<%= path.main %>' ],
                        dest: 'build/'
                    }
                ]
            },

            docs: {
                files: [
                    {
                        expand: true,
                        src: sourceFiles.concat([ 'README.md' ]),
                        dest: 'build/docs/'
                    }
                ]
            }
        },

        uglify: {
            options: {
                report: 'min',
                preserveComments: 'some'
            },
            dist: {
                files: {
                    '<%= path.min %>': [
                        '<%= path.main %>'
                    ]
                }
            }
        },

        jshint: {
            options: {
                jshintrc: ".jshintrc"
            },

            beforeConcat: {
                files: {
                    src: sourceFiles
                }
            },

            afterConcat: {
                files: {
                    src: [ '<%= path.main %>' ]
                }
            }
        },

        clean: {
            dist: [
                '<%= path.main %>',
                '<%= path.min %>'
            ],
            jsdoc: [
                'build/docs',
                './docs/**/*.*',
                './docs/scripts',
                './docs/styles',
                './docs/images'
            ]
        },

        jsdoc : {
            dist : {
                src: sourceFiles.map(function (value) {
                    return value.replace('src/', 'build/docs/src/');
                }).concat([ 'README.md' ]),
                options: {
                    configure: 'jsdoc_conf.json',
                    destination: 'docs',
                    template: 'tasks/jsdoc-template/melonjs'
                }
            }
        },
        jasmine : {
            src: sourceFiles,
            options : {
                specs: grunt.file.readJSON('testSpecs.json'),
                helpers: ['tests/spec/SpecHelper.js']
            }


        }

    });

    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-jsdoc');
    grunt.loadNpmTasks('grunt-replace');
    grunt.loadNpmTasks('grunt-contrib-jasmine');


    // Custom Tasks
    grunt.loadTasks('tasks');

    // Default task.
    grunt.registerTask('default', ['test', 'uglify']);
    grunt.registerTask('lint', ['jshint:beforeConcat', 'concat', 'replace:dist', 'jshint:afterConcat']);
    grunt.registerTask('doc', ['replace:docs', 'jsdoc']);
    grunt.registerTask('test', ['lint', 'jasmine']);
};
<commit_msg>add testSpecs variable to use on lint and tests tasks<commit_after>/*global module:false*/
module.exports = function(grunt) {
    'use strict';

    var sourceFiles = grunt.file.readJSON('sourceFiles.json');
    var testSpecs = grunt.file.readJSON('testSpecs.json');

    // Project configuration.
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        path: {
            main: 'build/<%= pkg.name %>-<%= pkg.version %>.js',
            min: 'build/<%= pkg.name %>-<%= pkg.version %>-min.js'
        },

        concat: {
            dist: {
                src: sourceFiles,
                dest: '<%= path.main %>'
            }
        },

        replace: {
            options: {
                variables: {
                    'VERSION': '<%= pkg.version %>'
                },
                prefix: '@',
                force: true
            },

            dist: {
                options: {
                    patterns: [
                        {
                            match: /this\._super\(\s*([\w\.]+)\s*,\s*"(\w+)"\s*(,\s*)?/g,
                            replacement: '$1.prototype.$2.apply(this$3'
                        },
                    ],
                },
                files: [
                    {
                        expand: true,
                        flatten: true,
                        src: [ '<%= path.main %>' ],
                        dest: 'build/'
                    }
                ]
            },

            docs: {
                files: [
                    {
                        expand: true,
                        src: sourceFiles.concat([ 'README.md' ]),
                        dest: 'build/docs/'
                    }
                ]
            }
        },

        uglify: {
            options: {
                report: 'min',
                preserveComments: 'some'
            },
            dist: {
                files: {
                    '<%= path.min %>': [
                        '<%= path.main %>'
                    ]
                }
            }
        },

        jshint: {
            options: {
                jshintrc: ".jshintrc"
            },

            beforeConcat: {
                files: {
                    src: [testSpecs, sourceFiles]
                }
            },

            afterConcat: {
                files: {
                    src: [ '<%= path.main %>' ]
                }
            }
        },

        clean: {
            dist: [
                '<%= path.main %>',
                '<%= path.min %>'
            ],
            jsdoc: [
                'build/docs',
                './docs/**/*.*',
                './docs/scripts',
                './docs/styles',
                './docs/images'
            ]
        },

        jsdoc : {
            dist : {
                src: sourceFiles.map(function (value) {
                    return value.replace('src/', 'build/docs/src/');
                }).concat([ 'README.md' ]),
                options: {
                    configure: 'jsdoc_conf.json',
                    destination: 'docs',
                    template: 'tasks/jsdoc-template/melonjs'
                }
            }
        },
        jasmine : {
            src: sourceFiles,
            options : {
                specs: testSpecs,
                helpers: ['tests/spec/SpecHelper.js']
            }


        }

    });

    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-jsdoc');
    grunt.loadNpmTasks('grunt-replace');
    grunt.loadNpmTasks('grunt-contrib-jasmine');


    // Custom Tasks
    grunt.loadTasks('tasks');

    // Default task.
    grunt.registerTask('default', ['test', 'uglify']);
    grunt.registerTask('lint', ['jshint:beforeConcat', 'concat', 'replace:dist', 'jshint:afterConcat']);
    grunt.registerTask('doc', ['replace:docs', 'jsdoc']);
    grunt.registerTask('test', ['lint', 'jasmine']);
};

{'fraction_non_alphanumeric': 0.1472400197141449, 'fraction_numerical': 0.0007392804337111878, 'mean_word_length': 0.9340004765308554, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '4897473', 'n_tokens_mistral': 2330, 'n_tokens_neox': 2135, 'n_words': 307}