MCPcopy Index your code
hub / github.com/nodejs/node / getCollaboratorsFromReadme

Function getCollaboratorsFromReadme

tools/find-inactive-collaborators.mjs:56–96  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54);
55
56async function getCollaboratorsFromReadme() {
57 const readmeText = readline.createInterface({
58 input: fs.createReadStream(new URL('../README.md', import.meta.url)),
59 crlfDelay: Infinity,
60 });
61 const returnedArray = [];
62 let foundCollaboratorHeading = false;
63 for await (const line of readmeText) {
64 // If we've found the collaborator heading already, stop processing at the
65 // next heading.
66 if (foundCollaboratorHeading && line.startsWith('#')) {
67 break;
68 }
69
70 const isCollaborator = foundCollaboratorHeading && line.length;
71
72 if (line === '### Collaborators') {
73 foundCollaboratorHeading = true;
74 }
75 if (line.startsWith(' **') && isCollaborator) {
76 const [, name, email] = /^ {2}\*\*([^*]+)\*\* <<(.+)>>/.exec(line);
77 const mailmap = await runGitCommand(
78 `git check-mailmap '${name} <${email}>'`,
79 );
80 if (mailmap !== `${name} <${email}>`) {
81 console.log(`README entry for Collaborator does not match mailmap:\n ${name} <${email}> => ${mailmap}`);
82 }
83 returnedArray.push({
84 name,
85 email,
86 mailmap,
87 });
88 }
89 }
90
91 if (!foundCollaboratorHeading) {
92 throw new Error('Could not find Collaborator section of README');
93 }
94
95 return returnedArray;
96}
97
98async function moveCollaboratorToEmeritus(peopleToMove) {
99 const readmeText = readline.createInterface({

Callers 1

Calls 5

runGitCommandFunction · 0.85
createReadStreamMethod · 0.45
execMethod · 0.45
logMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…