Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7ce7eab

Browse filesBrowse files
committed
tools: lint README lists more strictly
PR-URL: #55625 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
1 parent 8d0526f commit 7ce7eab
Copy full SHA for 7ce7eab

File tree

Expand file treeCollapse file tree

2 files changed

+19
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+19
-5
lines changed
Open diff view settings
Collapse file

‎README.md‎

Copy file name to clipboardExpand all lines: README.md
+3-3Lines changed: 3 additions & 3 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ For information about the governance of the Node.js project, see
409409
**Filip Skokan** <<panva.ip@gmail.com>> (he/him)
410410
* [pimterry](https://github.com/pimterry) -
411411
**Tim Perry** <<pimterry@gmail.com>> (he/him)
412-
* [pmarchini](https://github.com/pmarchini)
412+
* [pmarchini](https://github.com/pmarchini) -
413413
**Pietro Marchini** <<pietro.marchini94@gmail.com>> (he/him)
414414
* [Qard](https://github.com/Qard) -
415415
**Stephen Belanger** <<admin@stephenbelanger.com>> (he/him)
@@ -515,7 +515,7 @@ For information about the governance of the Node.js project, see
515515
**Hitesh Kanwathirtha** <<digitalinfinity@gmail.com>> (he/him)
516516
* [dmabupt](https://github.com/dmabupt) -
517517
**Xu Meng** <<dmabupt@gmail.com>> (he/him)
518-
* [dnlup](https://github.com/dnlup)
518+
* [dnlup](https://github.com/dnlup) -
519519
**dnlup** <<dnlup.dev@gmail.com>>
520520
* [eljefedelrodeodeljefe](https://github.com/eljefedelrodeodeljefe) -
521521
**Robert Jefe Lindstaedt** <<robert.lindstaedt@gmail.com>>
@@ -757,7 +757,7 @@ maintaining the Node.js project.
757757
**Mert Can Altin** <<mertgold60@gmail.com>>
758758
* [preveen-stack](https://github.com/preveen-stack) -
759759
**Preveen Padmanabhan** <<wide4head@gmail.com>> (he/him)
760-
* [RedYetiDev](https://github.com/redyetidev) -
760+
* [RedYetiDev](https://github.com/RedYetiDev) -
761761
**Aviv Keller** <<redyetidev@gmail.com>> (they/them)
762762
* [VoltrexKeyva](https://github.com/VoltrexKeyva) -
763763
**Mohammed Keyvanzadeh** <<mohammadkeyvanzade94@gmail.com>> (he/him)
Collapse file

‎tools/lint-readme-lists.mjs‎

Copy file name to clipboardExpand all lines: tools/lint-readme-lists.mjs
+16-2Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import assert from 'node:assert';
66
import { open } from 'node:fs/promises';
77
import { argv } from 'node:process';
88

9+
const ghHandleLine = /^\* \[(.+)\]\(https:\/\/github\.com\/\1\) -$/;
10+
const memberInfoLine = /^ {2}\*\*[^*]+\*\* <<[^@]+@.+\.[a-z]+>>( \(\w+(\/[^)/]+)+\))?( - \[Support me\]\(.+\))?$/;
11+
912
const lists = {
1013
'__proto__': null,
1114

@@ -26,12 +29,19 @@ const tscMembers = new Set();
2629
const readme = await open(new URL('../README.md', import.meta.url), 'r');
2730

2831
let currentList = null;
32+
let previousGithubHandleInfoRequired;
2933
let previousGithubHandle;
3034
let lineNumber = 0;
3135

3236
for await (const line of readme.readLines()) {
3337
lineNumber++;
34-
if (line.startsWith('### ')) {
38+
if (previousGithubHandleInfoRequired) {
39+
if (!memberInfoLine.test(line)) {
40+
throw new Error(`${previousGithubHandleInfoRequired} info are not formatted correctly (README.md:${lineNumber})`);
41+
}
42+
previousGithubHandle = previousGithubHandleInfoRequired;
43+
previousGithubHandleInfoRequired = null;
44+
} else if (line.startsWith('### ')) {
3545
currentList = line.slice(4);
3646
previousGithubHandle = null;
3747
} else if (line.startsWith('#### ')) {
@@ -49,6 +59,10 @@ for await (const line of readme.readLines()) {
4959
);
5060
}
5161

62+
if (!ghHandleLine.test(line)) {
63+
throw new Error(`${currentGithubHandle} is not formatted correctly (README.md:${lineNumber})`);
64+
}
65+
5266
if (
5367
currentList === 'TSC voting members' ||
5468
currentList === 'TSC regular members'
@@ -60,7 +74,7 @@ for await (const line of readme.readLines()) {
6074
if (lists[currentList]) {
6175
(actualMembers[lists[currentList]] ??= new Set()).add(currentGithubHandle);
6276
}
63-
previousGithubHandle = currentGithubHandleLowerCase;
77+
previousGithubHandleInfoRequired = currentGithubHandleLowerCase;
6478
}
6579
}
6680
console.info('Lists are in the alphabetical order.');

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.