<commit_before>/**
 * module.exports ... is required for things to work
 * @param {Object} grunt instance of Grunt.
 */
module.exports = function(grunt) {
  'use strict';

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-requirejs');
  grunt.loadNpmTasks('grunt-jslint');

  grunt.initConfig({

    jslint: {
      files: [
        '**/*.js'
      ],
      exclude: [
        'js/config.js',
        'node_modules/**',
        'js/lib/**',
        '**/*.min.js',
        'js/build/**'
      ],
      directives: {
        browser: true,
        es5: true,
        nomen: true,
        todo: true,
        white: true,
        predef: [
          // pre-defined globals
          'module',
          'define',
          'require'
        ]
      },
      options: {
        failOnError: true
      }
    },

    requirejs: {
      compile: {
        options: {
          baseUrl: 'js',
          dir: 'js/build',
          mainConfigFile: 'js/config.js',
          optimize: 'uglify',
//          optimize: 'none', // debug-only
          uglify: {
            max_line_length: 80
          },
          paths: {
            backbone: 'empty:',
            jquery: 'empty:',
            jquerymobile: 'empty:',
            underscore: 'empty:',
            // testing libraries
            chai: 'empty:',
            mocha: 'empty:',
            // boot / entry points
            main: 'main'
          },
          modules: [
            {
              name: 'main',
              include: ['config', 'boot'],
              out: 'js/build/main.min.js'
            },
            {
              name: 'views/jqm',
              include: ['main', 'config', 'boot'],
              out: 'js/build/jqm.min.js'
            }
          ]
        }
      }
    },

    clean: ['js/build'],

    copy: {
      main: {
        files: [
          {
            src: 'js/build/main.js',
            dest: 'js/core.min.js'
          },
          {
            src: 'js/build/views/jqm.js',
            dest: 'js/jqm.min.js'
          }
        ]
      }
    }

  });

  grunt.registerTask('default', 'jslint');
  grunt.registerTask('build', 'jslint requirejs copy clean');

};
<commit_msg>use UglifyJS2 instead of old UglifyJS<commit_after>/**
 * module.exports ... is required for things to work
 * @param {Object} grunt instance of Grunt.
 */
module.exports = function(grunt) {
  'use strict';

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-requirejs');
  grunt.loadNpmTasks('grunt-jslint');

  grunt.initConfig({

    clean: ['js/build', 'js/*.min.js'],

    jslint: {
      files: [
        '**/*.js'
      ],
      exclude: [
        'js/config.js',
        'node_modules/**',
        'js/lib/**',
        '**/*.min.js',
        'js/build/**'
      ],
      directives: {
        browser: true,
        es5: true,
        nomen: true,
        todo: true,
        white: true,
        predef: [
          // pre-defined globals
          'module',
          'define',
          'require'
        ]
      },
      options: {
        failOnError: true
      }
    },

    requirejs: {
      compile: {
        options: {
          baseUrl: 'js',
          dir: 'js/build',
          mainConfigFile: 'js/config.js',
          optimize: 'uglify2',
//          optimize: 'none', // debug-only
          uglify: {
            max_line_length: 80
          },
          uglify2: {
            output: {
              max_line_len: 80
            },
            warnings: false
          },
          paths: {
            backbone: 'empty:',
            jquery: 'empty:',
            jquerymobile: 'empty:',
            underscore: 'empty:',
            // testing libraries
            chai: 'empty:',
            mocha: 'empty:',
            // boot / entry points
            main: 'main'
          },
          modules: [
            {
              name: 'main',
              include: ['config', 'boot'],
              out: 'js/build/main.min.js'
            },
            {
              name: 'views/jqm',
              include: ['main', 'config', 'boot'],
              out: 'js/build/jqm.min.js'
            }
          ]
        }
      }
    },

    copy: {
      main: {
        files: [
          {
            src: 'js/build/main.js',
            dest: 'js/core.min.js'
          },
          {
            src: 'js/build/views/jqm.js',
            dest: 'js/jqm.min.js'
          }
        ]
      }
    }

  });

  grunt.registerTask('default', 'jslint');
  grunt.registerTask('build', 'clean jslint requirejs copy');

};

{'fraction_non_alphanumeric': 0.15399401964972234, 'fraction_numerical': 0.002349423323366083, 'mean_word_length': 1.2131379962192816, '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': '5156208', 'n_tokens_mistral': 1503, 'n_tokens_neox': 1477, 'n_words': 262}