Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Jun 12, 2023
1 parent f1a5bd1 commit 3a46c09
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 40 deletions.
24 changes: 10 additions & 14 deletions dist/post_run/index.js
Expand Up @@ -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")) {
addedArgs.push(`--out-format=${formats}`);
}
else {
addedArgs.push(`--out-format=github-actions,${formats}`);
}
}
else {
addedArgs.push(`--out-format=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}`);
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`);
Expand Down
24 changes: 10 additions & 14 deletions dist/run/index.js
Expand Up @@ -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")) {
addedArgs.push(`--out-format=${formats}`);
}
else {
addedArgs.push(`--out-format=github-actions,${formats}`);
}
}
else {
addedArgs.push(`--out-format=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}`);
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`);
Expand Down
23 changes: 11 additions & 12 deletions src/run.ts
Expand Up @@ -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")
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`)
}
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}`)

if (patchPath) {
if (userArgNames.has(`new`) || userArgNames.has(`new-from-rev`) || userArgNames.has(`new-from-patch`)) {
Expand Down

0 comments on commit 3a46c09

Please sign in to comment.