diff --git a/dist/post_run/index.js b/dist/post_run/index.js index f97447b542..585a64f14a 100644 --- a/dist/post_run/index.js +++ b/dist/post_run/index.js @@ -6811,14 +6811,12 @@ function runLint(lintPath, patchPath) { } const userArgs = core.getInput(`args`); const addedArgs = []; - const userArgNames = new Set(); - userArgs - .split(/\s/) + const userArgNames = new Set(userArgs + .trim() + .split(/\s+/) .map((arg) => arg.split(`=`)[0]) .filter((arg) => arg.startsWith(`-`)) - .forEach((arg) => { - userArgNames.add(arg.replace(`-`, ``)); - }); + .map((arg) => arg.replace(/^-+/, ``))); if (userArgNames.has(`out-format`)) { throw new Error(`please, don't change out-format for golangci-lint: it can be broken in a future`); } diff --git a/dist/run/index.js b/dist/run/index.js index d455344ea7..29f29e542f 100644 --- a/dist/run/index.js +++ b/dist/run/index.js @@ -6821,14 +6821,12 @@ function runLint(lintPath, patchPath) { } const userArgs = core.getInput(`args`); const addedArgs = []; - const userArgNames = new Set(); - userArgs - .split(/\s/) + const userArgNames = new Set(userArgs + .trim() + .split(/\s+/) .map((arg) => arg.split(`=`)[0]) .filter((arg) => arg.startsWith(`-`)) - .forEach((arg) => { - userArgNames.add(arg.replace(`-`, ``)); - }); + .map((arg) => arg.replace(/^-+/, ``))); if (userArgNames.has(`out-format`)) { throw new Error(`please, don't change out-format for golangci-lint: it can be broken in a future`); } diff --git a/src/run.ts b/src/run.ts index 66c7dbe9e6..ffcd3e7f52 100644 --- a/src/run.ts +++ b/src/run.ts @@ -121,15 +121,14 @@ async function runLint(lintPath: string, patchPath: string): Promise { const userArgs = core.getInput(`args`) const addedArgs: string[] = [] - const userArgNames = new Set() - userArgs - .split(/\s/) - .map((arg) => arg.split(`=`)[0]) - .filter((arg) => arg.startsWith(`-`)) - .forEach((arg) => { - userArgNames.add(arg.replace(`-`, ``)) - }) - + const userArgNames = new Set( + userArgs + .trim() + .split(/\s+/) + .map((arg) => arg.split(`=`)[0]) + .filter((arg) => arg.startsWith(`-`)) + .map((arg) => arg.replace(/^-+/, ``)) + ) if (userArgNames.has(`out-format`)) { throw new Error(`please, don't change out-format for golangci-lint: it can be broken in a future`) }