Sha256: 739ba9c5b25b092d6691193ef12eb27c37f8884bb17f7e20cae11b9aa4d4c776

Contents?: true

Size: 831 Bytes

Versions: 20

Compression:

Stored size: 831 Bytes

Contents

/**
 * @author kamil@causes.com
 *
 * This is a script to run jshint against files passed in via
 * command line arguments
 **/

if (typeof JSHINT === "undefined") {
  print("jshint not available. Make sure it was included properly.");
  quit();
}

// Options:
// https://gist.github.com/1489652

var i, j, file, source, result, error,
  options = {
    boss:   true,
    curly:  true,
    eqeqeq: true,
    forin:  true,
    newcap: true
  };

for (i = 0; i < arguments.length; i++) {

  file = arguments[i];
  source = readFile(file);
  result = JSHINT(source, options);

  if (!result) {
    for (j = 0; j < JSHINT.errors.length; j++) {
      error = JSHINT.errors[j];

      print(file + ": line " + error.line + ", col  " + error.character + ", " +
            error.reason);
      print("\t" + error.evidence);
    }
  }
}


Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
overcommit-0.5.0 bin/scripts/jshint_runner.js
overcommit-0.4.1 bin/scripts/jshint_runner.js
overcommit-0.4.0 bin/scripts/jshint_runner.js
overcommit-0.3.2 bin/scripts/jshint_runner.js
overcommit-0.3.1 bin/scripts/jshint_runner.js
overcommit-0.3.0 bin/scripts/jshint_runner.js
overcommit-0.2.6 bin/scripts/jshint_runner.js
overcommit-0.2.5 bin/scripts/jshint_runner.js
overcommit-0.2.4 bin/scripts/jshint_runner.js
overcommit-0.2.3 bin/scripts/jshint_runner.js
overcommit-0.2.2 bin/scripts/jshint_runner.js
overcommit-0.2.1 bin/scripts/jshint_runner.js
overcommit-0.2.0 bin/scripts/jshint_runner.js
overcommit-0.1.11 bin/scripts/jshint_runner.js
overcommit-0.1.10 bin/scripts/jshint_runner.js
overcommit-0.1.9 bin/scripts/jshint_runner.js
overcommit-0.1.8 bin/scripts/jshint_runner.js
overcommit-0.1.7 bin/scripts/jshint_runner.js
overcommit-0.1.6 bin/scripts/jshint_runner.js
overcommit-0.1.5 bin/scripts/jshint_runner.js