mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
tools: clarify README linter error message
PR-URL: https://github.com/nodejs/node/pull/59160 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Richard Lau <richard.lau@ibm.com>
This commit is contained in:
parent
ad07ae6ac2
commit
7d6ce7765c
|
|
@ -6,7 +6,7 @@ import assert from 'node:assert';
|
||||||
import { open } from 'node:fs/promises';
|
import { open } from 'node:fs/promises';
|
||||||
import { argv } from 'node:process';
|
import { argv } from 'node:process';
|
||||||
|
|
||||||
const ghHandleLine = /^\* \[(.+)\]\(https:\/\/github\.com\/\1\) -$/;
|
const ghHandleLine = /^\* \[(.+)\]\(https:\/\/github\.com\/(.+)\) -$/;
|
||||||
const memberInfoLine = /^ {2}\*\*[^*]+\*\* <<[^@]+@.+\.[a-z]+>>( \(\w+(\/[^)/]+)+\))?( - \[Support me\]\(.+\))?$/;
|
const memberInfoLine = /^ {2}\*\*[^*]+\*\* <<[^@]+@.+\.[a-z]+>>( \(\w+(\/[^)/]+)+\))?( - \[Support me\]\(.+\))?$/;
|
||||||
|
|
||||||
const lists = {
|
const lists = {
|
||||||
|
|
@ -59,9 +59,11 @@ for await (const line of readme.readLines()) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ghHandleLine.test(line)) {
|
const match = line.match(ghHandleLine);
|
||||||
throw new Error(`${currentGithubHandle} is not formatted correctly (README.md:${lineNumber})`);
|
if (!match) {
|
||||||
|
throw new Error(`${line} should match ${ghHandleLine} (README.md:${lineNumber})`);
|
||||||
}
|
}
|
||||||
|
assert.strictEqual(match[1], match[2], `GitHub handle does not match the URL (README.md:${lineNumber})`);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
currentList === 'TSC voting members' ||
|
currentList === 'TSC voting members' ||
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user