1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2026-06-20 01:19:23 +02:00

Enable revive linter, and fix a bunch of warnings

I took the set of enabled checks from revive's recommended configuration [1],
and removed some that I didn't like. There might be other useful checks in
revive that we might want to enable, but this is a nice improvement already.

The bulk of the changes here are removing unnecessary else statements after
returns, but there are a few others too.

[1] https://github.com/mgechev/revive?tab=readme-ov-file#recommended-configuration
This commit is contained in:
Stefan Haller
2025-06-30 19:13:12 +02:00
parent 7aa426fa71
commit ca05a2ccea
47 changed files with 152 additions and 170 deletions
+15
View File
@@ -11,6 +11,7 @@ linters:
- nakedret
- nolintlint
- prealloc
- revive
- thelper
- tparallel
- unconvert
@@ -76,6 +77,20 @@ linters:
dot-import-whitelist:
- github.com/jesseduffield/lazygit/pkg/integration/components
revive:
severity: warning
rules:
- name: atomic
- name: context-as-argument
- name: context-keys-type
- name: error-naming
- name: var-declaration
- name: package-comments
- name: range
- name: time-naming
- name: indent-error-flow
- name: errorf
- name: superfluous-else
exclusions:
generated: lax
presets: