forked from openT2T/translators
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
60 lines (49 loc) · 1.7 KB
/
gulpfile.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
60
"use strict";
const NO_MODULES = '!**/node_modules/**';
var gulp = require('gulp');
var ava = require('gulp-ava');
var xmlValidator = require('gulp-xml-validator');
var eslint = require('gulp-eslint');
var InterfaceValidator = require('./verifiers/interfaceValidator');
var NamingfaceValidator = require('./verifiers/namingValidator');
var ManifestValidator = require('./verifiers/manifestValidator');
gulp.task('validate-interfaces', function () {
return gulp.src(['**/js/thingTranslator.js', NO_MODULES])
.pipe(InterfaceValidator())
});
gulp.task('validate-naming', function () {
return gulp.src(['**/js/package.json', NO_MODULES, '!**/Helpers/**'])
.pipe(NamingfaceValidator())
});
gulp.task('validate-manifest', function () {
return gulp.src(['**/js/manifest.xml', NO_MODULES])
.pipe(ManifestValidator())
});
gulp.task('xml-lint', function () {
return gulp.src(['**/*.xml', NO_MODULES])
.pipe(xmlValidator())
});
gulp.task('js-lint', () => {
return gulp.src(['**/*.js', NO_MODULES])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('json-lint', () => {
return gulp.src(['**/*.json', NO_MODULES])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('raml-lint', () => {
return gulp.src(['**/*.raml', NO_MODULES])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('unittest', function () {
return gulp.src(['**/js/tests/unitTests.js', NO_MODULES])
.pipe(ava({verbose: true}))
});
gulp.task('ci-checks', ['js-lint', 'json-lint', 'xml-lint', 'validate-naming', 'unittest']);
gulp.task('default', ['ci-checks']);