Skip to content

Commit

Permalink
Update linting rules as discussed
Browse files Browse the repository at this point in the history
  • Loading branch information
rkettelerij committed Nov 22, 2023
1 parent 5d883ea commit bbf1758
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
8 changes: 5 additions & 3 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ linters-settings:
desc: Should be replaced by standard lib errors package
cyclop:
# The maximal code complexity to report.
max-complexity: 12
max-complexity: 15
skip-tests: true
funlen:
lines: 100
nestif:
min-complexity: 6

linters:
disable-all: true
Expand Down Expand Up @@ -77,16 +79,16 @@ linters:
- nakedret # finds naked returns in functions greater than a specified function length
- nestif # reports deeply nested if statements
- nilerr # finds the code that returns nil even if it checks that the error is not nil
- nilnil # checks that there is no simultaneous return of nil error and an invalid value
- nolintlint # reports ill-formed or insufficient nolint directives
- nonamedreturns # reports all named returns
- nosprintfhostport # checks for misuse of Sprintf to construct a host with port in a URL
- perfsprint # Golang linter for performance, aiming at usages of fmt.Sprintf which have faster alternatives
- predeclared # finds code that shadows one of Go's predeclared identifiers
- promlinter # checks Prometheus metrics naming via promlint
- reassign # checks that package variables are not reassigned
- revive # fast, configurable, extensible, flexible, and beautiful linter for Go, drop-in replacement of golint
- rowserrcheck # checks whether Err of rows is checked successfully
- sqlclosecheck # checks that sql.Rows and sql.Stmt are closed
- sloglint # A Go linter that ensures consistent code style when using log/slog
- tenv # detects using os.Setenv instead of t.Setenv since Go1.17
- testableexamples # checks if examples are testable (have an expected output)
- tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes
Expand Down
2 changes: 0 additions & 2 deletions snap/pointindex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/stretchr/testify/assert"
)

//nolint:funlen
func TestPointIndex_containsPoint(t *testing.T) {
tests := []struct {
name string
Expand Down Expand Up @@ -114,7 +113,6 @@ func TestPointIndex_getQuadrantExtentAndCentroid(t *testing.T) {
}
}

//nolint:funlen
func TestPointIndex_InsertPoint(t *testing.T) {
tests := []struct {
name string
Expand Down
1 change: 0 additions & 1 deletion snap/snap.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ func snapPolygon(polygon *geom.Polygon, tileMatrix TileMatrix) *geom.Polygon {
return newPolygon
}

//nolint:cyclop
func addPointsAndSnap(ix *PointIndex, polygon *geom.Polygon) *geom.Polygon {
newPolygon := make([][][2]float64, 0, len(*polygon))
// Could use polygon.AsSegments(), but it skips rings with <3 segments and starts with the last segment.
Expand Down

0 comments on commit bbf1758

Please sign in to comment.