Skip to content

Commit

Permalink
Merge pull request #123 from spacemeshos/retire-staticcheck
Browse files Browse the repository at this point in the history
Run staticcheck only via golangci-lint
  • Loading branch information
fasmat authored Aug 9, 2024
2 parents 151323d + 0ad7187 commit 4692916
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ jobs:
make install
make test-fmt
make test-tidy
- name: staticcheck
run: make staticcheck
lint:
runs-on: ubuntu-latest
Expand Down
9 changes: 7 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ linters:
- govet
# - grouper
- importas
# - inamedparam
- inamedparam
- ineffassign
# - interfacebloat
# - intrange
Expand Down Expand Up @@ -549,6 +549,11 @@ linters-settings:
- pkg: "k8s.io/client-go/applyconfigurations/meta/v1"
alias: metav1

inamedparam:
# Skips check for interface methods with only a single parameter.
# Default: false
skip-single-param: false

lll:
# Max line length, lines longer will be reported.
# '\t' is counted as 1 character by default, and can be changed with the tab-width option.
Expand Down Expand Up @@ -591,7 +596,7 @@ linters-settings:
nestif:
# Minimal complexity of if statements to report.
# Default: 5
min-complexity: 15
min-complexity: 5

perfsprint:
# Optimizes even if it requires an int or uint type cast.
Expand Down
15 changes: 5 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ CGO_LDFLAGS := $(LINKLIBS) $(RPATH)
STATICLDFLAGS := -L$(UNZIP_DEST) -led25519_bip32 -lspacemesh_remote_wallet
EXTRACT = tar -xzf

GOLANGCI_LINT_VERSION := v1.59.0
GOTESTSUM_VERSION := v1.12.0

# Detect operating system
ifeq ($(OS),Windows_NT)
SYSTEM := windows
Expand Down Expand Up @@ -96,9 +99,8 @@ $(DOWNLOAD_DEST):
.PHONY: install
install:
go mod download
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.57.0
go install gotest.tools/gotestsum@v1.11.0
go install honnef.co/go/tools/cmd/staticcheck@v0.4.7
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s $(GOLANGCI_LINT_VERSION)
go install gotest.tools/gotestsum@$(GOTESTSUM_VERSION)

.PHONY: tidy
tidy:
Expand Down Expand Up @@ -157,12 +159,5 @@ lint-github-action: $(UNZIP_DEST)
LD_LIBRARY_PATH=$(REAL_DEST) \
./bin/golangci-lint run --config .golangci.yml --out-format=github-actions

.PHONY: staticcheck
staticcheck: $(UNZIP_DEST)
CGO_CFLAGS="-I$(REAL_DEST)" \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
LD_LIBRARY_PATH=$(REAL_DEST) \
staticcheck ./...

clean:
rm -rf $(UNZIP_DEST)
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/spacemeshos/smcli

go 1.22.3
go 1.22.4

require (
github.com/btcsuite/btcutil v1.0.2
Expand Down

0 comments on commit 4692916

Please sign in to comment.