-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools: add a linter for README lists
PR-URL: #52476 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Ulises Gascón <[email protected]>
- Loading branch information
Showing
3 changed files
with
65 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -343,10 +343,10 @@ For information about the governance of the Node.js project, see | |
**Erick Wendel** <<[email protected]>> (he/him) | ||
* [Ethan-Arrowood](https://github.com/Ethan-Arrowood) - | ||
**Ethan Arrowood** <<[email protected]>> (he/him) | ||
* [fhinkel](https://github.com/fhinkel) - | ||
**Franziska Hinkelmann** <<[email protected]>> (she/her) | ||
* [F3n67u](https://github.com/F3n67u) - | ||
**Feng Yu** <<[email protected]>> (he/him) | ||
* [fhinkel](https://github.com/fhinkel) - | ||
**Franziska Hinkelmann** <<[email protected]>> (she/her) | ||
* [Flarna](https://github.com/Flarna) - | ||
**Gerhard Stöbich** <<[email protected]>> (he/they) | ||
* [gabrielschulhof](https://github.com/gabrielschulhof) - | ||
|
@@ -429,12 +429,12 @@ For information about the governance of the Node.js project, see | |
**Stephen Belanger** <<[email protected]>> (he/him) | ||
* [RafaelGSS](https://github.com/RafaelGSS) - | ||
**Rafael Gonzaga** <<[email protected]>> (he/him) | ||
* [rluvaton](https://github.com/rluvaton) - | ||
**Raz Luvaton** <<[email protected]>> (he/him) | ||
* [richardlau](https://github.com/richardlau) - | ||
**Richard Lau** <<[email protected]>> | ||
* [rickyes](https://github.com/rickyes) - | ||
**Ricky Zhou** <<[email protected]>> (he/him) | ||
* [rluvaton](https://github.com/rluvaton) - | ||
**Raz Luvaton** <<[email protected]>> (he/him) | ||
* [ronag](https://github.com/ronag) - | ||
**Robert Nagy** <<[email protected]>> | ||
* [ruyadorno](https://github.com/ruyadorno) - | ||
|
@@ -477,10 +477,10 @@ For information about the governance of the Node.js project, see | |
**Khaidi Chu** <<[email protected]>> (he/him) | ||
* [yashLadha](https://github.com/yashLadha) - | ||
**Yash Ladha** <<[email protected]>> (he/him) | ||
* [ZYSzys](https://github.com/ZYSzys) - | ||
**Yongsheng Zhang** <<[email protected]>> (he/him) | ||
* [zcbenz](https://github.com/zcbenz) - | ||
**Cheng Zhao** <<[email protected]>> (he/him) | ||
* [ZYSzys](https://github.com/ZYSzys) - | ||
**Yongsheng Zhang** <<[email protected]>> (he/him) | ||
|
||
<details> | ||
|
||
|
@@ -495,10 +495,10 @@ For information about the governance of the Node.js project, see | |
**Aleksei Koziatinskii** <<[email protected]>> | ||
* [andrasq](https://github.com/andrasq) - | ||
**Andras** <<[email protected]>> | ||
* [AnnaMag](https://github.com/AnnaMag) - | ||
**Anna M. Kedzierska** <<[email protected]>> | ||
* [AndreasMadsen](https://github.com/AndreasMadsen) - | ||
**Andreas Madsen** <<[email protected]>> (he/him) | ||
* [AnnaMag](https://github.com/AnnaMag) - | ||
**Anna M. Kedzierska** <<[email protected]>> | ||
* [aqrln](https://github.com/aqrln) - | ||
**Alexey Orlenko** <<[email protected]>> (he/him) | ||
* [bcoe](https://github.com/bcoe) - | ||
|
@@ -741,10 +741,10 @@ maintaining the Node.js project. | |
**Mert Can Altin** <<[email protected]>> | ||
* [Mesteery](https://github.com/Mesteery) - | ||
**Mestery** <<[email protected]>> (he/him) | ||
* [preveen-stack](https://github.com/preveen-stack) - | ||
**Preveen Padmanabhan** <<[email protected]>> (he/him) | ||
* [PoojaDurgad](https://github.com/PoojaDurgad) - | ||
**Pooja Durgad** <<[email protected]>> | ||
* [preveen-stack](https://github.com/preveen-stack) - | ||
**Preveen Padmanabhan** <<[email protected]>> (he/him) | ||
* [VoltrexKeyva](https://github.com/VoltrexKeyva) - | ||
**Mohammed Keyvanzadeh** <<[email protected]>> (he/him) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env node | ||
|
||
// Validates the list in the README are in the correct order. | ||
|
||
import { open } from 'node:fs/promises'; | ||
|
||
const lists = [ | ||
'TSC voting members', | ||
'TSC regular members', | ||
'TSC emeriti members', | ||
'Collaborators', | ||
'Collaborator emeriti', | ||
'Triagers', | ||
]; | ||
const tscMembers = new Set(); | ||
|
||
const readme = await open(new URL('../README.md', import.meta.url), 'r'); | ||
|
||
let currentList = null; | ||
let previousGithubHandle; | ||
let lineNumber = 0; | ||
|
||
for await (const line of readme.readLines()) { | ||
lineNumber++; | ||
if (line.startsWith('### ')) { | ||
currentList = lists[lists.indexOf(line.slice(4))]; | ||
previousGithubHandle = null; | ||
} else if (line.startsWith('#### ')) { | ||
currentList = lists[lists.indexOf(line.slice(5))]; | ||
previousGithubHandle = null; | ||
} else if (currentList && line.startsWith('* [')) { | ||
const currentGithubHandle = line.slice(3, line.indexOf(']')).toLowerCase(); | ||
if (previousGithubHandle && previousGithubHandle >= currentGithubHandle) { | ||
throw new Error(`${currentGithubHandle} should be listed before ${previousGithubHandle} in the ${currentList} list (README.md:${lineNumber})`); | ||
} | ||
|
||
if (currentList === 'TSC voting members' || currentList === 'TSC regular members') { | ||
tscMembers.add(currentGithubHandle); | ||
} else if (currentList === 'Collaborators') { | ||
tscMembers.delete(currentGithubHandle); | ||
} | ||
previousGithubHandle = currentGithubHandle; | ||
} | ||
} | ||
|
||
if (tscMembers.size !== 0) { | ||
throw new Error(`Some TSC members are not listed as Collaborators: ${Array.from(tscMembers)}`); | ||
} |