Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
217 changes: 119 additions & 98 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
version: "2"
run:
tests: true
timeout: 10m

linters:
enable-all: true
default: all
disable:
- containedctx
- contextcheck
Expand Down Expand Up @@ -40,101 +39,123 @@ linters:
- varnamelen
- wrapcheck
- wsl

settings:
depguard:
rules:
main:
files:
- $all
- '!$test'
allow:
- $gostd
- github.com/cockroachdb/pebble
- github.com/google/btree
- github.com/syndtr/goleveldb/leveldb
test:
files:
- $test
allow:
- $gostd
- github.com/stretchr/testify
- github.com/syndtr/goleveldb/leveldb/opt
dogsled:
max-blank-identifiers: 3
gosec:
excludes:
- G115
misspell:
locale: US
revive:
enable-all-rules: true
rules:
- name: comment-spacings
disabled: true
- name: max-public-structs
disabled: true
- name: cognitive-complexity
disabled: true
- name: argument-limit
disabled: true
- name: cyclomatic
disabled: true
- name: deep-exit
disabled: true
- name: file-header
disabled: true
- name: function-length
disabled: true
- name: function-result-limit
disabled: true
- name: line-length-limit
disabled: true
- name: flag-parameter
disabled: true
- name: add-constant
disabled: true
- name: empty-lines
disabled: true
- name: import-shadowing
disabled: true
- name: modifies-value-receiver
disabled: true
- name: confusing-naming
disabled: true
- name: defer
disabled: true
- name: unchecked-type-assertion
disabled: true
- name: unhandled-error
arguments:
- fmt.Printf
- fmt.Print
- fmt.Println
disabled: true
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- gocritic
- goimport
- gosec
- noctx
- paralleltest
- testpackage
- tparallel
path: _test\.go
- linters:
- goconst
path: (.+)_test\.go
paths:
- third_party$
- builtin$
- examples$
issues:
exclude-rules:
- path: _test\.go
linters:
- gocritic
- gofmt
- goimport
- gosec
- noctx
- paralleltest
- testpackage
- tparallel
max-issues-per-linter: 10000
max-same-issues: 10000

linters-settings:
dogsled:
max-blank-identifiers: 3
goconst:
ignore-tests: true
misspell:
locale: US
gci:
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- blank # blank imports
- dot # dot imports
- prefix(github.com/cometbft/cometbft-db)
custom-order: true
depguard:
rules:
main:
files:
- $all
- "!$test"
allow:
- $gostd
- github.com/cockroachdb/pebble
- github.com/google/btree
- github.com/syndtr/goleveldb/leveldb
test:
files:
- "$test"
allow:
- $gostd
- github.com/stretchr/testify
- github.com/syndtr/goleveldb/leveldb/opt

revive:
enable-all-rules: true
rules:
- name: comment-spacings # temporarily disabled
disabled: true
- name: max-public-structs
disabled: true
- name: cognitive-complexity
disabled: true
- name: argument-limit
disabled: true
- name: cyclomatic
disabled: true
- name: deep-exit
disabled: true
- name: file-header
disabled: true
- name: function-length
disabled: true
- name: function-result-limit
disabled: true
- name: line-length-limit
disabled: true
- name: flag-parameter
disabled: true
- name: add-constant
disabled: true
- name: empty-lines
disabled: true
- name: import-shadowing
disabled: true
- name: modifies-value-receiver
disabled: true
- name: confusing-naming
disabled: true
- name: defer
disabled: true
- name: unchecked-type-assertion
disabled: true
- name: unhandled-error
disabled: true
arguments:
- "fmt.Printf"
- "fmt.Print"
- "fmt.Println"
gosec:
excludes:
- G115
formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports
settings:
gci:
sections:
- standard
- default
- blank
- dot
- prefix(github.com/cometbft/cometbft-db)
custom-order: true
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
- _test\.go
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ test-all-with-coverage:
#? lint: Run linter
lint:
@echo "--> Running linter"
@go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest run
@go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.0 run
@go mod verify
.PHONY: lint

Expand Down
37 changes: 20 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module github.com/cometbft/cometbft-db

go 1.23
go 1.24

require (
github.com/cockroachdb/pebble v1.1.4
github.com/cockroachdb/pebble/v2 v2.0.3
github.com/dgraph-io/badger/v4 v4.5.1
github.com/google/btree v1.1.3
github.com/jmhodges/levigo v1.0.0
Expand All @@ -14,39 +14,42 @@ require (
)

require (
github.com/DataDog/zstd v1.5.6 // indirect
github.com/DataDog/zstd v1.5.6-0.20230824185856-869dae002e5e // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cockroachdb/crlib v0.0.0-20241015224233-894974b3ad94 // indirect
github.com/cockroachdb/errors v1.11.3 // indirect
github.com/cockroachdb/fifo v0.0.0-20240816210425-c5d0cb0b6fc0 // indirect
github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506 // indirect
github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/swiss v0.0.0-20250327203710-2932b022f6df // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgraph-io/ristretto/v2 v2.1.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/getsentry/sentry-go v0.31.1 // indirect
github.com/getsentry/sentry-go v0.27.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/flatbuffers v25.1.24+incompatible // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.5-0.20231225225746-43d5d4cd4e0e // indirect
github.com/google/flatbuffers v24.12.23+incompatible // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.20.5 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.62.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rogpeppe/go-internal v1.13.1 // indirect
github.com/prometheus/client_golang v1.12.0 // indirect
github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 // indirect
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/protobuf v1.36.4 // indirect
google.golang.org/protobuf v1.36.3 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

Expand Down
Loading
Loading