feat: fix ci / makefile
Overview
fix / cleanup makefile and correcting several commands. Related to https://github.com/btcsuite/btcd/issues/2319 https://github.com/btcsuite/btcd/pull/2316
Is this still under development?
@yyforyongyu It is still in development, but it would be good to recreate the PR to follow Ideal Git Commit Structure.
@rabbitprincess Cool thanks - I think it's better to do a force push on this PR once you fix the commit structure, it's easier that way as we won't lose the context/comments from this PR.
Pull Request Test Coverage Report for Build 16746440587
Details
- 0 of 0 changed or added relevant lines in 0 files are covered.
- 6 unchanged lines in 2 files lost coverage.
- Overall coverage increased (+0.009%) to 54.8%
| Files with Coverage Reduction | New Missed Lines | % |
|---|---|---|
| connmgr/connmanager.go | 2 | 83.9% |
| database/ffldb/blockio.go | 4 | 88.81% |
| <!-- | Total: | 6 |
| Totals | |
|---|---|
| Change from base Build 16582220057: | 0.009% |
| Covered Lines: | 31094 |
| Relevant Lines: | 56741 |
π - Coveralls
@yyforyongyu this pr and https://github.com/btcsuite/btcd/pull/2307 are force-pushed. can you review again?
@GustavoStingelin Sure! It's been updated to v2.1.6.
LGTM!
@Roasbeef @yyforyongyu with the updated golangci-lint, we're now seeing 162 issues across several linters. Since the linter isnβt part of the pipeline yet, would you prefer merging this PR as-is and handling the fixes in follow-up PRs? Or should we resolve all the issues before merging?
Breakdown of issues:
- errcheck: 50
- ineffassign: 16
- staticcheck: 50
- unused: 46
or maybe copy the .golangci.yml from lnd as mentioned previously
@kcalvinalvin any thoughts?
Since the linter isnβt part of the pipeline yet, would you prefer merging this PR as-is and handling the fixes in follow-up PRs?
Usually what we do is set a commit hash that grandfathers in any violations. So then only new PRs that introduce new linting errors get triggered.
@rabbitprincess please, add the file
.golangci.ymlto the root path with the valueversion: "2" issues: # Only show newly introduced problems. new-from-rev: 80b74d6c5a0088a66dc96df6777d21e15c04849c
Sure! It's been applied.
I think you will need to rebase your first commit with the changes from the last
@GustavoStingelin Sure. It's been applied.
If I run
make lint, I get this error:β° make lint Linting source. /Users/roasbeef/gocode/bin/golangci-lint run -v panic: load embedded ruleguard rules: rules/rules.go:13: can't load fmt goroutine 1 [running]: github.com/go-critic/go-critic/checkers.init.22() /Users/roasbeef/gocode/pkg/mod/github.com/go-critic/[email protected]/checkers/embedded_rules.go:47 +0x494 make: *** [lint] Error 2
Can you check the output of go env?
It looks like go module might not be enabled in your environment (e.g., GO111MODULE=off )
If I run make lint, I get this error:
FYI, make lint still works fine on my env (Go 1.24.4, Linux amd64, GO111MODULE='').
Ah I'm on Go 1.23.6 locally. So seems that we'll need to update the top level go.mod to use Go 1.24.
Go 1.25 comes out in August, so that should line up with our policy to support the past two go versions.
Ah I'm on Go 1.23.6 locally. So seems that we'll need to update the top level
go.modto use Go 1.24.Go 1.25 comes out in August, so that should line up with our policy to support the past two go versions.
works well on version 1.23.6 here.
β btcd git:(feature/fix-ci) β mise use [email protected]
mise ~/code/btcd/mise.toml tools: [email protected]
β btcd git:(feature/fix-ci) β go version
go version go1.23.6 linux/amd64
β btcd git:(feature/fix-ci) β rm $GOBIN/golangci-lint
β btcd git:(feature/fix-ci) β make lint
Fetching linter
go install -v github.com/golangci/golangci-lint/v2/cmd/[email protected]
Linting source.
/home/head/.local/share/mise/installs/go/1.23.6/bin/golangci-lint run -v --timeout=5m
INFO golangci-lint has version v2.1.6 built with go1.23.6 from (unknown, modified: ?, mod sum: "h1:LXqShFfAGM5BDzEOWD2SL1IzJAgUOqES/HRBsfKjI+w=") on (unknown)
... omited logs
INFO [runner] linters took 116.4495ms with stages: goanalysis_metalinter: 38.478262ms
0 issues.
INFO File cache stats: 0 entries of total size 0B
INFO Memory: 5 samples, avg is 59.6MB, max is 94.0MB
INFO Execution took 360.073736ms