Skip to content

Commit

Permalink
jshint started
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasplevy committed Mar 4, 2016
1 parent d17b95b commit 786fb37
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 11 deletions.
20 changes: 10 additions & 10 deletions .jshintrc
Expand Up @@ -2,32 +2,32 @@
// JSHint Default Configuration File (as on JSHint website)
// See http://jshint.com/docs/ for more details

"maxerr" : 50, // {int} Maximum error before stopping
"maxerr" : 5, // {int} Maximum error before stopping

// Enforcing
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : false, // true: Identifiers must be in camelCase
"curly" : true, // true: Require {} for every new block or scope
"eqeqeq" : true, // true: Require triple equals (===) for comparison
"forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty()
"freeze" : true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc.
"forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty()
"immed" : false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
"indent" : 4, // {int} Number of spaces to use for indentation
"latedef" : false, // true: Require variables/functions to be defined before being used
"newcap" : false, // true: Require capitalization of all constructor functions e.g. `new F()`
"latedef" : true, // true: Require variables/functions to be defined before being used
"newcap" : true, // true: Require capitalization of all constructor functions e.g. `new F()`
"noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
"noempty" : true, // true: Prohibit use of empty blocks
"nonbsp" : false, // true: Prohibit "non-breaking whitespace" characters.
"nonbsp" : true, // true: Prohibit "non-breaking whitespace" characters.
"nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment)
"plusplus" : false, // true: Prohibit use of `++` & `--`
"quotmark" : false, // Quotation mark consistency:
"quotmark" : "single", // Quotation mark consistency:
// false : do nothing (default)
// true : ensure whatever is used is consistent
// "single" : require single quotes
// "double" : require double quotes
"undef" : true, // true: Require all non-global variables to be declared (prevents global leaks)
"unused" : true, // true: Require all defined variables be used
"strict" : true, // true: Requires all functions run in ES5 Strict Mode
"strict" : false, // true: Requires all functions run in ES5 Strict Mode
"maxparams" : false, // {int} Max number of formal params allowed per function
"maxdepth" : false, // {int} Max depth of nested blocks (within functions)
"maxstatements" : false, // {int} Max number statements per function
Expand Down Expand Up @@ -69,19 +69,19 @@
"devel" : true, // Development/debugging (alert, confirm, etc)
"dojo" : false, // Dojo Toolkit
"jasmine" : false, // Jasmine
"jquery" : false, // jQuery
"jquery" : true, // jQuery
"mocha" : true, // Mocha
"mootools" : false, // MooTools
"node" : false, // Node.js
"nonstandard" : false, // Widely adopted globals (escape, unescape, etc)
"prototypejs" : false, // Prototype and Scriptaculous
"qunit" : false, // QUnit
"rhino" : false, // Rhino
"shelljs" : false, // ShellJS
"shelljs" : false, // ShellJS
"worker" : false, // Web Workers
"wsh" : false, // Windows Scripting Host
"yui" : false, // Yahoo User Interface

// Custom Globals
"globals" : {} // additional predefined global variables
}
}
8 changes: 7 additions & 1 deletion .travis.yml
Expand Up @@ -2,6 +2,13 @@ language: php

sudo: false

# blacklist branches
branches:
except:
- trunk
- assets
- /^release-v.*$/

matrix:
# allow_failures:
# - php: hhvm
Expand Down Expand Up @@ -54,7 +61,6 @@ before_script:

script:
- if [[ "$PHPLINT" == "1" ]]; then find -L . -path ./vendor -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l; fi
# - if [[ "$PHPLINT" == "1" ]]; then vendor/bin/phpcs -v; fi
- if [[ "$PHPCS" == "1" ]]; then npm install -g gulp && npm install --no-optional && gulp phpcs --warning 0; fi
# - if [[ "$COVERAGE" == "1" ]]; then phpunit -c phpunit.xml --coverage-clover build/logs/clover.xml; else phpunit -c phpunit.xml; fi
# - if [[ "$COVERAGE" == "1" ]]; then vendor/bin/test-reporter; fi
Expand Down
3 changes: 3 additions & 0 deletions README.md
@@ -1,6 +1,9 @@
LifterLMS
==========

Master [![Build Status](https://travis-ci.com/gocodebox/lifterlms.svg?token=cynuTFxuKtxvAs4e2hNZ&branch=master)](https://travis-ci.com/gocodebox/lifterlms)
Develop [![Build Status](https://travis-ci.com/gocodebox/lifterlms.svg?token=cynuTFxuKtxvAs4e2hNZ&branch=develop)](https://travis-ci.com/gocodebox/lifterlms)

LifterLMS, the #1 WordPress LMS solution, makes it easy to create, sell, and protect engaging online courses.

### [Changelog](./CHANGELOG.md)
Expand Down
41 changes: 41 additions & 0 deletions gulpfile.js/tasks/jshint.js
@@ -0,0 +1,41 @@
/**
* -----------------------------------------------------------
* jshint
* -----------------------------------------------------------
*
* Run jshint against JS files
* in the project
*
*/

var gulp = require( 'gulp' )
, argv = require( 'yargs' ).argv
, jshint = require( 'gulp-jshint' )
, notify = require( 'gulp-notify' )
;

// parse a file or run default on all ph
var glob = ( argv.file ) ? argv.file : [
'./_private/js/**/*.js',
];


gulp.task( 'jshint', function() {

gulp.src( glob )

.pipe( jshint( '.jshintrc' ) )

.pipe( jshint.reporter( 'jshint-stylish' ) )

.pipe( jshint.reporter( 'fail' ) )

.on( 'error', notify.onError( {

message: '<%= error.message %>',
sound: 'Funk',
title: 'jshint error'

} ) );

} );

0 comments on commit 786fb37

Please sign in to comment.