Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run staticcheck only via golangci-lint #123

Merged
merged 1 commit into from
Aug 9, 2024
Merged
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
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/[email protected]
go install honnef.co/go/tools/cmd/[email protected]
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