Add pre-commit hook for standard linter

This commit is contained in:
Christoph Diehl 2018-01-22 22:30:40 +01:00
parent ab97313acb
commit 94938bda28
3 changed files with 84 additions and 52 deletions

View file

@ -1,4 +1,4 @@
module.exports = function(grunt) { module.exports = function (grunt) {
let pkg = grunt.file.readJSON('package.json') let pkg = grunt.file.readJSON('package.json')
grunt.initConfig({ grunt.initConfig({

View file

@ -1,5 +1,5 @@
module.exports = function(config) { module.exports = function (config) {
var configuration = { let configuration = {
basePath: './tests', basePath: './tests',
frameworks: ['qunit'], frameworks: ['qunit'],
@ -46,15 +46,15 @@ module.exports = function(config) {
coverageReporter: { coverageReporter: {
reporters: [ reporters: [
{ type: "lcov", dir: "coverage/" }, { type: 'lcov', dir: 'coverage/' },
{ type: 'text-summary' } { type: 'text-summary' }
] ]
}, }
};
if (process.env.TRAVIS) {
configuration.browsers = ['Chrome_travis_ci', 'Firefox'];
} }
config.set(configuration); if (process.env.TRAVIS) {
}; configuration.browsers = ['Chrome_travis_ci', 'Firefox']
}
config.set(configuration)
}

View file

@ -1,10 +1,49 @@
{ {
"name": "octo", "name": "octo",
"description": "",
"keywords": [
"fuzzing", "browsers"
],
"homepage": "https://github.com/mozillasecurity/octo",
"repository": {
"type": "git",
"url": "https://github.com/mozillasecurity/octo.git"
},
"bugs": {
"url": "https://github.com/mozillasecurity/octo/issues",
"email": "cdiehl@mozilla.com"
},
"author": "Christoph Diehl <cdiehl@mozilla.com>",
"license": "MPL-2.0",
"scripts": {
"test": "grunt test --verbose",
"test:lint": "cross-env NODE_ENV=test standard --verbose"
},
"standard": {
"ignore": [
"tests/**"
],
"globals": [
"random",
"make",
"utils",
"logger",
"MersenneTwister",
"o",
"btoa",
"atob"
],
"envs": [
"browser"
]
},
"devDependencies": { "devDependencies": {
"cross-env": "^5.1.3",
"grunt": "*", "grunt": "*",
"grunt-karma": "*", "grunt-karma": "*",
"grunt-karma-coveralls": "*", "grunt-karma-coveralls": "*",
"grunt-standard": "*", "grunt-standard": "*",
"husky": "^0.14.3",
"karma": "*", "karma": "*",
"karma-chrome-launcher": "*", "karma-chrome-launcher": "*",
"karma-coverage": "*", "karma-coverage": "*",
@ -12,12 +51,5 @@
"karma-qunit": "*", "karma-qunit": "*",
"qunitjs": "*", "qunitjs": "*",
"standard": "*" "standard": "*"
},
"scripts": {
"test": "grunt test --verbose"
},
"standard": {
"globals": ["random", "make", "utils", "logger", "MersenneTwister", "o", "btoa", "atob"],
"envs": ["browser"]
} }
} }