1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-09-15 18:57:01 +00:00

chore: use the same .golangci.yml as the runner & gofumpt over gofmt (#206)

To prepare for a smooth merge in the runner codebase.

- run with --fix for gofumpt and golangci
- manual edits for
  - disabling useless package naming warning
  - rename variables that had underscore in their name
  - remove trailing else at the end of a few functions

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/206
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
This commit is contained in:
Earl Warren 2025-07-28 12:26:41 +00:00 committed by earl-warren
parent ed98625ae9
commit c377159121
37 changed files with 138 additions and 140 deletions

View file

@ -195,16 +195,16 @@ func (sr *stepRun) setupShell(ctx context.Context) {
step.Shell = shellWithFallback[1]
}
} else {
shell_fallback := `
shellFallback := `
if command -v bash >/dev/null; then
echo -n bash
else
echo -n sh
fi
`
stdout, _, err := rc.sh(ctx, shell_fallback)
stdout, _, err := rc.sh(ctx, shellFallback)
if err != nil {
common.Logger(ctx).Error("fail to run %q: %v", shell_fallback, err)
common.Logger(ctx).Error("fail to run %q: %v", shellFallback, err)
return
}
step.Shell = stdout
@ -215,7 +215,7 @@ fi
func (sr *stepRun) setupWorkingDirectory(ctx context.Context) {
rc := sr.RunContext
step := sr.Step
workingdirectory := ""
var workingdirectory string
if step.WorkingDirectory == "" {
workingdirectory = rc.Run.Job().Defaults.Run.WorkingDirectory