<commit_before>module.exports = function(grunt) {
  'use strict';

  require('time-grunt')(grunt);
  require('jit-grunt')(grunt)({
    customTasksDir: 'helpers/grunt/tasks'
  });

  // Initialize config
  grunt.initConfig({
    pkg: require('./package.json')
  });

  // load tasks config per file
  grunt.loadTasks('helpers/grunt/config');


  //--- grunt tasks ---

  grunt.registerTask('checkfiles', ['lintspaces:all', 'newer:jshint']);

  grunt.registerTask('start', ['clean', 'checkfiles']);

  grunt.registerTask('default', ['start']); // TODO: check grunt-prompt


  //---


  //--- @begin: grunt --force

  grunt.registerTask('forceon', 'Forces the force flag on', function() {
      grunt.option('force', true);
  });

  grunt.registerTask('forceoff', 'Forces the force flag off', function() {
      grunt.option('force', false);
  });

  //--- @end: grunt --force


  //--- @begin: spec's tasks

  grunt.registerTask('reports', [
    'start',
    'forceon',
    'karma:reports',  // generate reports
    'forceoff',
    'copy:karma_report_jasmine',
    'clean:karma_report_jasmine',
    'open:reports'    // open reports ouput directory
  ]);

  grunt.registerTask('ci', [
    'start',
    'karma:ci'
  ]);

  grunt.registerTask('specs', [
    'checkfiles',
    'forceon',
    'karma:reports',  // generate reports
    'forceoff',
    'copy:karma_report_jasmine',
    'concurrent:specs'
  ]);

  //--- @end: spec's tasks


  // @begin: build tasks
  grunt.registerTask('build', function(target) {
    if(target === 'dev') {
      return grunt.task.run([
        'start',
        'copy:dev_tobuild',
        'copy:dev_jstobuild',
        'copy:dev_vendortobuild',
        'cleanempty:build',
        'less:dev'
      ]);

    } else if(target === 'prod') {
      return  grunt.task.run([
        'start',
        'karma:ci',
        'copy:prod_jstobuild',
        'html2js:prod',
        'rewriterequireconfig',
        'requirejs',
        'clean:build',
        'copy:prod_todist',
        'cleanempty:dist',
        'less:prod',
        'htmlmin',
        'imagemin',
        'uglify'
      ]);

    }
  });
  // @end: build tasks


  //---


  // @begin: dev tasks
    // @begin: dev with livereload
  grunt.registerTask('server:livereload', ['connect:livereload', 'watch:livereload']);
  grunt.registerTask('server:livereload:proxy', function() {
    grunt.loadNpmTasks('grunt-connect-proxy');
    return grunt.task.run([
      'configureProxies',
      'connect:livereloadProxy',
      'watch:livereload'
    ]);
  });<commit_msg>tools Grunt build tasks redefined<commit_after>module.exports = function(grunt) {
  'use strict';

  require('time-grunt')(grunt);
  require('jit-grunt')(grunt)({
    customTasksDir: 'helpers/grunt/tasks'
  });

  // Initialize config
  grunt.initConfig({
    pkg: require('./package.json')
  });

  // load tasks config per file
  grunt.loadTasks('helpers/grunt/config');


  //--- grunt tasks ---

  grunt.registerTask('checkfiles', ['lintspaces:all', 'newer:jshint']);

  grunt.registerTask('start', ['clean', 'checkfiles']);

  grunt.registerTask('default', ['start']); // TODO: check grunt-prompt


  //---


  //--- @begin: grunt --force

  grunt.registerTask('forceon', 'Forces the force flag on', function() {
      grunt.option('force', true);
  });

  grunt.registerTask('forceoff', 'Forces the force flag off', function() {
      grunt.option('force', false);
  });

  //--- @end: grunt --force


  //--- @begin: spec's tasks

  grunt.registerTask('reports', [
    'start',
    'forceon',
    'karma:reports',  // generate reports
    'forceoff',
    'copy:karma_report_jasmine',
    'clean:karma_report_jasmine',
    'open:reports'    // open reports ouput directory
  ]);

  grunt.registerTask('ci', [
    'start',
    'karma:ci'
  ]);

  grunt.registerTask('specs', [
    'checkfiles',
    'forceon',
    'karma:reports',  // generate reports
    'forceoff',
    'copy:karma_report_jasmine',
    'concurrent:specs'
  ]);

  //--- @end: spec's tasks


  // @begin: build tasks
  grunt.registerTask('build:dev', [
    'start',
    'copy:dev_tobuild',
    'copy:dev_jstobuild',
    'copy:dev_vendortobuild',
    'cleanempty:build',
    'less:dev'
  ]);

  grunt.registerTask('build:prod', [
    'start',
    'karma:ci',
    'copy:prod_jstobuild',
    'html2js:prod',
    'rewriterequireconfig',
    'requirejs',
    'clean:build',
    'copy:prod_todist',
    'cleanempty:dist',
    'less:prod',
    'htmlmin',
    'imagemin',
    'uglify'
  ]);
  // @end: build tasks


  //---


  // @begin: dev tasks
    // @begin: dev with livereload
  grunt.registerTask('server:livereload', ['connect:livereload', 'watch:livereload']);
  grunt.registerTask('server:livereload:proxy', function() {
    grunt.loadNpmTasks('grunt-connect-proxy');
    return grunt.task.run([
      'configureProxies',
      'connect:livereloadProxy',
      'watch:livereload'
    ]);
  });
{'fraction_non_alphanumeric': 0.18457468457468457, 'fraction_numerical': 0.000407000407000407, 'mean_word_length': 2.8853754940711465, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5777157', 'n_tokens_mistral': 1762, 'n_tokens_neox': 1676, 'n_words': 279}