mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Dev environment:force indentation to 2 spaces. Added new grunt module, grunt-leading-indent to check space consistency, and modified jshint options to enforce 2 spaces
This commit is contained in:
19
Gruntfile.js
19
Gruntfile.js
@ -19,6 +19,9 @@ module.exports = function(grunt) {
|
||||
"smarttabs": true,
|
||||
"eqnull": true
|
||||
},*/
|
||||
options: {
|
||||
indent:2
|
||||
},
|
||||
files: [
|
||||
'Gruntfile.js',
|
||||
'package.json',
|
||||
@ -39,8 +42,7 @@ module.exports = function(grunt) {
|
||||
filesSrc: ['tests/integration/casperjs/*_test.js'],
|
||||
options: {
|
||||
args: {
|
||||
baseUrl: 'http://localhost:' +
|
||||
'<%= connect.www.options.port %>/'
|
||||
baseUrl: 'http://localhost:' + '<%= connect.www.options.port %>/'
|
||||
},
|
||||
direct: false,
|
||||
logLevel: 'error',
|
||||
@ -51,10 +53,21 @@ module.exports = function(grunt) {
|
||||
}
|
||||
});
|
||||
|
||||
grunt.config.set('leadingIndent.indentation', 'spaces');
|
||||
grunt.config.set('leadingIndent.jsFiles', {
|
||||
src: ['js/**/*.js','!js/lib/**/*.js']
|
||||
});
|
||||
grunt.config.set('leadingIndent.cssFiles', {
|
||||
src: ['css/**/*.css']
|
||||
});
|
||||
|
||||
|
||||
grunt.loadNpmTasks('grunt-leading-indent');
|
||||
grunt.loadNpmTasks('grunt-contrib-connect');
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-ghost');
|
||||
|
||||
grunt.registerTask('check-indent', ['leadingIndent:jsFiles', 'leadingIndent:cssFiles']);
|
||||
grunt.registerTask('lint', ['jshint']);
|
||||
grunt.registerTask('test', ['jshint', 'connect', 'ghost']);
|
||||
grunt.registerTask('test', ['leadingIndent:jsFiles', 'leadingIndent:cssFiles', 'jshint', 'connect', 'ghost']);
|
||||
};
|
||||
|
@ -179,7 +179,7 @@
|
||||
|
||||
$.publish(Events.TOOL_RELEASED);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
@ -192,7 +192,7 @@
|
||||
evtInfo.button = Constants.RIGHT_BUTTON;
|
||||
}
|
||||
return evtInfo;
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
|
@ -41,8 +41,10 @@
|
||||
*/
|
||||
getOrderedRectangleCoordinates : function (x0, y0, x1, y1) {
|
||||
return {
|
||||
x0 : Math.min(x0, x1), y0 : Math.min(y0, y1),
|
||||
x1 : Math.max(x0, x1), y1 : Math.max(y0, y1),
|
||||
x0 : Math.min(x0, x1),
|
||||
y0 : Math.min(y0, y1),
|
||||
x1 : Math.max(x0, x1),
|
||||
y1 : Math.max(y0, y1),
|
||||
};
|
||||
},
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
"grunt": "~0.4.1",
|
||||
"grunt-contrib-connect": "0.3.0",
|
||||
"grunt-contrib-jshint": "0.5.4",
|
||||
"grunt-ghost": "1.0.12"
|
||||
"grunt-ghost": "1.0.12",
|
||||
"grunt-leading-indent" : "0.1.0"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user