Skip to content

Commit

Permalink
code styling and code quality checking
Browse files Browse the repository at this point in the history
  • Loading branch information
markharding committed May 14, 2015
1 parent 4f78173 commit ec34df4
Show file tree
Hide file tree
Showing 64 changed files with 6,905 additions and 6,902 deletions.
40 changes: 40 additions & 0 deletions .jscs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"excludeFiles": ["tests/spec/angular-mocks.js"],
"disallowKeywords": ["with"],
"disallowMixedSpacesAndTabs": true,
"disallowMultipleLineStrings": true,
"disallowNewlineBeforeBlockStatements": true,
"disallowSpaceAfterObjectKeys": true,
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
"disallowSpaceBeforeBinaryOperators": [","],
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"disallowSpacesInAnonymousFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInsideArrayBrackets": true,
"disallowTrailingComma": true,
"disallowTrailingWhitespace": true,
"requireCommaBeforeLineBreak": true,
"requireLineFeedAtFileEnd": true,
"requireSpaceAfterBinaryOperators": ["?", ":", "+", "-", "/", "*", "%", "==", "===", "!=", "!==", ">", ">=", "<", "<=", "&&", "||"],
"requireSpaceBeforeBinaryOperators": ["?", ":", "+", "-", "/", "*", "%", "==", "===", "!=", "!==", ">", ">=", "<", "<=", "&&", "||"],
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"],
"requireSpaceBeforeBlockStatements": true,
"requireSpacesInConditionalExpression": {
"afterTest": true,
"beforeConsequent": true,
"afterConsequent": true,
"beforeAlternate": true
},
"requireSpacesInFunction": {
"beforeOpeningCurlyBrace": true
},
"validateLineBreaks": "LF",
"validateParameterSeparator": ", "
}
5 changes: 5 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": ".jshintrc-base",
"node": true,
"globals": {}
}
19 changes: 19 additions & 0 deletions .jshintrc-base
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"bitwise": true,
"immed": true,
"newcap": true,
"noarg": true,
"noempty": true,
"nonew": true,
"trailing": true,
"maxlen": 200,
"boss": true,
"eqnull": true,
"expr": true,
"globalstrict": true,
"laxbreak": true,
"loopfunc": true,
"sub": true,
"indent": 2,
"-W032": false
}
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ language: node_js
node_js:
- '0.10'

script: node_modules/karma/bin/karma start karma.conf.js --single-run
script: grunt test

before_script:
#- export CHROME_BIN=chromium-browser
Expand Down
108 changes: 62 additions & 46 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,48 +1,64 @@
module.exports = function (grunt) {

grunt.initConfig({

cssmin: {
compress: {
files: {
'www/css/style.css': [
'www/css/core.css',
'www/css/buttons.css',
'www/css/components.css',
'www/css/newsfeed.css',
'www/css/channel.css',
'www/css/gatherings.css',
'www/css/notifications.css',
'www/css/capture.css',
'www/css/wallet.css',
'www/css/comments.css'
]
}
}
},
karma: {
unit: {
configFile: 'karma.conf.js',
singleRun: true
}
}


});

grunt.loadTasks('tasks');

grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-contrib-cssmin');

/**
* Compile
*/
grunt.registerTask('compile', ['cssmin']);

/**
* Test
*/
grunt.registerTask('test', ['karma']);
module.exports = function(grunt) {

grunt.initConfig({

cssmin : {
compress : {
files : {
'www/css/style.css' : [
'www/css/core.css',
'www/css/buttons.css',
'www/css/components.css',
'www/css/newsfeed.css',
'www/css/channel.css',
'www/css/gatherings.css',
'www/css/notifications.css',
'www/css/capture.css',
'www/css/wallet.css',
'www/css/comments.css'
]
}
}
},
karma : {
unit : {
configFile : 'karma.conf.js',
singleRun : true
}
},
jscs : {
src : ['www/js/**/*.js', 'tests/spec/**/*.js'],
options : {
config : ".jscs.json",
fix: true
}
},
jshint: {
options: {
jshintrc: true,
},
www: {
src: ['www/js/**/*.js', 'www/js/**/**/*.js']
},
}

});

grunt.loadTasks('tasks');

grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-jscs');

/**
* Compile
*/
grunt.registerTask('compile', ['cssmin']);

/**
* Test
*/
grunt.registerTask('test', ['karma', 'jscs', 'jshint']);

}
19 changes: 0 additions & 19 deletions fix.sh

This file was deleted.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
"cordova": "5.0.0",
"grunt": "~0.4.5",
"grunt-contrib-cssmin": "~0.10.0",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-jshint": "~0.11.2",
"grunt-contrib-nodeunit": "~0.4.1",
"grunt-contrib-uglify": "~0.5.0",
"grunt-karma": "0.10.1",
"grunt-jscs": "~1.8.0",
"karma": "^0.12.31",
"karma-chrome-launcher": "^0.1.10",
"karma-jasmine": "^0.3.5",
Expand Down
Loading

0 comments on commit ec34df4

Please sign in to comment.