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