mirror of
https://github.com/golangci/golangci-lint-action.git
synced 2026-07-04 23:51:37 +00:00
feat: add no-run-logs-group as experimental option (#1403)
This commit is contained in:
committed by
GitHub
parent
ed485de1ff
commit
efd0857dc4
+10
-2
@@ -59467,15 +59467,23 @@ function modulesAutoDetection(rootDir) {
|
||||
async function runLint(binPath) {
|
||||
const workingDirectory = getWorkingDirectory();
|
||||
const experimental = core.getInput(`experimental`).split(`,`);
|
||||
const noGroup = experimental.includes(`no-run-logs-group`);
|
||||
if (experimental.includes(`automatic-module-directories`)) {
|
||||
const wds = modulesAutoDetection(workingDirectory);
|
||||
const cwd = process.cwd();
|
||||
for (const wd of wds) {
|
||||
await core.group(`run golangci-lint in ${path.relative(cwd, wd)}`, () => runGolangciLint(binPath, wd));
|
||||
await optionalGroup(noGroup, `run golangci-lint in ${path.relative(cwd, wd)}`, () => runGolangciLint(binPath, wd));
|
||||
}
|
||||
return;
|
||||
}
|
||||
await core.group(`run golangci-lint`, () => runGolangciLint(binPath, workingDirectory));
|
||||
await optionalGroup(noGroup, `run golangci-lint`, () => runGolangciLint(binPath, workingDirectory));
|
||||
}
|
||||
async function optionalGroup(noGroup, name, fn) {
|
||||
if (noGroup) {
|
||||
core.info(name);
|
||||
return fn();
|
||||
}
|
||||
return core.group(name, fn);
|
||||
}
|
||||
async function run() {
|
||||
try {
|
||||
|
||||
+10
-2
@@ -59467,15 +59467,23 @@ function modulesAutoDetection(rootDir) {
|
||||
async function runLint(binPath) {
|
||||
const workingDirectory = getWorkingDirectory();
|
||||
const experimental = core.getInput(`experimental`).split(`,`);
|
||||
const noGroup = experimental.includes(`no-run-logs-group`);
|
||||
if (experimental.includes(`automatic-module-directories`)) {
|
||||
const wds = modulesAutoDetection(workingDirectory);
|
||||
const cwd = process.cwd();
|
||||
for (const wd of wds) {
|
||||
await core.group(`run golangci-lint in ${path.relative(cwd, wd)}`, () => runGolangciLint(binPath, wd));
|
||||
await optionalGroup(noGroup, `run golangci-lint in ${path.relative(cwd, wd)}`, () => runGolangciLint(binPath, wd));
|
||||
}
|
||||
return;
|
||||
}
|
||||
await core.group(`run golangci-lint`, () => runGolangciLint(binPath, workingDirectory));
|
||||
await optionalGroup(noGroup, `run golangci-lint`, () => runGolangciLint(binPath, workingDirectory));
|
||||
}
|
||||
async function optionalGroup(noGroup, name, fn) {
|
||||
if (noGroup) {
|
||||
core.info(name);
|
||||
return fn();
|
||||
}
|
||||
return core.group(name, fn);
|
||||
}
|
||||
async function run() {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user