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')
grunt.initConfig({

View File

@ -1,60 +1,60 @@
module.exports = function(config) {
var configuration = {
basePath: './tests',
module.exports = function (config) {
let configuration = {
basePath: './tests',
frameworks: ['qunit'],
frameworks: ['qunit'],
files: [
'../lib/utils/init.js',
'../lib/utils/*.js',
'../lib/logging/*.js',
'../lib/make/init.js',
'../lib/make/*.js',
'../lib/random/*.js',
'**/*.js'
],
files: [
'../lib/utils/init.js',
'../lib/utils/*.js',
'../lib/logging/*.js',
'../lib/make/init.js',
'../lib/make/*.js',
'../lib/random/*.js',
'**/*.js'
],
exclude: [
],
exclude: [
],
preprocessors: {
'../lib/**/*.js': ['coverage']
},
preprocessors: {
'../lib/**/*.js': ['coverage']
},
reporters: ['progress', 'coverage'],
reporters: ['progress', 'coverage'],
port: 9876,
port: 9876,
colors: true,
colors: true,
logLevel: config.LOG_INFO,
logLevel: config.LOG_INFO,
autoWatch: true,
autoWatch: true,
browsers: ['Chrome', 'Firefox'],
browsers: ['Chrome', 'Firefox'],
singleRun: true,
singleRun: true,
browserNoActivityTimeout: 30000,
browserNoActivityTimeout: 30000,
customLaunchers: {
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},
customLaunchers: {
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},
coverageReporter: {
reporters: [
{ type: "lcov", dir: "coverage/" },
{ type: 'text-summary' }
]
},
};
if (process.env.TRAVIS) {
configuration.browsers = ['Chrome_travis_ci', 'Firefox'];
coverageReporter: {
reporters: [
{ type: 'lcov', dir: 'coverage/' },
{ type: 'text-summary' }
]
}
}
config.set(configuration);
};
if (process.env.TRAVIS) {
configuration.browsers = ['Chrome_travis_ci', 'Firefox']
}
config.set(configuration)
}

View File

@ -1,10 +1,49 @@
{
"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": {
"cross-env": "^5.1.3",
"grunt": "*",
"grunt-karma": "*",
"grunt-karma-coveralls": "*",
"grunt-standard": "*",
"husky": "^0.14.3",
"karma": "*",
"karma-chrome-launcher": "*",
"karma-coverage": "*",
@ -12,12 +51,5 @@
"karma-qunit": "*",
"qunitjs": "*",
"standard": "*"
},
"scripts": {
"test": "grunt test --verbose"
},
"standard": {
"globals": ["random", "make", "utils", "logger", "MersenneTwister", "o", "btoa", "atob"],
"envs": ["browser"]
}
}