Skip to content

Commit 04eb1b1

Browse files
authored
tools: upgrade all tools to latest (#18)
* tools: upgrade all tools to the latest * tools: switch goimports to zchee/goimportz * golangci-lint: remove deprecated linters and disable wrapcheck for now
1 parent 9287284 commit 04eb1b1

File tree

5 files changed

+502
-106
lines changed

5 files changed

+502
-106
lines changed

.golangci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ linters-settings:
6060
govet:
6161
enable-all: true
6262
check-shadowing: true
63+
disable:
64+
- fieldalignment
6365
depguard:
6466
list-type: blacklist
6567
include-go-root: true
@@ -110,6 +112,7 @@ linters:
110112
- paralleltest # paralleltest detects missing usage of t.Parallel() method in your Go test
111113
- scopelint # Scopelint checks for unpinned variables in go programs
112114
- sqlclosecheck # Checks that sql.Rows and sql.Stmt are closed
115+
- wrapcheck # Checks that errors returned from external packages are wrapped TODO(zchee): enable
113116
- wsl # Whitespace Linter
114117
enable:
115118
- asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers
@@ -136,10 +139,8 @@ linters:
136139
- govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
137140
- ifshort # Checks that your code uses short syntax for if-statements whenever possible
138141
- ineffassign # Detects when assignments to existing variables are not used
139-
- interfacer # Linter that suggests narrower interface types
140142
- lll # Reports long lines
141143
- makezero # Finds slice declarations with non-zero initial length
142-
- maligned # Tool to detect Go structs that would take less memory if their fields were sorted
143144
- misspell # Finds commonly misspelled English words in comments
144145
- nakedret # Finds naked returns in functions greater than a specified function length
145146
- nestif # Reports deeply nested if statements
@@ -160,7 +161,6 @@ linters:
160161
- unused # Checks Go code for unused constants, variables, functions and types
161162
- varcheck # Finds unused global variables and constants
162163
- whitespace # Tool for detection of leading and trailing whitespace
163-
- wrapcheck # Checks that errors returned from external packages are wrapped
164164

165165
issues:
166166
max-same-issues: 0

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ coverage: tools/bin/gotestsum ## Takes packages test coverage.
7575
lint: fmt lint/golangci-lint ## Run all linters.
7676

7777
.PHONY: fmt
78-
fmt: tools/bin/goimports tools/bin/gofumpt ## Run goimports and gofumpt.
78+
fmt: tools/bin/goimportz tools/bin/gofumpt ## Run goimportz and gofumpt.
7979
$(call target)
80-
find . -iname "*.go" -not -path "./vendor/**" | xargs -P ${JOBS} ${TOOLS_BIN}/goimports -local=${PKG},$(subst /jsonrpc2,,$(PKG)) -w
80+
find . -iname "*.go" -not -path "./vendor/**" | xargs -P ${JOBS} ${TOOLS_BIN}/goimportz -local=${PKG},$(subst /jsonrpc2,,$(PKG)) -w
8181
find . -iname "*.go" -not -path "./vendor/**" | xargs -P ${JOBS} ${TOOLS_BIN}/gofumpt -s -extra -w
8282

8383
.PHONY: lint/golangci-lint

tools/go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
module go.lsp.dev/jsonrpc2/tools
22

3-
go 1.15
3+
go 1.16
44

55
require (
6-
github.com/golangci/golangci-lint v1.36.0
7-
golang.org/x/tools v0.1.1-0.20210129181147-0cef57b5b584
8-
gotest.tools/gotestsum v1.6.1
9-
mvdan.cc/gofumpt v0.1.0
6+
github.com/golangci/golangci-lint v1.39.0
7+
github.com/zchee/goimportz v0.0.1
8+
gotest.tools/gotestsum v1.6.3
9+
mvdan.cc/gofumpt v0.1.1
1010
)

0 commit comments

Comments
 (0)