mirror of
https://github.com/golangci/golangci-lint-action.git
synced 2025-12-16 07:28:27 +00:00
review
This commit is contained in:
parent
92c027dbfa
commit
e807442206
3 changed files with 20 additions and 7 deletions
8
dist/post_run/index.js
vendored
8
dist/post_run/index.js
vendored
|
|
@ -6811,8 +6811,12 @@ function runLint(lintPath, patchPath) {
|
|||
}
|
||||
const userArgs = core.getInput(`args`);
|
||||
const addedArgs = [];
|
||||
const userArgNamesRegex = /(?<=(^|\s)-+\b)([^\s=]+)(?==)/ig;
|
||||
const userArgNames = new Set(userArgs.match(userArgNamesRegex));
|
||||
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`);
|
||||
}
|
||||
|
|
|
|||
8
dist/run/index.js
vendored
8
dist/run/index.js
vendored
|
|
@ -6821,8 +6821,12 @@ function runLint(lintPath, patchPath) {
|
|||
}
|
||||
const userArgs = core.getInput(`args`);
|
||||
const addedArgs = [];
|
||||
const userArgNamesRegex = /(?<=(^|\s)-+\b)([^\s=]+)(?==)/ig;
|
||||
const userArgNames = new Set(userArgs.match(userArgNamesRegex));
|
||||
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`);
|
||||
}
|
||||
|
|
|
|||
11
src/run.ts
11
src/run.ts
|
|
@ -121,9 +121,14 @@ async function runLint(lintPath: string, patchPath: string): Promise<void> {
|
|||
const userArgs = core.getInput(`args`)
|
||||
const addedArgs: string[] = []
|
||||
|
||||
const userArgNamesRegex = /(?<=(^|\s)-+\b)([^\s=]+)(?==)/ig
|
||||
const userArgNames = new Set<string>(userArgs.match(userArgNamesRegex))
|
||||
|
||||
const userArgNames = new Set<string>(
|
||||
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`)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue