chore: use vscode-markdown-languageservice for link linting (#36901)
* chore: use vscode-markdown-languageservice for docs link linting * docs: make links relative
This commit is contained in:
parent
37f5881882
commit
ca3145a547
10 changed files with 700 additions and 176 deletions
|
@ -1,6 +1,5 @@
|
|||
import * as childProcess from 'child_process';
|
||||
import * as fs from 'fs';
|
||||
import * as klaw from 'klaw';
|
||||
import * as minimist from 'minimist';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
|
@ -9,7 +8,7 @@ import * as streamJson from 'stream-json';
|
|||
import { ignore as streamJsonIgnore } from 'stream-json/filters/Ignore';
|
||||
import { streamArray as streamJsonStreamArray } from 'stream-json/streamers/StreamArray';
|
||||
|
||||
import { chunkFilenames } from './lib/utils';
|
||||
import { chunkFilenames, findMatchingFiles } from './lib/utils';
|
||||
|
||||
const SOURCE_ROOT = path.normalize(path.dirname(__dirname));
|
||||
const LLVM_BIN = path.resolve(
|
||||
|
@ -204,24 +203,6 @@ async function runClangTidy (
|
|||
}
|
||||
}
|
||||
|
||||
async function findMatchingFiles (
|
||||
top: string,
|
||||
test: (filename: string) => boolean
|
||||
): Promise<string[]> {
|
||||
return new Promise((resolve) => {
|
||||
const matches = [] as string[];
|
||||
klaw(top, {
|
||||
filter: (f) => path.basename(f) !== '.bin'
|
||||
})
|
||||
.on('end', () => resolve(matches))
|
||||
.on('data', (item) => {
|
||||
if (test(item.path)) {
|
||||
matches.push(item.path);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function parseCommandLine () {
|
||||
const showUsage = (arg?: string) : boolean => {
|
||||
if (!arg || arg.startsWith('-')) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue