<commit_before>/* global module: true */
module.exports = function (grunt) {
  "use strict";

  var hintFiles = [
    "Gruntfile.js",
    "package.json",
    ".jshintrc",
    ".jsbeautifyrc",
    "src/**/*.js",
    "test/**/*.js",
    "test/.jshintrc",
    "karma/*",
  ];

  grunt.initConfig({
    pkg: grunt.file.readJSON("package.json"),
    watch: {
      files: hintFiles,
      tasks: ["test"]
    },
    jshint: {
      files: hintFiles,
      options: {
        extensions: ".js, .jshintrc, .jsbeautifyrc",
        jshintrc: true
      }
    },
    jsbeautifier: {
      "write": {
        src: hintFiles,
        options: {
          config: ".jsbeautifyrc"
        }
      },
      "verify": {
        src: hintFiles,
        options: {
          config: ".jsbeautifyrc",
          mode: "VERIFY_ONLY"
        }
      }
    },
    jasmine: {
      default: {
        src: ["src/gurps.js", "src/**/*.js"],
        options: {
          keepRunner: true,
          specs: "test/**/*.js"
        }
      }
    },
    autowrap: {
      nodefy: {
        options: {
          wrapType: "exports"
        },
        files: {
          "lib/main.js": ["src/gurps.js", "src/*.js"],
        },
      }
    },
    clean: {
      build: ["lib"]
    },
    karma: {
      options: {
        /*preprocessors: {
          //all but polyfill
          "src/!(polyfill).js": ["coverage"]
        },
        coverageReporter: {
          reporters: [{
            type: "lcovonly",
            dir: 'coverage/'
          }, {
            //type: "text-summary"
            type: "text"
          }],
        },*/
        basePath: "..", //default is *.conf.js path
        files: ["src/gurps.js", "src/*.js", "test/*.js"],
        frameworks: ["jasmine"]
      },
      browserstack: {
        configFile: "karma/browserstack.conf.js",
        singleRun: true
      },
      unit: {
        configFile: "karma/local.conf.js"
      }
    }
  });

  /* loading plugins */

  grunt.loadNpmTasks("grunt-contrib-watch");
  grunt.loadNpmTasks("grunt-contrib-jshint");
  grunt.loadNpmTasks("grunt-contrib-jasmine");
  grunt.loadNpmTasks("grunt-contrib-clean");
  grunt.loadNpmTasks("grunt-jsbeautifier");
  grunt.loadNpmTasks("grunt-autowrap");
  grunt.loadNpmTasks("grunt-karma");

  /* tasks */

  //test
  var pullRequest = process.env.TRAVIS_PULL_REQUEST,
    travisTasks = [];
  if (pullRequest !== "false") {
    travisTasks.push("browserstack");
  }
  console.log("process.env.TRAVIS_PULL_REQUEST:");
  console.log(process.env.TRAVIS_PULL_REQUEST);
  grunt.registerTask("test", ["jasmine"]); //through phantomjs
  grunt.registerTask("browserstack", ["karma:browserstack"]);
  grunt.registerTask("travis", travisTasks)
  grunt.registerTask("browsers", ["karma:unit"]);

  //code quality
  grunt.registerTask("format", ["jshint", "jsbeautifier:write"]);
  grunt.registerTask("verify", ["jshint", "jsbeautifier:verify"]);
  grunt.registerTask("lint", ["jshint"]);

  //build
  grunt.registerTask("build", ["autowrap:nodefy"]);
  //grunt.registerTask("clean", ["clean:build"]);

  //develop
  grunt.registerTask("dev", ["default", "watch"]);
  grunt.registerTask("default", ["test", "verify"]);

};<commit_msg>fixing travis browserstack integration<commit_after>/* global module: true */
module.exports = function (grunt) {
  "use strict";

  var hintFiles = [
    "Gruntfile.js",
    "package.json",
    ".jshintrc",
    ".jsbeautifyrc",
    "src/**/*.js",
    "test/**/*.js",
    "test/.jshintrc",
    "karma/*",
  ];

  grunt.initConfig({
    pkg: grunt.file.readJSON("package.json"),
    watch: {
      files: hintFiles,
      tasks: ["test"]
    },
    jshint: {
      files: hintFiles,
      options: {
        extensions: ".js, .jshintrc, .jsbeautifyrc",
        jshintrc: true
      }
    },
    jsbeautifier: {
      "write": {
        src: hintFiles,
        options: {
          config: ".jsbeautifyrc"
        }
      },
      "verify": {
        src: hintFiles,
        options: {
          config: ".jsbeautifyrc",
          mode: "VERIFY_ONLY"
        }
      }
    },
    jasmine: {
      default: {
        src: ["src/gurps.js", "src/**/*.js"],
        options: {
          keepRunner: true,
          specs: "test/**/*.js"
        }
      }
    },
    autowrap: {
      nodefy: {
        options: {
          wrapType: "exports"
        },
        files: {
          "lib/main.js": ["src/gurps.js", "src/*.js"],
        },
      }
    },
    clean: {
      build: ["lib"]
    },
    karma: {
      options: {
        /*preprocessors: {
          //all but polyfill
          "src/!(polyfill).js": ["coverage"]
        },
        coverageReporter: {
          reporters: [{
            type: "lcovonly",
            dir: 'coverage/'
          }, {
            //type: "text-summary"
            type: "text"
          }],
        },*/
        basePath: "..", //default is *.conf.js path
        files: ["src/gurps.js", "src/*.js", "test/*.js"],
        frameworks: ["jasmine"]
      },
      browserstack: {
        configFile: "karma/browserstack.conf.js",
        singleRun: true
      },
      unit: {
        configFile: "karma/local.conf.js"
      }
    }
  });

  /* loading plugins */

  grunt.loadNpmTasks("grunt-contrib-watch");
  grunt.loadNpmTasks("grunt-contrib-jshint");
  grunt.loadNpmTasks("grunt-contrib-jasmine");
  grunt.loadNpmTasks("grunt-contrib-clean");
  grunt.loadNpmTasks("grunt-jsbeautifier");
  grunt.loadNpmTasks("grunt-autowrap");
  grunt.loadNpmTasks("grunt-karma");

  /* tasks */

  //test
  var pullRequest = process.env.TRAVIS_PULL_REQUEST,
    travisTasks = [];
  if (pullRequest === "false") {
    travisTasks.push("browserstack");
  }
  grunt.registerTask("test", ["jasmine"]); //through phantomjs
  grunt.registerTask("browserstack", ["karma:browserstack"]);
  grunt.registerTask("travis", travisTasks)
  grunt.registerTask("browsers", ["karma:unit"]);

  //code quality
  grunt.registerTask("format", ["jshint", "jsbeautifier:write"]);
  grunt.registerTask("verify", ["jshint", "jsbeautifier:verify"]);
  grunt.registerTask("lint", ["jshint"]);

  //build
  grunt.registerTask("build", ["autowrap:nodefy"]);
  //grunt.registerTask("clean", ["clean:build"]);

  //develop
  grunt.registerTask("dev", ["default", "watch"]);
  grunt.registerTask("default", ["test", "verify"]);

};
{'fraction_non_alphanumeric': 0.18490983865865232, 'fraction_numerical': 0.0, 'mean_word_length': 2.1209279368213227, 'pattern_counts': {'":': 8, '<': 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': '1815597', 'n_tokens_mistral': 2220, 'n_tokens_neox': 2197, 'n_words': 329}