2018-10-05 11:20:51 +00:00
|
|
|
const gulp = require('gulp');
|
2019-04-12 14:44:14 +00:00
|
|
|
const through2 = require('through2');
|
2018-10-05 11:20:51 +00:00
|
|
|
|
2020-08-13 15:05:52 +00:00
|
|
|
const { testedLang } = require('./utils');
|
2019-07-25 19:15:31 +00:00
|
|
|
const lintMarkdown = require('../tools/scripts/lint');
|
2019-04-12 14:44:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Tasks
|
|
|
|
**/
|
2018-10-05 11:20:51 +00:00
|
|
|
|
2019-04-12 14:44:14 +00:00
|
|
|
function lint() {
|
2020-08-13 15:05:52 +00:00
|
|
|
return gulp.src(globLang(testedLang()), { read: false }).pipe(
|
2019-04-12 14:44:14 +00:00
|
|
|
through2.obj(function obj(file, enc, next) {
|
2019-06-13 09:26:08 +00:00
|
|
|
lintMarkdown(file, next);
|
2019-04-12 14:44:14 +00:00
|
|
|
})
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Helper functions
|
|
|
|
**/
|
|
|
|
|
2020-08-13 15:05:52 +00:00
|
|
|
function globLang(lang) {
|
|
|
|
return `./challenges/${lang}/**/*.md`;
|
2019-04-12 14:44:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gulp.task('lint', lint);
|