<commit_before>var fs          =   require('fs');
var sourceJS    =   [];
var jsFiles     =   fs.readdirSync('./static/js');
var jsIgnore    =   ['mustache.js', 'topojson.js'];
var i           =   jsFiles.length;

while(i--) {
    if(jsFiles[i].indexOf('.js') > -1 && jsFiles[i].indexOf('.min') === -1 && jsIgnore.indexOf(jsFiles[i]) === -1) {
        sourceJS.push('static/js/' + jsFiles[i]);
    }
}

sourceJS.push('Gruntfile.js');

module.exports  =   function(grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        sass: {
            dist: {
                files: {
                    'static/css/screen.css': 'static/sass/screen.scss',
                    'static/css/find-your-rep.css': 'static/sass/find-your-rep.scss'
                }
            },
            options: {
                loadPath: [
                    'bower_components/bourbon/dist',
                    'bower_components/css-smart-grid/sass'
                ],
                sourcemap: true,
                style: 'compressed'
            }
        },
        jshint: {
            files: sourceJS,
            jshintrc: '.jshintrc'
        },
        uglify: {
            options: {
                sourceMap: true
            },
            dist: {
                files: {
                    'static/js/core.min.js': ['bower_components/topojson/topojson.js', 'static/js/core.js'],
                    'static/js/ocd-divisions.min.js': ['static/js/ocd-divisions.js'],
                    'static/js/find-your-rep.min.js': ['static/js/mustache.js', 'static/js/ocd-divisions.js', 'static/js/find-your-rep.js'],
                    'static/js/calendar.min.js': ['static/js/mustache.js', 'static/js/calendar.js']
                }
            }
        },
        'json-minify': {
            build: {
                files: 'boundary-files/*.json'
            }
        },
        copy: {
            css: {
                files: [
                    {expand: true, src: ['static/css/*'], dest: '_site/', filter: 'isFile'}
                ]
            },
            images: {
                files: [
                    {expand: true, src: ['static/img/*'], dest: '_site/'}
                ]
            }
        },
        watch: {
            css: {
                files: 'static/sass/*.scss',
                tasks: ['sass', 'copy:css']
            },
            js: {
                files: sourceJS,
                tasks: ['newer:jshint', 'newer:uglify']
            },
            html: {<commit_msg>copy js files when they're updated<commit_after>var fs          =   require('fs');
var sourceJS    =   [];
var jsFiles     =   fs.readdirSync('./static/js');
var jsIgnore    =   ['mustache.js', 'topojson.js'];
var i           =   jsFiles.length;

while(i--) {
    if(jsFiles[i].indexOf('.js') > -1 && jsFiles[i].indexOf('.min') === -1 && jsIgnore.indexOf(jsFiles[i]) === -1) {
        sourceJS.push('static/js/' + jsFiles[i]);
    }
}

sourceJS.push('Gruntfile.js');

module.exports  =   function(grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        sass: {
            dist: {
                files: {
                    'static/css/screen.css': 'static/sass/screen.scss',
                    'static/css/find-your-rep.css': 'static/sass/find-your-rep.scss'
                }
            },
            options: {
                loadPath: [
                    'bower_components/bourbon/dist',
                    'bower_components/css-smart-grid/sass'
                ],
                sourcemap: true,
                style: 'compressed'
            }
        },
        jshint: {
            files: sourceJS,
            jshintrc: '.jshintrc'
        },
        uglify: {
            options: {
                sourceMap: true
            },
            dist: {
                files: {
                    'static/js/core.min.js': ['bower_components/topojson/topojson.js', 'static/js/core.js'],
                    'static/js/ocd-divisions.min.js': ['static/js/ocd-divisions.js'],
                    'static/js/find-your-rep.min.js': ['static/js/mustache.js', 'static/js/ocd-divisions.js', 'static/js/find-your-rep.js'],
                    'static/js/calendar.min.js': ['static/js/mustache.js', 'static/js/calendar.js']
                }
            }
        },
        'json-minify': {
            build: {
                files: 'boundary-files/*.json'
            }
        },
        copy: {
            css: {
                files: [
                    {expand: true, src: ['static/css/*'], dest: '_site/', filter: 'isFile'}
                ]
            },
            js: {
                files: [
                    {expand: true, src: ['static/js/*.min.js', 'static/js/*.map'], dest: '_site', filter: 'isFile'}
                ]
            },
            images: {
                files: [
                    {expand: true, src: ['static/img/*'], dest: '_site/'}
                ]
            }
        },
        watch: {
            css: {
                files: 'static/sass/*.scss',
                tasks: ['sass', 'copy:css']
            },
            js: {
                files: sourceJS,
                tasks: ['newer:jshint', 'newer:uglify', 'copy:js']
            },
            html: {
{'fraction_non_alphanumeric': 0.16100415251038128, 'fraction_numerical': 0.0011325028312570782, 'mean_word_length': 1.1619747042023665, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1815611', 'n_tokens_mistral': 1650, 'n_tokens_neox': 1601, 'n_words': 227}