<commit_before>var semver = require('semver');
var currentVersion = require('./package.json').version;

module.exports = function(grunt) {

  // Project configuration
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    concat: {
      release: {
        src: ['src/polyfill/**/*.js', 'src/core.js'],
        dest: '<%= pkg.name %>.js'
      }
    },

    preprocess: {
      options: {
        inline : true
      },
      dist: {
        src: '<%= pkg.name %>.js',
        dest: '<%= pkg.name %>.js'
      }
    },

    jshint: {
      options: {
        curly: true,
        eqeqeq: true,
        eqnull: true,
        browser: true,
        ignores: [
          'test/integration/selenium-webdriver-extract/**/*.js',
          'test/unit/coverage/**/*.js'
        ]
      },
      beforeConcat: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
      afterConcat: ['<%= pkg.name %>.js']
    },

    uglify: {
      release: {
        src: '<%= pkg.name %>.js',
        dest: '<%= pkg.name %>.min.js'
      }
    },

    replace: {
      versionPlaceholder: {
        src: '<%= pkg.name %>.js',
        overwrite: true,
        replacements: [{
          from: '@VERSION@',
          to: '<%= pkg.version %>'
        }]
      }
    },

    karma: {
      unit: {
        configFile: 'test/unit/config/karma.conf.js'
      },
      //continuous integration mode: run tests once in PhantomJS browser.
      continuous: {
        configFile: 'test/unit/config/karma.conf.js',
        singleRun: true,
        browsers: ['PhantomJS']
      },
      coverage: {
        configFile: 'test/unit/config/karma.conf.js',
        singleRun: true,
        reporters: ['coverage'],
        browsers: ['PhantomJS']
      }
    },

    shell: {
      options: {
        failOnError: true,
        stdout: true
      },
      docco: {
        // grunt-docco hangs, so we go for the shell version.
        command: './node_modules/docco/bin/docco -o doc <%= pkg.name %>.js'
      },
      gitpull: {
        command: 'git pull'
      },
      test: {
        command: 'node test/integration/basic-example'
      }
    },

    checkrepo: {
      cleanWorkingTree: {
        clean: true
      }
    },

    bump: {
      options: {
        commit: false,
        push: false,
        createTag: false,
        updateConfigs: ['pkg'],
        commitFiles: ['-a'] // Commit all files.
      }
    },

    prompt: {
      version: {
        options: {
          questions: [
            {
              config: 'bump.next',
              type: 'list',
              message: 'Bump version from ' + '<%= pkg.version %>'.cyan + ' to:',
              choices: [
                {
                  value: semver.inc(currentVersion, 'patch'),
                  name: 'Patch:  '.yellow + semver.inc(currentVersion, 'patch').yellow +
                      '  Backwards-compatible bug fixes.'
                }, {
                  value: semver.inc(currentVersion, 'minor'),
                  name: 'Minor:  '.yellow + semver.inc(currentVersion, 'minor').yellow +
                      '  Add functionality in a backwards-compatible manner.'
                }, {
                  value: semver.inc(currentVersion, 'major'),
                  name: 'Major:  '.yellow + semver.inc(currentVersion, 'major').yellow +
                      '  Incompatible API changes.'
                }, {
                  value: 'custom',
                  name: 'Custom: ?.?.?'.yellow +
                      '  Specify version...'
                }
              ]
            }, {
              config: 'bump.custom',
              type: 'input',
              message: 'What specific version would you like',
              when: function (answers) {
                return answers['bump.next'] === 'custom';
              },
              validate: function (value) {
                var newVersion = semver.valid(value);

                if (!newVersion) {
                  return 'Must be a valid semver, such as 1.2.3-rc1. See ' +
                      'http://semver.org/'.blue.underline + ' for more details.';
                }

                if (semver.lt(newVersion, currentVersion)) {
                  return 'New version ' + newVersion.yellow + ' must be ' +
                      'greated than current version ' + currentVersion.yellow +
                      '.';
                }

                return true;
              }
            }, {
              config: 'bump.confirm',
              type: 'confirm',
              default: false,
              message: 'Are you happy with this, and ready to make a new release?'
            }
          ]
        }
      }
    },

    connect: {
      server: {
        options: {
          port: 9001,
          base: './'
        }
      }
    },

    http: {
      reportSauceLabsSuccess: {
        options: {
          url: 'saucelabs.com/rest/v1/' + process.env.SAUCE_USERNAME + '/jobs/' + process.env.TRAVIS_JOB_NUMBER,
          method: 'PUT',
          json: {
            passed: true
          },
          auth: {
            user: process.env.SAUCE_USERNAME,
            pass: <PASSWORD>.SAUCE_<PASSWORD>_<PASSWORD>
          }
        }
      }
    }
  });

  // Load the task plugins
  grunt.loadNpmTasks('grunt-contrib-jshint');<commit_msg>Add Sauce Labs job id to resp api call.<commit_after>var semver = require('semver');
var currentVersion = require('./package.json').version;

