-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Task runner and common dev tasks. Closes gh-118
commit 4c5adb3059e1ae46ca9fe6a068042921e0d9c740 Author: Rick Waldron <waldron.rick@gmail.com> Date: Mon May 18 12:14:55 2015 -0400 grunt-jsbeautifier -> jsbeautifier commit 32e1db709052523a4b67d8bdbca9ab22c9f9d672 Author: Rick Waldron <waldron.rick@gmail.com> Date: Wed May 13 18:09:59 2015 -0400 gruntfile.js: update default/test commit 228997da6a9fb8d5d973930ab981ea976ef1877c Author: Rick Waldron <waldron.rick@gmail.com> Date: Wed May 13 18:08:49 2015 -0400 gruntfile.js: correct name of nodeunit task runner. commit 7807df3e8350c37c455f286c8370223dcbce2ff7 Author: Rick Waldron <waldron.rick@gmail.com> Date: Wed May 13 17:49:35 2015 -0400 grunt-jsbeautifier: fix options commit 45c411a95c155c833ff810c1d219bc72bf3d693c Author: Rick Waldron <waldron.rick@gmail.com> Date: Wed May 13 17:48:41 2015 -0400 grunt-jsbeautifier: remove VERIFY_ONLY flag commit b5cd6df349d7fbb91521e9ad8303c94852a85d5c Author: Rick Waldron <waldron.rick@gmail.com> Date: Wed May 13 17:46:14 2015 -0400 grunt, grunt-cli, basic code maintenance tasks.
- Loading branch information
Showing
5 changed files
with
169 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"requireCurlyBraces": [ | ||
"if", | ||
"else", | ||
"for", | ||
"while", | ||
"do", | ||
"try", | ||
"catch" | ||
], | ||
"disallowNewlineBeforeBlockStatements": true, | ||
"requireSpaceBeforeBlockStatements": true, | ||
"requireParenthesesAroundIIFE": true, | ||
"requireSpacesInConditionalExpression": true, | ||
"requireSpaceAfterKeywords": [ | ||
"if", "else", | ||
"switch", "case", | ||
"try", "catch", | ||
"do", "while", "for", | ||
"return", "typeof", "void" | ||
], | ||
"validateQuoteMarks": { | ||
"mark": "'", | ||
"escape": true | ||
}, | ||
"excludeFiles": [ | ||
"node_modules/**/*.js" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"loopfunc": true, | ||
"laxcomma": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"immed": true, | ||
"latedef": false, | ||
"newcap": false, | ||
"noarg": true, | ||
"sub": true, | ||
"undef": true, | ||
"boss": true, | ||
"eqnull": true, | ||
"node": true, | ||
"strict": false, | ||
"esnext": true, | ||
"unused": true, | ||
"globals": { | ||
"exports": true, | ||
"document": true, | ||
"Promise": true, | ||
"copy": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
module.exports = function(grunt) { | ||
|
||
// Project configuration. | ||
grunt.initConfig({ | ||
nodeunit: { | ||
tests: [ | ||
'test/unit/*.js' | ||
] | ||
}, | ||
jshint: { | ||
options: { | ||
jshintrc: '.jshintrc' | ||
}, | ||
all: [ | ||
'bin/*', | ||
'lib/**/*.js', | ||
'test/**/*.js', | ||
'Gruntfile.js', | ||
|
||
// This is commented out because there are | ||
// too many errors to address. I went through | ||
// half of them and still: | ||
// | ||
// >> 75 errors in 3 files | ||
// | ||
// There are a lot of undefined vars being used | ||
// and without fully understanding these files, it's | ||
// not worth the effort to fix them all. | ||
// 'resources/**/*.js', | ||
] | ||
}, | ||
jscs: { | ||
all: [ | ||
'bin/*', | ||
'lib/**/*.js', | ||
'test/**/*.js', | ||
'Gruntfile.js', | ||
// 'resources/**/*.js', | ||
], | ||
options: { | ||
config: '.jscsrc' | ||
} | ||
}, | ||
jsbeautifier: { | ||
all: [ | ||
'bin/*', | ||
'lib/**/*.js', | ||
'test/**/*.js', | ||
'Gruntfile.js', | ||
// 'resources/**/*.js', | ||
], | ||
options: { | ||
js: { | ||
braceStyle: "collapse", | ||
breakChainedMethods: false, | ||
e4x: false, | ||
evalCode: false, | ||
indentChar: " ", | ||
indentLevel: 0, | ||
indentSize: 2, | ||
indentWithTabs: false, | ||
jslintHappy: false, | ||
keepArrayIndentation: false, | ||
keepFunctionIndentation: false, | ||
maxPreserveNewlines: 10, | ||
preserveNewlines: true, | ||
spaceBeforeConditional: true, | ||
spaceInParen: false, | ||
unescapeStrings: false, | ||
wrapLineLength: 0 | ||
} | ||
} | ||
}, | ||
watch: { | ||
src: { | ||
files: [ | ||
'Gruntfile.js', | ||
'lib/**/!(johnny-five)*.js', | ||
'test/**/*.js', | ||
'eg/**/*.js' | ||
], | ||
tasks: ['default'], | ||
options: { | ||
interrupt: true, | ||
}, | ||
} | ||
} | ||
}); | ||
|
||
// These plugins provide necessary tasks. | ||
grunt.loadNpmTasks('grunt-contrib-jshint'); | ||
grunt.loadNpmTasks('grunt-contrib-nodeunit'); | ||
grunt.loadNpmTasks('grunt-jscs'); | ||
grunt.loadNpmTasks('grunt-jsbeautifier'); | ||
|
||
|
||
// 'npm test' runs these tasks | ||
grunt.registerTask('test', ['jshint', 'jscs', 'jsbeautifier' /*, nodeunit*/]); | ||
|
||
// Default task. | ||
grunt.registerTask('default', ['test']); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
TODO: | ||
|
||
- write auto-mocks | ||
- install sinon | ||
- write units for existing functionality |