<commit_before>// imports
var _ = require('lodash');
// gruntfile
module.exports = function (grunt) {
    'use strict';

    // development files
    var SOURCE_PATH = 'src/',
        SASS_PATH = SOURCE_PATH + 'styles/',
        SASS_FILES = [
            SASS_PATH + '**/*.scss'
        ],
        JAVASCRIPT_PATH = SOURCE_PATH + 'scripts/',
        JAVASCRIPT_SOURCES = [
            '*.js',
            JAVASCRIPT_PATH + '**/*.js'
        ],
        TEMPLATES_PATH = SOURCE_PATH + 'templates/',
        TEMPLATES_LAYOUTS_PATH = TEMPLATES_PATH + 'layouts/',
        TEMPLATES_PAGES_PATH = TEMPLATES_PATH + 'pages/',
        TEMPLATES_PARTIALS_PATH = TEMPLATES_PATH + 'parts/',
        TEMPLATES_DATA_PATH = TEMPLATES_PATH + 'data/',
        HTML5_BOILERPLATE_PATH = 'lib/html5-boilerplate/',
        HTACCESS_BASE_FILE = HTML5_BOILERPLATE_PATH + '.htaccess',
        HTACCESS_FILE = SOURCE_PATH + 'htaccess.conf',
        HTML_PAGES = [SOURCE_PATH + '**/*.html'],
        MANIFEST_WEBAPP_NAME = 'manifest.webapp',
        MANIFEST_WEBAPP_FILE = SOURCE_PATH + MANIFEST_WEBAPP_NAME,

        // build generated output
        BUILD_PATH = 'build/',
        HTDOCS_PATH = BUILD_PATH + 'www/',
        CSS_PATH = HTDOCS_PATH + 'css/',
        JS_PATH = HTDOCS_PATH + 'js/',
        CSS_FILES = [
            CSS_PATH + '**/*.css'
        ],
        HTML_FILES = [
            HTDOCS_PATH + '**/*.html'
        ],
        JS_FILES = [
            JS_PATH + '**/*.js'
        ],
        FILES_TO_CACHE = HTML_FILES.concat(CSS_FILES.concat(JS_FILES)),

        // browser compatibility
        BROWSER_SUPPORT = [
            'last 2 version',
            'ff >= 18'
        ],

        // linters
        JSLINT_GLOBALS = [
            'module',
            'require',
            'console'
        ],
        JSLINT_DIRECTIVES = {
            nomen: true,
            predef: JSLINT_GLOBALS
        },
        GJSLINT_DISABLE = [
            '1',  //Extra space after "function" (Error 1)
            '6',  //Wrong indentation: expected x but got y (Error 6)
            '220' //No docs found for member (Error 220)
        ],
        GJSLINT_OPTIONS = {
            flags: [
                '--disable ' + GJSLINT_DISABLE.join(','),
                '--strict'
            ],
            reporter: {
                name: 'console'
            }
        },
        JS_LINTER = 'jslint';

    grunt.initConfig({

        //# Stylesheets
        compass: {
            options: {
                sassDir: SASS_PATH,
                cssDir: CSS_PATH,
                bundleExec: true
            },
            dev: {
                options: {
                    environment: 'development'
                }
            }
        },
        autoprefixer: {
            all: {
                options: {
                    browsers: BROWSER_SUPPORT
                },
                files: [{
                    expand: true,
                    cwd: CSS_PATH,
                    src: '**/*.css',
                    dest: CSS_PATH
                }]
            }
        },

        //# Javascript
        jsvalidate: {
            all: JAVASCRIPT_SOURCES
        },
        jshint: {
            all: {
                src: JAVASCRIPT_SOURCES
            }
        },
        jslint: {
            all: {
                src: JAVASCRIPT_SOURCES,
                directives: JSLINT_DIRECTIVES
            }
        },

        gjslint: {
            options: GJSLINT_OPTIONS,
            all: {
                src: JAVASCRIPT_SOURCES
            }
        },

        //# Apache Config
        concat: {
            htaccess: {
                files: [{
                    src: [
                        HTACCESS_BASE_FILE,
                        HTACCESS_FILE
                    ],
                    dest: HTDOCS_PATH + '.htaccess'
                }]
            }
        },

        //# Templates
        assemble: {
            options: {
                flatten: true,
                layout: 'layout.hbs',
                layoutdir: TEMPLATES_LAYOUTS_PATH,
                partials: [TEMPLATES_PARTIALS_PATH + '**/*.hbs'],
                data: [TEMPLATES_DATA_PATH + '**/*.{json,yml}']
            },
            pages: {
                files: [{
                    src: [
                        TEMPLATES_PAGES_PATH + '/**/*.hbs'
                    ],
                    dest: HTDOCS_PATH
                }]
            }
        },

        //# Other Static files
        copy: {
            webapp: {
                files: [{
                    src: MANIFEST_WEBAPP_FILE,
                    dest: HTDOCS_PATH + MANIFEST_WEBAPP_NAME
                }]
            },
            html: {
                files: [{
                    expand: true,
                    cwd: SOURCE_PATH,
                    src: '**/*.html',
                    dest: HTDOCS_PATH
                }]
            }
        },

        //# Appcache
        manifest: {
            generate: {
                options: {
                    network: [
                    ],
                    process: function (path) {
                        // remove documentRoot part of the cached files paths
                        return path.substring(HTDOCS_PATH.length);
                    },
                    hash: true,
                    timestamp: false,
                    basePath: ''
                },
                src: FILES_TO_CACHE,
                dest: HTDOCS_PATH + 'manifest.appcache'
            }
        },

        //# Watch
        watch: {
            options: {
                spawn: false
            },
            javascript: {
                files: JAVASCRIPT_SOURCES,
                tasks: ['jsvalidate', JS_LINTER]
            },
            css: {
                files: CSS_FILES,
                tasks: ['autoprefixer', 'manifest']
            },
            assemble: {
                files: [
                    TEMPLATES_PATH + '/**/*.hbs',
                    TEMPLATES_DATA_PATH + '**/*.{json,yml}'
                ],
                tasks: ['assemble']
            },
            copy_html: {
                files: HTML_PAGES,
                tasks: ['copy:html', 'manifest']
            },<commit_msg>gruntfile polishing<commit_after>// imports
var _ = require('lodash');
// gruntfile
module.exports = function (grunt) {
    'use strict';

        // development folders and files
    var SOURCE_PATH             =   'src/',
        SASS_PATH               =   SOURCE_PATH + 'styles/',
        JAVASCRIPT_PATH         =   SOURCE_PATH + 'scripts/',
        TEMPLATES_PATH          =   SOURCE_PATH + 'templates/',
        TEMPLATES_LAYOUTS_PATH  =   TEMPLATES_PATH + 'layouts/',
        TEMPLATES_PAGES_PATH    =   TEMPLATES_PATH + 'pages/',
        TEMPLATES_PARTIALS_PATH =   TEMPLATES_PATH + 'parts/',
        TEMPLATES_DATA_PATH     =   TEMPLATES_PATH + 'data/',
        HTML5_BOILERPLATE_PATH  =   'lib/html5-boilerplate/',

        SASS_FILES              =   [SASS_PATH + '**/*.scss'],
        JAVASCRIPT_SOURCES      =   ['*.js', JAVASCRIPT_PATH + '**/*.js'],
        HTACCESS_BASE_FILE      =   HTML5_BOILERPLATE_PATH + '.htaccess',
        HTACCESS_FILE           =   SOURCE_PATH + 'htaccess.conf',
        HTML_PAGES              =   [SOURCE_PATH + '**/*.html'],
        MANIFEST_WEBAPP_NAME    =   'manifest.webapp',
        MANIFEST_WEBAPP_FILE    =   SOURCE_PATH + MANIFEST_WEBAPP_NAME,

        // build generated output
        BUILD_PATH              =   'build/',
        HTDOCS_PATH             =   BUILD_PATH + 'www/',
        CSS_PATH                =   HTDOCS_PATH + 'css/',
        JS_PATH                 =   HTDOCS_PATH + 'js/',
        CSS_FILES               =   [CSS_PATH + '**/*.css'],
        HTML_FILES              =   [HTDOCS_PATH + '**/*.html'],
        JS_FILES                =   [JS_PATH + '**/*.js'],
        FILES_TO_CACHE          =   HTML_FILES.concat(CSS_FILES, JS_FILES),

        // browser compatibility
        BROWSER_SUPPORT = [
            'last 2 version',
            'ff >= 18'
        ],

        // linters
        JSLINT_GLOBALS = [
            'module',
            'require',
            'console'
        ],
        JSLINT_DIRECTIVES = {
            nomen: true,
            predef: JSLINT_GLOBALS
        },
        GJSLINT_DISABLE = [
            '1',  //Extra space after "function" (Error 1)
            '6',  //Wrong indentation: expected x but got y (Error 6)
            '220' //No docs found for member (Error 220)
        ],
        GJSLINT_OPTIONS = {
            flags: [
                '--disable ' + GJSLINT_DISABLE.join(','),
                '--strict'
            ],
            reporter: {
                name: 'console'
            }
        },
        JS_LINTER = 'jslint';

// Grunt tasks
// ---------------------------------------------------------------------------
    grunt.initConfig({

        // Stylesheets
        compass: {
            options: {
                sassDir: SASS_PATH,
                cssDir: CSS_PATH,
                bundleExec: true
            },
            dev: {
                options: {
                    environment: 'development'
                }
            }
        },
        autoprefixer: {
            all: {
                options: {
                    browsers: BROWSER_SUPPORT
                },
                files: [{
                    expand: true,
                    cwd: CSS_PATH,
                    src: '**/*.css',
                    dest: CSS_PATH
                }]
            }
        },

        // Javascript
        jsvalidate: {
            all: JAVASCRIPT_SOURCES
        },
        jshint: {
            all: {
                src: JAVASCRIPT_SOURCES
            }
        },
        jslint: {
            all: {
                src: JAVASCRIPT_SOURCES,
                directives: JSLINT_DIRECTIVES
            }
        },

        gjslint: {
            options: GJSLINT_OPTIONS,
            all: {
                src: JAVASCRIPT_SOURCES
            }
        },

        // Apache Config
        concat: {
            htaccess: {
                files: [{
                    src: [
                        HTACCESS_BASE_FILE,
                        HTACCESS_FILE
                    ],
                    dest: HTDOCS_PATH + '.htaccess'
                }]
            }
        },

        // Templates
        assemble: {
            options: {
                flatten: true,
                layout: 'layout.hbs',
                layoutdir: TEMPLATES_LAYOUTS_PATH,
                partials: [TEMPLATES_PARTIALS_PATH + '**/*.hbs'],
                data: [TEMPLATES_DATA_PATH + '**/*.{json,yml}']
            },
            pages: {
                files: [{
                    src: [
                        TEMPLATES_PAGES_PATH + '/**/*.hbs'
                    ],
                    dest: HTDOCS_PATH
                }]
            }
        },

        // Other Static files
        copy: {
            webapp: {
                files: [{
                    src: MANIFEST_WEBAPP_FILE,
                    dest: HTDOCS_PATH + MANIFEST_WEBAPP_NAME
                }]
            },
            html: {
                files: [{
                    expand: true,
                    cwd: SOURCE_PATH,
                    src: '**/*.html',
                    dest: HTDOCS_PATH
                }]
            }
        },

        // Appcache
        manifest: {
            generate: {
                options: {
                    network: [
                    ],
                    process: function (path) {
                        // remove documentRoot part of the cached files paths
                        return path.substring(HTDOCS_PATH.length);
                    },
                    hash: true,
                    timestamp: false,
                    basePath: ''
                },
                src: FILES_TO_CACHE,
                dest: HTDOCS_PATH + 'manifest.appcache'
            }
        },

        // Watch
        watch: {
            options: {
                spawn: false
            },
            javascript: {
                files: JAVASCRIPT_SOURCES,
                tasks: ['jsvalidate', JS_LINTER]
            },
            css: {
                files: CSS_FILES,
                tasks: ['autoprefixer', 'manifest']
            },
            assemble: {
                files: [
                    TEMPLATES_PATH + '/**/*.hbs',
                    TEMPLATES_DATA_PATH + '**/*.{json,yml}'
                ],
                tasks: ['assemble']
            },
            copy_html: {
                files: HTML_PAGES,
                tasks: ['copy:html', 'manifest']
            },
{'fraction_non_alphanumeric': 0.10940197771150525, 'fraction_numerical': 0.0025113796892167633, 'mean_word_length': 0.9295881284070261, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5764879', 'n_tokens_mistral': 3837, 'n_tokens_neox': 3443, 'n_words': 604}