Format scripts with Prettier (#8393)

This PR does a one-off format of some of our scripts using Prettier.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-02-25 11:03:33 -05:00 committed by GitHub
parent 934af6ad45
commit 368fec2822
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 81 additions and 83 deletions

View file

@ -2,7 +2,7 @@
const { execFileSync } = require("child_process");
const { GITHUB_ACCESS_TOKEN } = process.env;
const PR_REGEX = /#\d+/ // Ex: matches on #4241
const PR_REGEX = /#\d+/; // Ex: matches on #4241
const FIXES_REGEX = /(fixes|closes|completes) (.+[/#]\d+.*)$/im;
main();
@ -10,7 +10,7 @@ main();
async function main() {
// Use form of: YYYY-MM-DD - 2023-01-09
const startDate = new Date(process.argv[2]);
const today = new Date()
const today = new Date();
console.log(`Changes from ${startDate} to ${today}\n`);
@ -32,32 +32,26 @@ async function main() {
console.log("*", pullRequest.title);
console.log(" PR URL: ", webURL);
console.log(" Merged: ", pullRequest.merged_at);
console.log()
console.log();
}
}
function getPullRequestNumbers(startDate, endDate) {
const sinceDate = startDate.toISOString();
const untilDate = endDate.toISOString();
const pullRequestNumbers = execFileSync(
"git",
[
"log",
`--since=${sinceDate}`,
`--until=${untilDate}`,
"--oneline"
],
{ encoding: "utf8" }
["log", `--since=${sinceDate}`, `--until=${untilDate}`, "--oneline"],
{ encoding: "utf8" },
)
.split("\n")
.filter(line => line.length > 0)
.map(line => {
.filter((line) => line.length > 0)
.map((line) => {
const match = line.match(/#(\d+)/);
return match ? match[1] : null;
})
.filter(line => line);
.filter((line) => line);
return pullRequestNumbers;
}