forked from nightwatchjs/nightwatch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
59 lines (52 loc) · 1.31 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
options: {
jshintrc: '.jshintrc'
},
bin: {
src: 'bin/*.js'
},
lib: {
src: 'lib/**/*.js'
},
tests: [
'tests/extra/*.js', 'tests/src/*.js'
],
gruntfile: {
src: 'Gruntfile.js'
},
examples: {
src: ['examples/tests', 'examples/custom-commands']
}
},
jsonlint: {
src: ['tests/*.json']
},
complexity: {
generic: {
src: ['lib/**/*.js', 'examples/**/*.js'],
options: {
breakOnErrors: true,
errorsOnly: false,
cyclomatic: [12, 10, 8, 6, 4],
halstead: [30.19, 25, 20, 16, 12, 6, 3],
maintainability: 98.65, // should be 100+,
hideComplexFunctions: false
}
}
}
});
// load custom external tasks (future)
grunt.loadTasks('tasks/');
//
grunt.loadNpmTasks('grunt-jsonlint');
grunt.loadNpmTasks('grunt-complexity');
// load the plugin that provides the "jshint" task.
grunt.loadNpmTasks('grunt-contrib-jshint');
// Default task(s).
grunt.registerTask('default', ['jshint', 'jsonlint']);
grunt.registerTask('default', ['jshint', 'jsonlint', 'complexity']);
};