forked from wikimedia/labs-tools-intuition
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
49 lines (45 loc) · 1.29 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
/**
* @copyright 2011-2014 See AUTHORS.txt
* @license CC-BY 3.0 <https://creativecommons.org/licenses/by/3.0/>
* @package intuition
*/
/* eslint-env node */
module.exports = function (grunt) {
var fs = require('fs'),
path = require('path'),
msgDir = path.join(__dirname, 'language', 'messages'),
domainDirs = {};
grunt.loadNpmTasks('grunt-banana-checker');
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-git-authors');
grunt.loadNpmTasks('grunt-jsonlint');
fs.readdirSync(msgDir).forEach(function (file) {
var stats = fs.statSync(path.join(msgDir, file));
if (stats.isDirectory()) {
if (['commonshelper2', 'mwsnapshots', 'raun', 'voiceintro'].indexOf(file) === -1) {
domainDirs[file] = 'language/messages/' + file + '/';
} else {
// Allow incomplete documentation for now (issue #41)
domainDirs[file] = {
src: 'language/messages/' + file + '/',
options: {
requireCompleteMessageDocumentation: false
}
};
}
}
});
grunt.initConfig({
banana: domainDirs,
eslint: {
all: '*.js'
},
jsonlint: {
all: [
'*.json',
'{language,tests}/**/*.json'
]
}
});
grunt.registerTask('default', ['eslint', 'jsonlint', 'banana']);
};