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 091d015

Browse filesBrowse files
Trottdanielleadams
authored andcommitted
tools: add verbose flag to find-inactive-collaborators
PR-URL: #43964 Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Darshan Sen <raisinten@gmail.com>
1 parent c0d2098 commit 091d015
Copy full SHA for 091d015

File tree

Expand file treeCollapse file tree

1 file changed

+14
-6
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+14
-6
lines changed
Open diff view settings
Collapse file

‎tools/find-inactive-collaborators.mjs‎

Copy file name to clipboardExpand all lines: tools/find-inactive-collaborators.mjs
+14-6Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,15 @@
77
import cp from 'node:child_process';
88
import fs from 'node:fs';
99
import readline from 'node:readline';
10+
import { parseArgs } from 'node:util';
1011

11-
const SINCE = process.argv[2] || '18 months ago';
12+
const args = parseArgs({
13+
allowPositionals: true,
14+
options: { verbose: { type: 'boolean', short: 'v' } }
15+
});
16+
17+
const verbose = args.values.verbose;
18+
const SINCE = args.positionals[0] || '18 months ago';
1219

1320
async function runGitCommand(cmd, mapFn) {
1421
const childProcess = cp.spawn('/bin/sh', ['-c', cmd], {
@@ -176,11 +183,12 @@ async function moveCollaboratorToEmeritus(peopleToMove) {
176183
// Get list of current collaborators from README.md.
177184
const collaborators = await getCollaboratorsFromReadme();
178185

179-
console.log(`Since ${SINCE}:\n`);
180-
console.log(`* ${authors.size.toLocaleString()} authors have made commits.`);
181-
console.log(`* ${approvingReviewers.size.toLocaleString()} reviewers have approved landed commits.`);
182-
console.log(`* ${collaborators.length.toLocaleString()} collaborators currently in the project.`);
183-
186+
if (verbose) {
187+
console.log(`Since ${SINCE}:\n`);
188+
console.log(`* ${authors.size.toLocaleString()} authors have made commits.`);
189+
console.log(`* ${approvingReviewers.size.toLocaleString()} reviewers have approved landed commits.`);
190+
console.log(`* ${collaborators.length.toLocaleString()} collaborators currently in the project.`);
191+
}
184192
const inactive = collaborators.filter((collaborator) =>
185193
!authors.has(collaborator.mailmap) &&
186194
!approvingReviewers.has(collaborator.name)

0 commit comments

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