Add Grunt infrastructure for CI

* Add package.json based on Flow's
* Add Gruntfile.js based on Flow's
* Add .csslintrc and .jscsrc with rules to silence errors for now
* Add .gitignore (!) to ignore node_modules/

Change-Id: I2db213da2f0ce77567f7968e73af9cdd6ed9da82
This commit is contained in:
Roan Kattouw 2015-05-01 20:49:09 -07:00
parent c7889f2e91
commit 8b9bc3a44f
5 changed files with 106 additions and 0 deletions

13
.csslintrc Normal file
View file

@ -0,0 +1,13 @@
{
"adjoining-classes": false,
"box-model": false,
"box-sizing": false,
"fallback-colors": false,
"ids": false,
"important": false,
"outline-none": false,
"overqualified-elements": false,
"qualified-headings": false,
"universal-selector": false,
"unqualified-attributes": false
}

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
node_modules

23
.jscsrc Normal file
View file

@ -0,0 +1,23 @@
{
"preset": "wikimedia",
"requireMultipleVarDecl": null,
"requireSpaceAfterLineComment": null,
"requireSpacesInsideParentheses": null,
"requireSpaceBeforeKeywords": null,
"disallowImplicitTypeConversion": null,
"disallowSpacesInCallExpression": null,
"disallowOperatorBeforeLineBreak": null,
"requireLineBreakAfterVariableAssignment": null,
"disallowSpaceAfterPrefixUnaryOperators": null,
"requireSpaceAfterKeywords": null,
"requireSpacesInsideArrayBrackets": null,
"disallowQuotedKeysInObjects": null,
"disallowDanglingUnderscores": null,
"disallowSpaceAfterObjectKeys": null,
"disallowMultipleLineBreaks": null,
"requireCamelCaseOrUpperCaseIdentifiers": null,
"validateQuoteMarks": null,
"validateIndentation": null
}

51
Gruntfile.js Normal file
View file

@ -0,0 +1,51 @@
/*!
* Grunt file
*
* @package Flow
*/
/*jshint node:true */
module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-contrib-csslint' );
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-jscs' );
grunt.initConfig( {
jshint: {
options: {
jshintrc: true
},
all: [
'*.js',
'modules/**/*.js',
'tests/qunit/**/*.js'
]
},
jscs: {
src: '<%= jshint.all %>'
},
csslint: {
options: {
csslintrc: '.csslintrc'
},
all: 'modules/**/*.css'
},
banana: {
all: 'i18n/'
},
watch: {
files: [
'.{csslintrc,jscsrc,jshintignore,jshintrc}',
'<%= jshint.all %>',
'<%= csslint.all %>'
],
tasks: 'test'
}
} );
grunt.registerTask( 'lint', [ 'jscs', 'jshint', 'csslint', 'banana' ] );
grunt.registerTask( 'test', 'lint' );
grunt.registerTask( 'default', 'test' );
};

18
package.json Normal file
View file

@ -0,0 +1,18 @@
{
"name": "thanks",
"version": "0.0.0",
"private": true,
"description": "Build tools for Thanks.",
"scripts": {
"test": "grunt test"
},
"devDependencies": {
"grunt": "0.4.5",
"grunt-contrib-csslint": "0.2.0",
"grunt-contrib-jshint": "0.10.0",
"grunt-contrib-watch": "0.6.1",
"grunt-banana-checker": "0.2.0",
"grunt-jscs": "1.8.0",
"jshint": "~2.5.0"
}
}