This commit is contained in:
Fernandez Ludovic 2023-06-12 10:21:42 +02:00
parent f1a5bd1222
commit 3a46c09a09
3 changed files with 31 additions and 40 deletions

View file

@ -66581,21 +66581,17 @@ function runLint(lintPath, patchPath) {
.filter((arg) => arg.startsWith(`-`))
.map((arg) => arg.replace(/^-+/, ``))
.map((arg) => arg.split(/=(.*)/, 2))
.map(([key, value]) => [key, value !== null && value !== void 0 ? value : ""]);
.map(([key, value]) => [key.toLowerCase(), value !== null && value !== void 0 ? value : ""]);
const userArgsMap = new Map(userArgsList);
const userArgNames = new Set(userArgsList.map(([key, value]) => key));
const formats = userArgsMap.get("out-format");
if (formats) {
if (formats.includes("github-actions")) {
const userArgNames = new Set(userArgsList.map(([key]) => key));
const formats = (userArgsMap.get("out-format") || "")
.trim()
.split(",")
.filter((f) => f.length > 0)
.filter((f) => !f.startsWith(`github-actions`))
.concat("github-actions")
.join(",");
addedArgs.push(`--out-format=${formats}`);
}
else {
addedArgs.push(`--out-format=github-actions,${formats}`);
}
}
else {
addedArgs.push(`--out-format=github-actions`);
}
if (patchPath) {
if (userArgNames.has(`new`) || userArgNames.has(`new-from-rev`) || userArgNames.has(`new-from-patch`)) {
throw new Error(`please, don't specify manually --new* args when requesting only new issues`);

22
dist/run/index.js vendored
View file

@ -66581,21 +66581,17 @@ function runLint(lintPath, patchPath) {
.filter((arg) => arg.startsWith(`-`))
.map((arg) => arg.replace(/^-+/, ``))
.map((arg) => arg.split(/=(.*)/, 2))
.map(([key, value]) => [key, value !== null && value !== void 0 ? value : ""]);
.map(([key, value]) => [key.toLowerCase(), value !== null && value !== void 0 ? value : ""]);
const userArgsMap = new Map(userArgsList);
const userArgNames = new Set(userArgsList.map(([key, value]) => key));
const formats = userArgsMap.get("out-format");
if (formats) {
if (formats.includes("github-actions")) {
const userArgNames = new Set(userArgsList.map(([key]) => key));
const formats = (userArgsMap.get("out-format") || "")
.trim()
.split(",")
.filter((f) => f.length > 0)
.filter((f) => !f.startsWith(`github-actions`))
.concat("github-actions")
.join(",");
addedArgs.push(`--out-format=${formats}`);
}
else {
addedArgs.push(`--out-format=github-actions,${formats}`);
}
}
else {
addedArgs.push(`--out-format=github-actions`);
}
if (patchPath) {
if (userArgNames.has(`new`) || userArgNames.has(`new-from-rev`) || userArgNames.has(`new-from-patch`)) {
throw new Error(`please, don't specify manually --new* args when requesting only new issues`);

View file

@ -125,21 +125,20 @@ async function runLint(lintPath: string, patchPath: string): Promise<void> {
.filter((arg) => arg.startsWith(`-`))
.map((arg) => arg.replace(/^-+/, ``))
.map((arg) => arg.split(/=(.*)/, 2))
.map<[string, string]>(([key, value]) => [key, value ?? ""])
.map<[string, string]>(([key, value]) => [key.toLowerCase(), value ?? ""])
const userArgsMap = new Map<string, string>(userArgsList)
const userArgNames = new Set<string>(userArgsList.map(([key, value]) => key))
const userArgNames = new Set<string>(userArgsList.map(([key]) => key))
const formats = (userArgsMap.get("out-format") || "")
.trim()
.split(",")
.filter((f) => f.length > 0)
.filter((f) => !f.startsWith(`github-actions`))
.concat("github-actions")
.join(",")
const formats = userArgsMap.get("out-format")
if (formats) {
if (formats.includes("github-actions")) {
addedArgs.push(`--out-format=${formats}`)
} else {
addedArgs.push(`--out-format=github-actions,${formats}`)
}
} else {
addedArgs.push(`--out-format=github-actions`)
}
if (patchPath) {
if (userArgNames.has(`new`) || userArgNames.has(`new-from-rev`) || userArgNames.has(`new-from-patch`)) {