mirror of
https://github.com/golangci/golangci-lint-action.git
synced 2025-12-17 07:58:27 +00:00
review
This commit is contained in:
parent
f1a5bd1222
commit
3a46c09a09
3 changed files with 31 additions and 40 deletions
24
dist/post_run/index.js
vendored
24
dist/post_run/index.js
vendored
|
|
@ -66581,21 +66581,17 @@ function runLint(lintPath, patchPath) {
|
||||||
.filter((arg) => arg.startsWith(`-`))
|
.filter((arg) => arg.startsWith(`-`))
|
||||||
.map((arg) => arg.replace(/^-+/, ``))
|
.map((arg) => arg.replace(/^-+/, ``))
|
||||||
.map((arg) => arg.split(/=(.*)/, 2))
|
.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 userArgsMap = new Map(userArgsList);
|
||||||
const userArgNames = new Set(userArgsList.map(([key, value]) => key));
|
const userArgNames = new Set(userArgsList.map(([key]) => key));
|
||||||
const formats = userArgsMap.get("out-format");
|
const formats = (userArgsMap.get("out-format") || "")
|
||||||
if (formats) {
|
.trim()
|
||||||
if (formats.includes("github-actions")) {
|
.split(",")
|
||||||
addedArgs.push(`--out-format=${formats}`);
|
.filter((f) => f.length > 0)
|
||||||
}
|
.filter((f) => !f.startsWith(`github-actions`))
|
||||||
else {
|
.concat("github-actions")
|
||||||
addedArgs.push(`--out-format=github-actions,${formats}`);
|
.join(",");
|
||||||
}
|
addedArgs.push(`--out-format=${formats}`);
|
||||||
}
|
|
||||||
else {
|
|
||||||
addedArgs.push(`--out-format=github-actions`);
|
|
||||||
}
|
|
||||||
if (patchPath) {
|
if (patchPath) {
|
||||||
if (userArgNames.has(`new`) || userArgNames.has(`new-from-rev`) || userArgNames.has(`new-from-patch`)) {
|
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`);
|
throw new Error(`please, don't specify manually --new* args when requesting only new issues`);
|
||||||
|
|
|
||||||
24
dist/run/index.js
vendored
24
dist/run/index.js
vendored
|
|
@ -66581,21 +66581,17 @@ function runLint(lintPath, patchPath) {
|
||||||
.filter((arg) => arg.startsWith(`-`))
|
.filter((arg) => arg.startsWith(`-`))
|
||||||
.map((arg) => arg.replace(/^-+/, ``))
|
.map((arg) => arg.replace(/^-+/, ``))
|
||||||
.map((arg) => arg.split(/=(.*)/, 2))
|
.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 userArgsMap = new Map(userArgsList);
|
||||||
const userArgNames = new Set(userArgsList.map(([key, value]) => key));
|
const userArgNames = new Set(userArgsList.map(([key]) => key));
|
||||||
const formats = userArgsMap.get("out-format");
|
const formats = (userArgsMap.get("out-format") || "")
|
||||||
if (formats) {
|
.trim()
|
||||||
if (formats.includes("github-actions")) {
|
.split(",")
|
||||||
addedArgs.push(`--out-format=${formats}`);
|
.filter((f) => f.length > 0)
|
||||||
}
|
.filter((f) => !f.startsWith(`github-actions`))
|
||||||
else {
|
.concat("github-actions")
|
||||||
addedArgs.push(`--out-format=github-actions,${formats}`);
|
.join(",");
|
||||||
}
|
addedArgs.push(`--out-format=${formats}`);
|
||||||
}
|
|
||||||
else {
|
|
||||||
addedArgs.push(`--out-format=github-actions`);
|
|
||||||
}
|
|
||||||
if (patchPath) {
|
if (patchPath) {
|
||||||
if (userArgNames.has(`new`) || userArgNames.has(`new-from-rev`) || userArgNames.has(`new-from-patch`)) {
|
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`);
|
throw new Error(`please, don't specify manually --new* args when requesting only new issues`);
|
||||||
|
|
|
||||||
23
src/run.ts
23
src/run.ts
|
|
@ -125,21 +125,20 @@ async function runLint(lintPath: string, patchPath: string): Promise<void> {
|
||||||
.filter((arg) => arg.startsWith(`-`))
|
.filter((arg) => arg.startsWith(`-`))
|
||||||
.map((arg) => arg.replace(/^-+/, ``))
|
.map((arg) => arg.replace(/^-+/, ``))
|
||||||
.map((arg) => arg.split(/=(.*)/, 2))
|
.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 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")
|
const formats = (userArgsMap.get("out-format") || "")
|
||||||
if (formats) {
|
.trim()
|
||||||
if (formats.includes("github-actions")) {
|
.split(",")
|
||||||
addedArgs.push(`--out-format=${formats}`)
|
.filter((f) => f.length > 0)
|
||||||
} else {
|
.filter((f) => !f.startsWith(`github-actions`))
|
||||||
addedArgs.push(`--out-format=github-actions,${formats}`)
|
.concat("github-actions")
|
||||||
}
|
.join(",")
|
||||||
} else {
|
|
||||||
addedArgs.push(`--out-format=github-actions`)
|
addedArgs.push(`--out-format=${formats}`)
|
||||||
}
|
|
||||||
|
|
||||||
if (patchPath) {
|
if (patchPath) {
|
||||||
if (userArgNames.has(`new`) || userArgNames.has(`new-from-rev`) || userArgNames.has(`new-from-patch`)) {
|
if (userArgNames.has(`new`) || userArgNames.has(`new-from-rev`) || userArgNames.has(`new-from-patch`)) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue