Skip to content

Commit

Permalink
added pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
endurance21 authored and LilaShiba committed May 16, 2020
1 parent f620932 commit d1884bb
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ module.exports = function(grunt) {
hostname: '*'
}
}
}
},
githooks: {
all: {
'pre-commit':'lint' //runs linting test before every git commit
}
}
});


Expand All @@ -65,6 +70,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-open');
grunt.loadNpmTasks('grunt-decomment');
grunt.loadNpmTasks('grunt-githooks');

grunt.registerTask('lint', ['eslint:source']);
grunt.registerTask('default', ['webpack:prod', 'decomment']);
Expand Down
70 changes: 70 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"grunt-contrib-connect": "^1.0.2",
"grunt-decomment": "^0.2.4",
"grunt-eslint": "^20.0.0",
"grunt-githooks": "^0.6.0",
"grunt-mocha": "^1.0.4",
"grunt-open": "^0.2.3",
"grunt-webpack": "^3.1.3",
Expand All @@ -40,6 +41,7 @@
"build": "grunt",
"test": "grunt run-tests",
"lint": "grunt lint",
"dev": "grunt dev"
"dev": "grunt dev",
"postinstall": "grunt githooks"
}
}

0 comments on commit d1884bb

Please sign in to comment.