mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-18 06:50:12 +01:00
Remove clone-test-repos-large npm script, merge into clone-test-repos.
This commit is contained in:
parent
e42da81293
commit
e8ec7bd94f
3 changed files with 17 additions and 26 deletions
2
.github/workflows/test-repos.yml
vendored
2
.github/workflows/test-repos.yml
vendored
|
|
@ -24,7 +24,7 @@ jobs:
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: npm install --no-package-lock
|
run: npm install --no-package-lock
|
||||||
- name: Clone Test Repos
|
- name: Clone Test Repos
|
||||||
run: npm run clone-test-repos-large
|
run: npm run clone-test-repos
|
||||||
- name: Lint Test Repos
|
- name: Lint Test Repos
|
||||||
run: npm run lint-test-repos
|
run: npm run lint-test-repos
|
||||||
- name: Run Extra Tests
|
- name: Run Extra Tests
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,7 @@
|
||||||
"clone-test-repos-v8-v8-dev": "cd test-repos && git clone https://github.com/v8/v8.dev v8-v8-dev --depth 1 --no-tags --quiet",
|
"clone-test-repos-v8-v8-dev": "cd test-repos && git clone https://github.com/v8/v8.dev v8-v8-dev --depth 1 --no-tags --quiet",
|
||||||
"clone-test-repos-webhintio-hint": "cd test-repos && git clone https://github.com/webhintio/hint webhintio-hint --depth 1 --no-tags --quiet",
|
"clone-test-repos-webhintio-hint": "cd test-repos && git clone https://github.com/webhintio/hint webhintio-hint --depth 1 --no-tags --quiet",
|
||||||
"clone-test-repos-webpack-webpack-js-org": "cd test-repos && git clone https://github.com/webpack/webpack.js.org webpack-webpack-js-org --depth 1 --no-tags --quiet",
|
"clone-test-repos-webpack-webpack-js-org": "cd test-repos && git clone https://github.com/webpack/webpack.js.org webpack-webpack-js-org --depth 1 --no-tags --quiet",
|
||||||
"clone-test-repos": "mkdir test-repos && cd test-repos && npm run clone-test-repos-eslint-eslint && npm run clone-test-repos-mkdocs-mkdocs && npm run clone-test-repos-mochajs-mocha && npm run clone-test-repos-pi-hole-docs && npm run clone-test-repos-webhintio-hint && npm run clone-test-repos-webpack-webpack-js-org",
|
"clone-test-repos": "mkdir test-repos && cd test-repos && npm run clone-test-repos-dotnet-docs && npm run clone-test-repos-eslint-eslint && npm run clone-test-repos-mkdocs-mkdocs && npm run clone-test-repos-mochajs-mocha && npm run clone-test-repos-pi-hole-docs && npm run clone-test-repos-v8-v8-dev && npm run clone-test-repos-webhintio-hint && npm run clone-test-repos-webpack-webpack-js-org",
|
||||||
"clone-test-repos-large": "npm run clone-test-repos && cd test-repos && npm run clone-test-repos-dotnet-docs && npm run clone-test-repos-v8-v8-dev",
|
|
||||||
"declaration": "npm run build-declaration && npm run test-declaration",
|
"declaration": "npm run build-declaration && npm run test-declaration",
|
||||||
"example": "cd example && node standalone.js && grunt markdownlint --force && gulp markdownlint",
|
"example": "cd example && node standalone.js && grunt markdownlint --force && gulp markdownlint",
|
||||||
"docker-npm-install": "docker run --rm --tty --name npm-install --volume $PWD:/home/workdir --workdir /home/workdir --user node node:16 npm install",
|
"docker-npm-install": "docker run --rm --tty --name npm-install --volume $PWD:/home/workdir --workdir /home/workdir --user node node:16 npm install",
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const { existsSync } = require("node:fs");
|
|
||||||
const { join } = require("node:path").posix;
|
const { join } = require("node:path").posix;
|
||||||
const { promisify } = require("node:util");
|
const { promisify } = require("node:util");
|
||||||
const jsYaml = require("js-yaml");
|
const jsYaml = require("js-yaml");
|
||||||
|
|
@ -97,6 +96,7 @@ async function lintTestRepo(t, globPatterns, configPath, ignoreRes) {
|
||||||
// });
|
// });
|
||||||
}).then((results) => {
|
}).then((results) => {
|
||||||
// Fail if any issues were found (that aren't ignored)
|
// Fail if any issues were found (that aren't ignored)
|
||||||
|
// @ts-ignore
|
||||||
let resultsString = results.toString();
|
let resultsString = results.toString();
|
||||||
for (const ignoreRe of (ignoreRes || [])) {
|
for (const ignoreRe of (ignoreRes || [])) {
|
||||||
const lengthBefore = resultsString.length;
|
const lengthBefore = resultsString.length;
|
||||||
|
|
@ -128,6 +128,13 @@ function excludeGlobs(rootDir, ...globs) {
|
||||||
// Run markdownlint the same way the corresponding repositories do
|
// Run markdownlint the same way the corresponding repositories do
|
||||||
/* eslint-disable max-len */
|
/* eslint-disable max-len */
|
||||||
|
|
||||||
|
test("https://github.com/dotnet/docs", (t) => {
|
||||||
|
const rootDir = "./test-repos/dotnet-docs";
|
||||||
|
const globPatterns = [ join(rootDir, "**/*.md") ];
|
||||||
|
const configPath = join(rootDir, ".markdownlint-cli2.jsonc");
|
||||||
|
return lintTestRepo(t, globPatterns, configPath);
|
||||||
|
});
|
||||||
|
|
||||||
test("https://github.com/eslint/eslint", (t) => {
|
test("https://github.com/eslint/eslint", (t) => {
|
||||||
const rootDir = "./test-repos/eslint-eslint";
|
const rootDir = "./test-repos/eslint-eslint";
|
||||||
const globPatterns = [ join(rootDir, "docs/**/*.md") ];
|
const globPatterns = [ join(rootDir, "docs/**/*.md") ];
|
||||||
|
|
@ -180,6 +187,13 @@ test("https://github.com/pi-hole/docs", (t) => {
|
||||||
return lintTestRepo(t, globPatterns, configPath);
|
return lintTestRepo(t, globPatterns, configPath);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("https://github.com/v8/v8.dev", (t) => {
|
||||||
|
const rootDir = "./test-repos/v8-v8-dev";
|
||||||
|
const globPatterns = [ join(rootDir, "src/**/*.md") ];
|
||||||
|
const configPath = join(rootDir, ".markdownlint.json");
|
||||||
|
return lintTestRepo(t, globPatterns, configPath);
|
||||||
|
});
|
||||||
|
|
||||||
test("https://github.com/webhintio/hint", (t) => {
|
test("https://github.com/webhintio/hint", (t) => {
|
||||||
const rootDir = "./test-repos/webhintio-hint";
|
const rootDir = "./test-repos/webhintio-hint";
|
||||||
const globPatterns = [
|
const globPatterns = [
|
||||||
|
|
@ -219,25 +233,3 @@ test("https://github.com/webpack/webpack.js.org", (t) => {
|
||||||
const configPath = join(rootDir, ".markdownlint.json");
|
const configPath = join(rootDir, ".markdownlint.json");
|
||||||
return lintTestRepo(t, globPatterns, configPath);
|
return lintTestRepo(t, globPatterns, configPath);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Optional repositories (very large)
|
|
||||||
|
|
||||||
const dotnetDocsDir = "./test-repos/dotnet-docs";
|
|
||||||
if (existsSync(dotnetDocsDir)) {
|
|
||||||
test("https://github.com/dotnet/docs", (t) => {
|
|
||||||
const rootDir = dotnetDocsDir;
|
|
||||||
const globPatterns = [ join(rootDir, "**/*.md") ];
|
|
||||||
const configPath = join(rootDir, ".markdownlint-cli2.jsonc");
|
|
||||||
return lintTestRepo(t, globPatterns, configPath);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const v8v8DevDir = "./test-repos/v8-v8-dev";
|
|
||||||
if (existsSync(v8v8DevDir)) {
|
|
||||||
test("https://github.com/v8/v8.dev", (t) => {
|
|
||||||
const rootDir = v8v8DevDir;
|
|
||||||
const globPatterns = [ join(rootDir, "src/**/*.md") ];
|
|
||||||
const configPath = join(rootDir, ".markdownlint.json");
|
|
||||||
return lintTestRepo(t, globPatterns, configPath);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue