8
0
Просмотр исходного кода

Added git hooks support for pre-commit linting.

fredck 11 лет назад
Родитель
Сommit
b27ebb0053
2 измененных файлов с 9 добавлено и 1 удалено
  1. 7 0
      gruntfile.js
  2. 2 1
      package.json

+ 7 - 0
gruntfile.js

@@ -10,11 +10,18 @@ module.exports = function( grunt ) {
 		jscs: {
 		jscs: {
 			src: '*.js',
 			src: '*.js',
 			options: jscsConfig
 			options: jscsConfig
+		},
+
+		githooks: {
+			all: {
+				'pre-commit': 'default'
+			}
 		}
 		}
 	} );
 	} );
 
 
 	grunt.loadNpmTasks( 'grunt-contrib-jshint' );
 	grunt.loadNpmTasks( 'grunt-contrib-jshint' );
 	grunt.loadNpmTasks( 'grunt-jscs' );
 	grunt.loadNpmTasks( 'grunt-jscs' );
+	grunt.loadNpmTasks( 'grunt-githooks' );
 
 
 	// Default tasks.
 	// Default tasks.
 	grunt.registerTask( 'default', [ 'jshint', 'jscs' ] );
 	grunt.registerTask( 'default', [ 'jshint', 'jscs' ] );

+ 2 - 1
package.json

@@ -5,7 +5,8 @@
   "devDependencies": {
   "devDependencies": {
     "grunt": "~0.4.5",
     "grunt": "~0.4.5",
     "grunt-jscs": "~0.6.2",
     "grunt-jscs": "~0.6.2",
-    "grunt-contrib-jshint": "~0.10.0"
+    "grunt-contrib-jshint": "~0.10.0",
+    "grunt-githooks": "~0.3.1"
   },
   },
   "author": "CKSource (http://cksource.com/)",
   "author": "CKSource (http://cksource.com/)",
   "license": "See LICENSE.md",
   "license": "See LICENSE.md",