Skip to content

Commit

Permalink
Add revive linter and enable superfluous-else rule (#1448)
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaMahany authored Nov 8, 2023
1 parent d5cca90 commit a2ba4c4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
8 changes: 8 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ linters:
- sqlclosecheck
- unconvert
- paralleltest
- revive
disable:
- errcheck
- gosec
Expand All @@ -32,6 +33,13 @@ linters-settings:
ignore: github.com/go-kit/kit/log:Log
gofmt:
simplify: false
revive:
rules:
- name: superfluous-else
severity: warning
disabled: false
arguments:
- "preserveScope"

issues:
exclude-rules:
Expand Down
4 changes: 2 additions & 2 deletions cmd/launcher/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ func main() {
logutil.Fatal(logger, err, "exec")
}
panic("how")
} else {
level.Debug(logger).Log("msg", "Nothing new")
}

level.Debug(logger).Log("msg", "Nothing new")
}
}

Expand Down
3 changes: 0 additions & 3 deletions ee/desktop/runner/runner_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ func (r *DesktopUsersProcessesRunner) userEnvVars(ctx context.Context, uid strin
envVars["DISPLAY"] = r.displayFromXwayland(ctx, int32(uidInt))

break
} else {
// Not a graphical session
continue
}
}

Expand Down

0 comments on commit a2ba4c4

Please sign in to comment.