Skip to content

Commit a1931b6

Browse files
authored
Merge branch 'main' into test/voting-power-safe-coverage
2 parents e030ded + 9e274d8 commit a1931b6

82 files changed

Lines changed: 313 additions & 209 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/janitor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
timeout-minutes: 3
1212
steps:
13-
- uses: styfle/cancel-workflow-action@0.12.1
13+
- uses: styfle/cancel-workflow-action@0.13.0
1414
with:
1515
workflow_id: 1041851,1401230,2837803
1616
access_token: ${{ github.token }}

.golangci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@ linters:
33
enable:
44
- asciicheck
55
- bodyclose
6+
- copyloopvar
67
- depguard
78
- dogsled
89
- dupl
910
- goconst
11+
- gocritic
1012
- misspell
1113
- nakedret
1214
- nolintlint
13-
- prealloc
1415
- staticcheck
1516
- unconvert
17+
- unused
1618
settings:
1719
depguard:
1820
rules:

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,13 +251,13 @@ format:
251251
#? lint: Run latest golangci-lint linter
252252
lint:
253253
@echo "--> Running linter"
254-
@go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest run
254+
@go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.7.2 run
255255
.PHONY: lint
256256

257257
#? lint: Run latest golangci-lint linter and apply fixes
258258
lint-fix:
259259
@echo "--> Running linter"
260-
@go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest run --fix
260+
@go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.7.2 run --fix
261261
.PHONY: lint-fix
262262

263263
#? lint-typo: Run codespell to check typos

STYLE_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ scroll down and understand the functionality of it just as well as you do. A loo
3838

3939
## Comments
4040

41-
* Use a space after comment deliminter (ex. `// your comment`).
41+
* Use a space after comment delimiter (ex. `// your comment`).
4242
* Many comments are not sentences. These should begin with a lower case letter and end without a period.
4343
* Conversely, sentences in comments should be sentenced-cased and end with a period.
4444

abci/types/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func DeterministicExecTxResult(response *ExecTxResult) *ExecTxResult {
151151
}
152152
}
153153

154-
// MarshalTxResults encodes the the TxResults as a list of byte
154+
// MarshalTxResults encodes the TxResults as a list of byte
155155
// slices. It strips off the non-deterministic pieces of the TxResults
156156
// so that the resulting data can be used for hash comparisons and used
157157
// in Merkle proofs.

blocksync/msgs_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func TestBcBlockRequestMessageValidateBasic(t *testing.T) {
2626
}
2727

2828
for _, tc := range testCases {
29-
tc := tc
29+
3030
t.Run(tc.testName, func(t *testing.T) {
3131
request := bcproto.BlockRequest{Height: tc.requestHeight}
3232
assert.Equal(t, tc.expectErr, blocksync.ValidateMsg(&request) != nil, "Validate Basic had an unexpected result")
@@ -46,7 +46,7 @@ func TestBcNoBlockResponseMessageValidateBasic(t *testing.T) {
4646
}
4747

4848
for _, tc := range testCases {
49-
tc := tc
49+
5050
t.Run(tc.testName, func(t *testing.T) {
5151
nonResponse := bcproto.NoBlockResponse{Height: tc.nonResponseHeight}
5252
assert.Equal(t, tc.expectErr, blocksync.ValidateMsg(&nonResponse) != nil, "Validate Basic had an unexpected result")
@@ -71,7 +71,7 @@ func TestBcStatusResponseMessageValidateBasic(t *testing.T) {
7171
}
7272

7373
for _, tc := range testCases {
74-
tc := tc
74+
7575
t.Run(tc.testName, func(t *testing.T) {
7676
response := bcproto.StatusResponse{Height: tc.responseHeight}
7777
assert.Equal(t, tc.expectErr, blocksync.ValidateMsg(&response) != nil, "Validate Basic had an unexpected result")
@@ -134,7 +134,7 @@ func TestBlocksyncMessageVectors(t *testing.T) {
134134
}
135135

136136
for _, tc := range testCases {
137-
tc := tc
137+
138138
t.Run(tc.testName, func(t *testing.T) {
139139
bz, _ := proto.Marshal(tc.bmsg)
140140

cmd/cometbft/commands/compact.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func compactGoLevelDBs(rootDir string, logger log.Logger) {
4343
wg := sync.WaitGroup{}
4444

4545
for _, dbName := range dbNames {
46-
dbName := dbName
46+
4747
wg.Add(1)
4848
go func() {
4949
defer wg.Done()

cmd/cometbft/commands/root.go

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,21 @@ func ParseConfig(cmd *cobra.Command) (*cfg.Config, error) {
3636
}
3737

3838
var home string
39-
if os.Getenv("CMTHOME") != "" {
40-
home = os.Getenv("CMTHOME")
41-
} else if os.Getenv("TMHOME") != "" {
39+
40+
cmtHome := os.Getenv("CMTHOME")
41+
tmHome := os.Getenv("TMHOME")
42+
43+
switch {
44+
case cmtHome != "":
45+
home = cmtHome
46+
47+
case tmHome != "":
4248
// XXX: Deprecated.
43-
home = os.Getenv("TMHOME")
49+
home = tmHome
4450
logger.Error("Deprecated environment variable TMHOME identified. CMTHOME should be used instead.")
45-
} else {
51+
52+
default:
53+
var err error
4654
home, err = cmd.Flags().GetString(cli.HomeFlag)
4755
if err != nil {
4856
return nil, err

config/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ func (cfg *Config) CheckDeprecated() []string {
177177
// BaseConfig
178178

179179
// BaseConfig defines the base configuration for a CometBFT node
180-
type BaseConfig struct { //nolint: maligned
180+
type BaseConfig struct {
181181

182182
// The version of the CometBFT binary that created
183183
// or last modified the config file
@@ -540,7 +540,7 @@ func (cfg RPCConfig) IsTLSEnabled() bool {
540540
// P2PConfig
541541

542542
// P2PConfig defines the configuration options for the CometBFT peer-to-peer networking layer
543-
type P2PConfig struct { //nolint: maligned
543+
type P2PConfig struct {
544544
RootDir string `mapstructure:"home"`
545545

546546
// Address to listen for incoming connections

config/config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ func TestConsensusConfig_ValidateBasic(t *testing.T) {
177177
"DoubleSignCheckHeight negative": {func(c *config.ConsensusConfig) { c.DoubleSignCheckHeight = -1 }, true},
178178
}
179179
for desc, tc := range testcases {
180-
tc := tc // appease linter
180+
// appease linter
181181
t.Run(desc, func(t *testing.T) {
182182
cfg := config.DefaultConsensusConfig()
183183
tc.modify(cfg)

0 commit comments

Comments
 (0)