mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-05 03:24:14 -05:00
Restructure golangci-lint config: explicit opt-in (#15744)
* update golangci-lint configuration to enable basic linters only * Add back formatter * feedback * Add nolint
This commit is contained in:
1
.github/workflows/go.yml
vendored
1
.github/workflows/go.yml
vendored
@@ -56,7 +56,6 @@ jobs:
|
||||
uses: golangci/golangci-lint-action@v8
|
||||
with:
|
||||
version: v2.4
|
||||
only-new-issues: true
|
||||
|
||||
build:
|
||||
name: Build
|
||||
|
||||
@@ -2,72 +2,13 @@ version: "2"
|
||||
run:
|
||||
go: 1.23.5
|
||||
linters:
|
||||
default: all
|
||||
disable:
|
||||
- asasalint
|
||||
- bodyclose
|
||||
- containedctx
|
||||
- contextcheck
|
||||
- cyclop
|
||||
- depguard
|
||||
- dogsled
|
||||
- dupl
|
||||
- durationcheck
|
||||
- err113
|
||||
- errname
|
||||
- exhaustive
|
||||
- exhaustruct
|
||||
- forbidigo
|
||||
- forcetypeassert
|
||||
- funlen
|
||||
- gochecknoglobals
|
||||
- gochecknoinits
|
||||
- goconst
|
||||
- gocritic
|
||||
- gocyclo
|
||||
- godot
|
||||
- godox
|
||||
- gomoddirectives
|
||||
- gosec
|
||||
enable:
|
||||
- errcheck
|
||||
- ineffassign
|
||||
- govet
|
||||
- inamedparam
|
||||
- interfacebloat
|
||||
- intrange
|
||||
- ireturn
|
||||
- lll
|
||||
- maintidx
|
||||
- makezero
|
||||
- mnd
|
||||
- musttag
|
||||
- nakedret
|
||||
- nestif
|
||||
- nilnil
|
||||
- nlreturn
|
||||
- noctx
|
||||
- noinlineerr
|
||||
- nolintlint
|
||||
- nonamedreturns
|
||||
- nosprintfhostport
|
||||
- perfsprint
|
||||
- prealloc
|
||||
- predeclared
|
||||
- promlinter
|
||||
- protogetter
|
||||
- recvcheck
|
||||
- revive
|
||||
- spancheck
|
||||
disable:
|
||||
- staticcheck
|
||||
- tagalign
|
||||
- tagliatelle
|
||||
- thelper
|
||||
- unparam
|
||||
- usetesting
|
||||
- varnamelen
|
||||
- wrapcheck
|
||||
- wsl
|
||||
settings:
|
||||
gocognit:
|
||||
min-complexity: 65
|
||||
- unused
|
||||
exclusions:
|
||||
generated: lax
|
||||
presets:
|
||||
@@ -83,6 +24,7 @@ linters:
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
||||
|
||||
formatters:
|
||||
enable:
|
||||
- gofmt
|
||||
@@ -96,4 +38,4 @@ formatters:
|
||||
- tools/analyzers
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
||||
- examples$
|
||||
3
changelog/ttsao_simplify-golangci-config.md
Normal file
3
changelog/ttsao_simplify-golangci-config.md
Normal file
@@ -0,0 +1,3 @@
|
||||
### Ignored
|
||||
|
||||
- Update golangci-lint config to enable only basic linters that currently pass
|
||||
@@ -90,6 +90,7 @@ func (r *runner) run(ctx context.Context) {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
log.Info("Context canceled, stopping validator")
|
||||
//nolint:govet
|
||||
return // Exit if context is canceled.
|
||||
case slot := <-v.NextSlot():
|
||||
if !r.healthMonitor.IsHealthy() {
|
||||
@@ -98,7 +99,7 @@ func (r *runner) run(ctx context.Context) {
|
||||
}
|
||||
|
||||
deadline := v.SlotDeadline(slot)
|
||||
slotCtx, cancel := context.WithDeadline(ctx, deadline)
|
||||
slotCtx, cancel := context.WithDeadline(ctx, deadline) //nolint:govet
|
||||
|
||||
var span trace.Span
|
||||
slotCtx, span = prysmTrace.StartSpan(slotCtx, "validator.processSlot")
|
||||
@@ -131,7 +132,7 @@ func (r *runner) run(ctx context.Context) {
|
||||
|
||||
// Start fetching domain data for the next epoch.
|
||||
if slots.IsEpochEnd(slot) {
|
||||
domainCtx, _ := context.WithDeadline(ctx, deadline)
|
||||
domainCtx, _ := context.WithDeadline(ctx, deadline) //nolint:govet
|
||||
go v.UpdateDomainDataCaches(domainCtx, slot+1)
|
||||
}
|
||||
|
||||
@@ -145,7 +146,7 @@ func (r *runner) run(ctx context.Context) {
|
||||
continue
|
||||
}
|
||||
// performRoles calls span.End()
|
||||
rolesCtx, _ := context.WithDeadline(ctx, deadline)
|
||||
rolesCtx, _ := context.WithDeadline(ctx, deadline) //nolint:govet
|
||||
performRoles(rolesCtx, allRoles, v, slot, &wg, span)
|
||||
case e := <-v.EventsChan():
|
||||
v.ProcessEvent(ctx, e)
|
||||
|
||||
Reference in New Issue
Block a user