<commit_before>'use strict';

module.exports = function (grunt) {

  // Time how long tasks take. Can help when optimizing build times
  require('time-grunt')(grunt);

  // Automatically load required grunt tasks
  // Use jit-grunt instead of load-grunt-tasks here as it dramatically decreases grunt initialization time (27.5s -> 1.5s).
  require('jit-grunt')(grunt, {
      useminPrepare: 'grunt-usemin'
  });

  // Configurable options
  var config = {
    app: './app',
    dist: './dist',
    minimumCoverage: 90 // percents
  };

  // Define the configuration for all the tasks
  grunt.initConfig({

    // Project settings
    config: config,

    // Watches files for changes and runs tasks based on the changed files
    watch: {
      bower: {
        files: ['bower.json'],
        tasks: ['wiredep']
      },
      sass: {
        files: ['<%= config.app %>/styles/sass/{,*/}*.{scss,sass}'],
        tasks: ['sass']
      },
      templates: {
        files: ['<%= config.app %>/templates/{,*/}*.hbs'],
        tasks: ['handlebars']
      },
    },


    browserSync: {
      options: {
        notify: false,
        background: true,
        watchOptions: {
          ignored: ''
        }
      },
      livereload: {
        options: {
          files: [
            '<%= config.app %>/{,*/}*.html',
            '<%= config.app %>/styles/{,*/}*.css',
            '<%= config.app %>/images/{,*/}*',
            '<%= config.app %>/scripts/{,*/}*.js'
          ],
          port: 9000,
          server: {
            baseDir: ['<%= config.app %>', config.app],
            routes: {
              '/bower_components': './bower_components'
            }
          }
        }
      }
    },

    // Empties folders to start fresh
    clean: {
      options: {
        force: true
      },
      dist: {
        files: [{
          dot: true,
          src: [
            '<%= config.app %>/styles/main.css',
            '<%= config.app %>/styles/main.css.map',
            '<%= config.app %>/scripts/compiled-templates.js'
          ]
        }]
      },
    },

    handlebars: {
      compile: {
        options: {
          namespace: 'Handlebars.Templates',
          processName: function(filePath) { // input:  app/templates/AddressInputQuestion.hbs
            var pieces = filePath.split("/");
            return pieces[pieces.length - 1].replace(/\.hbs$/, ''); // output: AddressInputQuestion
          },
        },
        files: {
          '<%= config.app %>/scripts/compiled-templates.js': [ '<%= config.app %>/templates/*.hbs']
        }
      }
    },


    // Compiles Sass to CSS and generates necessary files if requested<commit_msg>removing dist directory on clean<commit_after>'use strict';

module.exports = function (grunt) {

  // Time how long tasks take. Can help when optimizing build times
  require('time-grunt')(grunt);

  // Automatically load required grunt tasks
  // Use jit-grunt instead of load-grunt-tasks here as it dramatically decreases grunt initialization time (27.5s -> 1.5s).
  require('jit-grunt')(grunt, {
      useminPrepare: 'grunt-usemin'
  });

  // Configurable options
  var config = {
    app: './app',
    dist: './dist',
    minimumCoverage: 90 // percents
  };

  // Define the configuration for all the tasks
  grunt.initConfig({

    // Project settings
    config: config,

    // Watches files for changes and runs tasks based on the changed files
    watch: {
      bower: {
        files: ['bower.json'],
        tasks: ['wiredep']
      },
      sass: {
        files: ['<%= config.app %>/styles/sass/{,*/}*.{scss,sass}'],
        tasks: ['sass']
      },
      templates: {
        files: ['<%= config.app %>/templates/{,*/}*.hbs'],
        tasks: ['handlebars']
      },
    },


    browserSync: {
      options: {
        notify: false,
        background: true,
        watchOptions: {
          ignored: ''
        }
      },
      livereload: {
        options: {
          files: [
            '<%= config.app %>/{,*/}*.html',
            '<%= config.app %>/styles/{,*/}*.css',
            '<%= config.app %>/images/{,*/}*',
            '<%= config.app %>/scripts/{,*/}*.js'
          ],
          port: 9000,
          server: {
            baseDir: ['<%= config.app %>', config.app],
            routes: {
              '/bower_components': './bower_components'
            }
          }
        }
      }
    },

    // Empties folders to start fresh
    clean: {
      options: {
        force: true
      },
      dist: {
        files: [{
          dot: true,
          src: [
            '<%= config.app %>/styles/main.css',
            '<%= config.app %>/styles/main.css.map',
            '<%= config.app %>/scripts/compiled-templates.js',
            '<%= config.dist %>'
          ]
        }]
      },
    },

    handlebars: {
      compile: {
        options: {
          namespace: 'Handlebars.Templates',
          processName: function(filePath) { // input:  app/templates/AddressInputQuestion.hbs
            var pieces = filePath.split("/");
            return pieces[pieces.length - 1].replace(/\.hbs$/, ''); // output: AddressInputQuestion
          },
        },
        files: {
          '<%= config.app %>/scripts/compiled-templates.js': [ '<%= config.app %>/templates/*.hbs']
        }
      }
    },


    // Compiles Sass to CSS and generates necessary files if requested
{'fraction_non_alphanumeric': 0.16632596171715294, 'fraction_numerical': 0.004460137520906894, 'mean_word_length': 1.642120765832106, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 30, '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': '594807', 'n_tokens_mistral': 1672, 'n_tokens_neox': 1607, 'n_words': 350}