module.exports = function(grunt) {

  // Project configuration
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    concat: {
      release: {
        src: ['src/polyfill/**/*.js', 'src/core.js'],
        dest: '<%= pkg.name %>.js'
      }
    },

    preprocess: {
      options: {
        inline : true
      },
      dist: {
        src: '<%= pkg.name %>.js',
        dest: '<%= pkg.name %>.js'
      }
    },

    jshint: {
      options: {
        curly: true,
        eqeqeq: true,
        eqnull: true,
        browser: true,
        ignores: [
          'test/integration/selenium-webdriver-extract/**/*.js',
          'test/unit/coverage/**/*.js'
        ]
      },
      beforeConcat: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
      afterConcat: ['<%= pkg.name %>.js']
    },

    uglify: {
      release: {
        src: '<%= pkg.name %>.js',
        dest: '<%= pkg.name %>.min.js'
      }
    },

    replace: {
      versionPlaceholder: {
        src: '<%= pkg.name %>.js',
        overwrite: true,
        replacements: [{
          from: '@VERSION@',
          to: '<%= pkg.version %>'
        }]
      }
    },

    karma: {
      unit: {
        configFile: 'test/unit/config/karma.conf.js'
      },
      //continuous integration mode: run tests once in PhantomJS browser.
      continuous: {
        configFile: 'test/unit/config/karma.conf.js',
        singleRun: true,
        browsers: ['PhantomJS']
      },
      coverage: {
        configFile: 'test/unit/config/karma.conf.js',
        singleRun: true,
        reporters: ['coverage'],
        browsers: ['PhantomJS']
      }
    },

    shell: {
      options: {
        failOnError: true,
        stdout: true
      },
      docco: {
        // grunt-docco hangs, so we go for the shell version.
        command: './node_modules/docco/bin/docco -o doc <%= pkg.name %>.js'
      },
      gitpull: {
        command: 'git pull'
      },
      test: {
        command: 'node test/integration/basic-example'
      }
    },

    checkrepo: {
      cleanWorkingTree: {
        clean: true
      }
    },

    bump: {
      options: {
        commit: false,
        push: false,
        createTag: false,
        updateConfigs: ['pkg'],
        commitFiles: ['-a'] // Commit all files.
      }
    },

    prompt: {
      version: {
        options: {
          questions: [
            {
              config: 'bump.next',
              type: 'list',
              message: 'Bump version from ' + '<%= pkg.version %>'.cyan + ' to:',
              choices: [
                {
                  value: semver.inc(currentVersion, 'patch'),
                  name: 'Patch:  '.yellow + semver.inc(currentVersion, 'patch').yellow +
                      '  Backwards-compatible bug fixes.'
                }, {
                  value: semver.inc(currentVersion, 'minor'),
                  name: 'Minor:  '.yellow + semver.inc(currentVersion, 'minor').yellow +
                      '  Add functionality in a backwards-compatible manner.'
                }, {
                  value: semver.inc(currentVersion, 'major'),
                  name: 'Major:  '.yellow + semver.inc(currentVersion, 'major').yellow +
                      '  Incompatible API changes.'
                }, {
                  value: 'custom',
                  name: 'Custom: ?.?.?'.yellow +
                      '  Specify version...'
                }
              ]
            }, {
              config: 'bump.custom',
              type: 'input',
              message: 'What specific version would you like',
              when: function (answers) {
                return answers['bump.next'] === 'custom';
              },
              validate: function (value) {
                var newVersion = semver.valid(value);

                if (!newVersion) {
                  return 'Must be a valid semver, such as 1.2.3-rc1. See ' +
                      'http://semver.org/'.blue.underline + ' for more details.';
                }

                if (semver.lt(newVersion, currentVersion)) {
                  return 'New version ' + newVersion.yellow + ' must be ' +
                      'greated than current version ' + currentVersion.yellow +
                      '.';
                }

                return true;
              }
            }, {
              config: 'bump.confirm',
              type: 'confirm',
              default: false,
              message: 'Are you happy with this, and ready to make a new release?'
            }
          ]
        }
      }
    },

    connect: {
      server: {
        options: {
          port: 9001,
          base: './'
        }
      }
    },

    http: {
      reportSauceLabsSuccess: {
        options: {
          url: 'saucelabs.com/rest/v1/' + process.env.SAUCE_USERNAME + '/jobs/' + process.env.SAUCE_JOB_ID,
          method: 'PUT',
          json: {
            passed: true
          },
          auth: {
            user: process.env.SAUCE_USERNAME,
            pass: process.env.SAUCE_ACCESS_KEY
          }
        }
      }
    }
  });

  // Load the task plugins
  grunt.loadNpmTasks('grunt-contrib-jshint');
{'fraction_non_alphanumeric': 0.1423319822791969, 'fraction_numerical': 0.001696672636440758, 'mean_word_length': 1.2930624594769828, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 26, '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': '168778', 'n_tokens_mistral': 3233, 'n_tokens_neox': 3044, 'n_words': 631}