Skip to content
This repository has been archived by the owner on Feb 1, 2019. It is now read-only.

Commit

Permalink
Merge pull request #128 from cfpb/milestone10
Browse files Browse the repository at this point in the history
Milestone10
  • Loading branch information
poorgeek committed Apr 27, 2015
2 parents e4e3d7c + b0caacb commit 5991712
Show file tree
Hide file tree
Showing 31 changed files with 1,128 additions and 274 deletions.
64 changes: 64 additions & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"disallowSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInAnonymousFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": true
},
"disallowEmptyBlocks": true,
"disallowSpacesInsideArrayBrackets": true,
"disallowSpacesInsideParentheses": true,
"disallowSpaceAfterObjectKeys": true,
"disallowSpaceAfterPrefixUnaryOperators": true,
"disallowSpaceBeforePostfixUnaryOperators": true,
"disallowSpaceBeforeBinaryOperators": [
","
],
"disallowMixedSpacesAndTabs": true,
"disallowTrailingWhitespace": true,
"disallowTrailingComma": true,
"disallowYodaConditions": true,
"disallowKeywords": [ "with" ],
"disallowMultipleLineBreaks": true,
"requireSpaceBeforeBlockStatements": true,
"requireParenthesesAroundIIFE": true,
"requireSpacesInConditionalExpression": true,
"requireBlocksOnNewline": 1,
"requireCommaBeforeLineBreak": true,
"requireSpaceBeforeBinaryOperators": true,
"requireSpaceAfterBinaryOperators": true,
"requireLineFeedAtFileEnd": true,
"requireCapitalizedConstructors": true,
"requireDotNotation": true,
"requireSpacesInForStatement": true,
"requireSpaceBetweenArguments": true,
"requireCurlyBraces": [
"do"
],
"requireSpaceAfterKeywords": [
"if",
"else",
"for",
"while",
"do",
"switch",
"case",
"return",
"try",
"catch",
"typeof"
],
"requirePaddingNewLinesBeforeLineComments": {
"allExcept": "firstAfterCurly"
},
"safeContextKeyword": "_this",
"validateLineBreaks": "LF",
"validateQuoteMarks": "'",
"validateIndentation": 4
}
9 changes: 0 additions & 9 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@
"expr": true,
// Whether `for in` loops must filter with `hasOwnPrototype`.
"forin": false,
// Whether immediate invocations must be wrapped in parens, e.g.
// `( function(){}() );`.
"immed": true,
// Whether use before define should be forbidden.
"latedef": false,
// Whether functions should be allowed to be defined within loops.
Expand Down Expand Up @@ -118,8 +115,6 @@

// Style preferences

// Whether constructor names must be capitalized.
"newcap": false,
// Whether empty blocks should be forbidden.
"noempty": false,
// Whether using `new` for side-effects should be forbidden.
Expand All @@ -135,12 +130,8 @@
"sub": false,
// Whether trailing whitespace rules apply.
"trailing": true,
// Specify indentation.
"indent": 4,
// Whether strict whitespace rules apply.
"white": false,
// Quote formatting
"quotmark": true,

// Complexity

Expand Down
24 changes: 23 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

// jscs:disable
var exec = require('child_process').exec;

module.exports = function (grunt) {
Expand Down Expand Up @@ -86,6 +87,26 @@ module.exports = function (grunt) {
}
},

// Make sure code styles are up to par and there are no obvious mistakes
jscs: {
options: {
config: '.jscsrc',
reporter: require('jscs-stylish').path
},
all: {
src: [
'engine.js',
'lib/{,*/}*.js',
'test/{,*/}*Spec.js'
]
},
test: {
src: [
'test/{,*/}*Spec.js'
]
}
},

jsdoc : {
dist : {
src: ['engine.js', 'lib/*.js', 'timing/*.js', 'README.md'],
Expand All @@ -106,6 +127,7 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-develop');
grunt.loadNpmTasks('grunt-env');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-jscs');
grunt.loadNpmTasks('grunt-release');
grunt.loadNpmTasks('grunt-jsdoc');

Expand All @@ -121,7 +143,7 @@ module.exports = function (grunt) {

// Register group tasks
grunt.registerTask('clean_all', [ 'clean:node_modules', 'clean:coverage', 'npm_install' ]);
grunt.registerTask('test', ['env:test', 'clean:coverage', 'jshint', 'mocha_istanbul']);
grunt.registerTask('test', ['env:test', 'clean:coverage', 'jscs:all', 'jshint', 'mocha_istanbul']);
grunt.registerTask('coverage', ['test', 'open_coverage' ]);
grunt.registerTask('generate-docs', ['clean:docs', 'jsdoc']);
grunt.registerTask('view-docs', ['generate-docs', 'open_docs']);
Expand Down
Loading

0 comments on commit 5991712

Please sign in to comment.