Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated jshint, fixed the nodejshint script, and changed to comma fir…

…st in hintcheck
  • Loading branch information...
commit d246c7b4fb7459ba723d028a3ca7791e352b0111 1 parent 23015f4
@tbranyen tbranyen authored
Showing with 483 additions and 2,545 deletions.
  1. +31 −29 util/hint-check.js
  2. +448 −2,510 util/jshint.js
  3. +4 −6 util/nodejshint.js
View
60 util/hint-check.js
@@ -2,42 +2,44 @@ var nodejshint = require( './nodejshint.js' ).test,
files = [
// Test convenience api
- 'lib/blob.js',
- 'lib/commit.js',
- 'lib/error.js',
- 'lib/index.js',
- 'lib/object.js',
- 'lib/oid.js',
- 'lib/ref.js',
- 'lib/repo.js',
- 'lib/revwalk.js',
- 'lib/sig.js',
- 'lib/tree.js',
- 'lib/tree_entry.js',
- 'lib/util.js',
+ 'lib/blob.js'
+, 'lib/commit.js'
+, 'lib/error.js'
+, 'lib/index.js'
+, 'lib/object.js'
+, 'lib/oid.js'
+, 'lib/ref.js'
+, 'lib/repo.js'
+, 'lib/revwalk.js'
+, 'lib/sig.js'
+, 'lib/tree.js'
+, 'lib/tree_entry.js'
+, 'lib/util.js'
// Test unit test
- 'test/convenience-repo.js',
- 'test/index.js',
- 'test/raw-blob.js',
- 'test/raw-commit.js',
- 'test/raw-error.js',
- 'test/raw-obj.js',
- 'test/raw-oid.js',
- 'test/raw-ref.js',
- 'test/raw-repo.js',
- 'test/raw-revwalk.js',
+, 'test/convenience-repo.js'
+, 'test/index.js'
+, 'test/raw-blob.js'
+, 'test/raw-commit.js'
+, 'test/raw-error.js'
+, 'test/raw-object.js'
+, 'test/raw-oid.js'
+, 'test/raw-reference.js'
+, 'test/raw-repo.js'
+, 'test/raw-revwalk.js'
// Test examples
- 'example/convenience-repo.js',
- 'example/convenience-tree.js',
- 'example/raw-error.js',
- 'example/raw-oid.js',
- 'example/raw-repo.js',
- 'example/raw-revwalk.js'
+, 'example/convenience-repo.js'
+, 'example/convenience-tree.js'
+, 'example/raw-error.js'
+, 'example/raw-oid.js'
+, 'example/raw-repo.js'
+, 'example/raw-revwalk.js'
];
nodejshint( files, function( failures ) {
+ console.log( failures, 'failures' );
+
if( !files.length ) {
process.exit( 0 );
}
View
2,958 util/jshint.js
448 additions, 2,510 deletions not shown
View
10 util/nodejshint.js
@@ -1,25 +1,23 @@
-var JSHINT = require( './jshint.js' ).JSHINT,
- fs = require( 'fs' );
+var JSHINT = require( './jshint.js' ).JSHINT
+ , fs = require( 'fs' );
var nodejshint = function() {
var counter = 0;
return function( files, callback ) {
if( files.length ) {
- var file = files.pop(),
- pass = false;
+ var file = files.pop();
fs.readFile( file, function( err, data ) {
if (err) { throw err; }
- if( pass = JSHINT( data.toString() ), pass, { laxbreak: true } ) {
+ if( JSHINT(data.toString(), { laxbreak: true }) ) {
counter++;
console.log( '✔ Passed '+ file );
}
else {
console.log( 'x Failed '+ file );
JSHINT.errors.forEach( function( err ) {
-
if( err ) {
console.log( 'line '+ err.line +'\t', err.reason +'' );
}
Please sign in to comment.
Something went wrong with that request. Please try again.