Skip to content

Commit

Permalink
Upgrade golangci-lint to v1.55.2
Browse files Browse the repository at this point in the history
Some of the changes involve the `revive` linter being a bit stricter,
resulting in the removal of "dot" imports. This is probably a good
thing, since the tests are now more similar to how users will see
things. There is also a new linter used called `perfsprint` which checks
for bad uses of `fmt.Sprintf`.
  • Loading branch information
peterstace committed Nov 12, 2023
1 parent cafba97 commit 5d8af58
Show file tree
Hide file tree
Showing 16 changed files with 527 additions and 519 deletions.
2 changes: 1 addition & 1 deletion .ci/golint.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golangci/golangci-lint:v1.54.2
FROM golangci/golangci-lint:v1.55.2

RUN apt-get update \
&& apt-get install -y -q --no-install-recommends \
Expand Down
6 changes: 6 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ linters:
- noctx
- nolintlint
- nosprintfhostport
- perfsprint
- predeclared
- promlinter
- reassign
Expand Down Expand Up @@ -133,19 +134,24 @@ linters:
- gci
- gochecknoglobals
- gochecknoinits
- gochecksumtype
- gocognit
- goconst
- gocyclo
- godox
- goerr113
- gomnd
- inamedparam
- lll
- maintidx
- nestif
- nlreturn
- nonamedreturns
- paralleltest
- prealloc
- protogetter
- sloglint
- testifylint
- varnamelen
- wrapcheck
- wsl
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ DC_RUN = \
--project-name sf-$$task \
--file .ci/docker-compose-$$task.yml \
up \
--abort-on-container-exit
--abort-on-container-exit \
--build

.PHONY: lint
lint:
Expand Down
8 changes: 4 additions & 4 deletions geom/accessor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package geom_test
import (
"testing"

. "github.com/peterstace/simplefeatures/geom"
"github.com/peterstace/simplefeatures/geom"
)

func TestPointAccessorNonEmpty(t *testing.T) {
xy, ok := geomFromWKT(t, "POINT(1 2)").MustAsPoint().XY()
expectBoolEq(t, ok, true)
expectXYEq(t, xy, XY{1, 2})
expectXYEq(t, xy, geom.XY{1, 2})
}

func TestPointAccessorEmpty(t *testing.T) {
Expand All @@ -25,11 +25,11 @@ func TestLineStringAccessor(t *testing.T) {
pt56 := xyCoords(5, 6)

t.Run("start", func(t *testing.T) {
want := NewPoint(pt12)
want := geom.NewPoint(pt12)
expectGeomEq(t, ls.StartPoint().AsGeometry(), want.AsGeometry())
})
t.Run("end", func(t *testing.T) {
want := NewPoint(pt56)
want := geom.NewPoint(pt56)
expectGeomEq(t, ls.EndPoint().AsGeometry(), want.AsGeometry())
})
t.Run("num points", func(t *testing.T) {
Expand Down
Loading

0 comments on commit 5d8af58

Please sign in to comment.