Update go dev dependencies (#22064)

`golangci-lint`
[deprecated](https://github.com/golangci/golangci-lint/issues/1841) a
bunch of linters, removed them.
pull/22067/head
silverwind 2 years ago committed by GitHub
parent cf27403e18
commit 0585ac3ac6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 34
      .golangci.yml
  2. 12
      Makefile
  3. 6
      models/db/context.go
  4. 2
      models/migrations/v1_17/main_test.go
  5. 2
      models/migrations/v1_17/v211.go
  6. 2
      models/migrations/v1_17/v212.go
  7. 2
      models/migrations/v1_17/v213.go
  8. 2
      models/migrations/v1_17/v214.go
  9. 2
      models/migrations/v1_17/v215.go
  10. 2
      models/migrations/v1_17/v216.go
  11. 2
      models/migrations/v1_17/v217.go
  12. 2
      models/migrations/v1_17/v218.go
  13. 2
      models/migrations/v1_17/v219.go
  14. 2
      models/migrations/v1_17/v220.go
  15. 2
      models/migrations/v1_17/v221.go
  16. 2
      models/migrations/v1_17/v221_test.go
  17. 2
      models/migrations/v1_17/v222.go
  18. 2
      models/migrations/v1_17/v223.go
  19. 2
      models/migrations/v1_18/main_test.go
  20. 2
      models/migrations/v1_18/v224.go
  21. 2
      models/migrations/v1_18/v225.go
  22. 2
      models/migrations/v1_18/v226.go
  23. 2
      models/migrations/v1_18/v227.go
  24. 2
      models/migrations/v1_18/v228.go
  25. 2
      models/migrations/v1_18/v230.go
  26. 2
      models/migrations/v1_19/main_test.go
  27. 2
      models/migrations/v1_19/v232.go
  28. 2
      models/migrations/v1_6/v70.go
  29. 2
      models/migrations/v1_6/v71.go
  30. 2
      models/migrations/v1_6/v72.go
  31. 2
      models/migrations/v1_7/v73.go
  32. 2
      models/migrations/v1_7/v74.go
  33. 2
      models/migrations/v1_7/v75.go
  34. 2
      models/migrations/v1_8/v76.go
  35. 2
      models/migrations/v1_8/v77.go
  36. 2
      models/migrations/v1_8/v78.go
  37. 2
      models/migrations/v1_8/v79.go
  38. 2
      models/migrations/v1_8/v80.go
  39. 2
      models/migrations/v1_8/v81.go
  40. 2
      models/migrations/v1_9/v82.go
  41. 2
      modules/charset/escape_stream.go
  42. 2
      modules/log/groutinelabel.go
  43. 2
      modules/setting/setting.go
  44. 6
      routers/api/packages/pypi/pypi.go

@ -1,28 +1,28 @@
linters: linters:
enable: enable:
- gosimple - bidichk
- deadcode # - deadcode # deprecated - https://github.com/golangci/golangci-lint/issues/1841
- typecheck - depguard
- govet
- errcheck
- staticcheck
- unused
- structcheck
- varcheck
- dupl - dupl
#- gocyclo # The cyclomatic complexety of a lot of functions is too high, we should refactor those another time. - errcheck
- gofmt
- gocritic - gocritic
- bidichk # - gocyclo # The cyclomatic complexety of a lot of functions is too high, we should refactor those another time.
- ineffassign - gofmt
- revive
- gofumpt - gofumpt
- depguard - gosimple
- govet
- ineffassign
- nakedret - nakedret
- unconvert
- wastedassign
- nolintlint - nolintlint
- revive
- staticcheck
# - structcheck # deprecated - https://github.com/golangci/golangci-lint/issues/1841
- stylecheck - stylecheck
- typecheck
- unconvert
- unused
# - varcheck # deprecated - https://github.com/golangci/golangci-lint/issues/1841
# - wastedassign # disabled - https://github.com/golangci/golangci-lint/issues/2649
enable-all: false enable-all: false
disable-all: true disable-all: true
fast: false fast: false

@ -26,15 +26,15 @@ COMMA := ,
XGO_VERSION := go-1.19.x XGO_VERSION := go-1.19.x
AIR_PACKAGE ?= github.com/cosmtrek/air@v1.40.4 AIR_PACKAGE ?= github.com/cosmtrek/air@v1.40.4
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@2.5.0 EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@2.6.0
ERRCHECK_PACKAGE ?= github.com/kisielk/errcheck@v1.6.1 ERRCHECK_PACKAGE ?= github.com/kisielk/errcheck@v1.6.2
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.3.1 GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.4.0
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.47.0 GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1
GXZ_PAGAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.10 GXZ_PAGAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.10
MISSPELL_PACKAGE ?= github.com/client9/misspell/cmd/misspell@v0.3.4 MISSPELL_PACKAGE ?= github.com/client9/misspell/cmd/misspell@v0.3.4
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.30.0 SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.30.3
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1.3.0 GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1.5.0
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@latest GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@latest
DOCKER_IMAGE ?= gitea/gitea DOCKER_IMAGE ?= gitea/gitea

@ -21,8 +21,10 @@ type contextKey struct {
} }
// enginedContextKey is a context key. It is used with context.Value() to get the current Engined for the context // enginedContextKey is a context key. It is used with context.Value() to get the current Engined for the context
var enginedContextKey = &contextKey{"engined"} var (
var _ Engined = &Context{} enginedContextKey = &contextKey{"engined"}
_ Engined = &Context{}
)
// Context represents a db context // Context represents a db context
type Context struct { type Context struct {

@ -1,7 +1,7 @@
// Copyright 2021 The Gitea Authors. All rights reserved. // Copyright 2021 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_17 // nolint package v1_17 //nolint
import ( import (
"testing" "testing"

@ -1,7 +1,7 @@
// Copyright 2022 The Gitea Authors. All rights reserved. // Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_17 // nolint package v1_17 //nolint
import ( import (
"fmt" "fmt"

@ -1,7 +1,7 @@
// Copyright 2022 The Gitea Authors. All rights reserved. // Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_17 // nolint package v1_17 //nolint
import ( import (
"code.gitea.io/gitea/modules/timeutil" "code.gitea.io/gitea/modules/timeutil"

@ -1,7 +1,7 @@
// Copyright 2022 The Gitea Authors. All rights reserved. // Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_17 // nolint package v1_17 //nolint
import ( import (
"xorm.io/xorm" "xorm.io/xorm"

@ -1,7 +1,7 @@
// Copyright 2022 The Gitea Authors. All rights reserved. // Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_17 // nolint package v1_17 //nolint
import ( import (
"xorm.io/xorm" "xorm.io/xorm"

@ -1,7 +1,7 @@
// Copyright 2022 The Gitea Authors. All rights reserved. // Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_17 // nolint package v1_17 //nolint
import ( import (
"code.gitea.io/gitea/models/pull" "code.gitea.io/gitea/models/pull"

@ -1,7 +1,7 @@
// Copyright 2022 The Gitea Authors. All rights reserved. // Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_17 // nolint package v1_17 //nolint
// This migration added non-ideal indices to the action table which on larger datasets slowed things down // This migration added non-ideal indices to the action table which on larger datasets slowed things down
// it has been superceded by v218.go // it has been superceded by v218.go

@ -1,7 +1,7 @@
// Copyright 2022 The Gitea Authors. All rights reserved. // Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_17 // nolint package v1_17 //nolint
import ( import (
"code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/setting"

@ -1,7 +1,7 @@
// Copyright 2022 The Gitea Authors. All rights reserved. // Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_17 // nolint package v1_17 //nolint
import ( import (
"code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/setting"

@ -1,7 +1,7 @@
// Copyright 2022 The Gitea Authors. All rights reserved. // Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_17 // nolint package v1_17 //nolint
import ( import (
"time" "time"

@ -1,7 +1,7 @@
// Copyright 2022 The Gitea Authors. All rights reserved. // Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_17 // nolint package v1_17 //nolint
import ( import (
packages_model "code.gitea.io/gitea/models/packages" packages_model "code.gitea.io/gitea/models/packages"

@ -1,7 +1,7 @@
// Copyright 2022 The Gitea Authors. All rights reserved. // Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_17 // nolint package v1_17 //nolint
import ( import (
"encoding/base32" "encoding/base32"

@ -1,7 +1,7 @@
// Copyright 2022 The Gitea Authors. All rights reserved. // Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_17 // nolint package v1_17 //nolint
import ( import (
"encoding/base32" "encoding/base32"

@ -1,7 +1,7 @@
// Copyright 2022 The Gitea Authors. All rights reserved. // Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_17 // nolint package v1_17 //nolint
import ( import (
"context" "context"

@ -1,7 +1,7 @@
// Copyright 2022 The Gitea Authors. All rights reserved. // Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_17 // nolint package v1_17 //nolint
import ( import (
"context" "context"

@ -1,7 +1,7 @@
// Copyright 2021 The Gitea Authors. All rights reserved. // Copyright 2021 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_18 // nolint package v1_18 //nolint
import ( import (
"testing" "testing"

@ -1,7 +1,7 @@
// Copyright 2022 The Gitea Authors. All rights reserved. // Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_18 // nolint package v1_18 //nolint
import ( import (
"xorm.io/xorm" "xorm.io/xorm"

@ -1,7 +1,7 @@
// Copyright 2022 The Gitea Authors. All rights reserved. // Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_18 // nolint package v1_18 //nolint
import ( import (
"code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/setting"

@ -1,7 +1,7 @@
// Copyright 2022 The Gitea Authors. All rights reserved. // Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_18 // nolint package v1_18 //nolint
import ( import (
"xorm.io/builder" "xorm.io/builder"

@ -1,7 +1,7 @@
// Copyright 2022 The Gitea Authors. All rights reserved. // Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_18 // nolint package v1_18 //nolint
import ( import (
"fmt" "fmt"

@ -1,7 +1,7 @@
// Copyright 2022 The Gitea Authors. All rights reserved. // Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_18 // nolint package v1_18 //nolint
import ( import (
"code.gitea.io/gitea/modules/timeutil" "code.gitea.io/gitea/modules/timeutil"

@ -1,7 +1,7 @@
// Copyright 2022 The Gitea Authors. All rights reserved. // Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_18 // nolint package v1_18 //nolint
import ( import (
"xorm.io/xorm" "xorm.io/xorm"

@ -1,7 +1,7 @@
// Copyright 2021 The Gitea Authors. All rights reserved. // Copyright 2021 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_19 // nolint package v1_19 //nolint
import ( import (
"testing" "testing"

@ -1,7 +1,7 @@
// Copyright 2022 The Gitea Authors. All rights reserved. // Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_19 // nolint package v1_19 //nolint
import ( import (
"code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/setting"

@ -1,7 +1,7 @@
// Copyright 2018 The Gitea Authors. All rights reserved. // Copyright 2018 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_6 // nolint package v1_6 //nolint
import ( import (
"fmt" "fmt"

@ -1,7 +1,7 @@
// Copyright 2018 The Gitea Authors. All rights reserved. // Copyright 2018 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_6 // nolint package v1_6 //nolint
import ( import (
"fmt" "fmt"

@ -1,7 +1,7 @@
// Copyright 2018 The Gitea Authors. All rights reserved. // Copyright 2018 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_6 // nolint package v1_6 //nolint
import ( import (
"fmt" "fmt"

@ -1,7 +1,7 @@
// Copyright 2018 The Gitea Authors. All rights reserved. // Copyright 2018 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_7 // nolint package v1_7 //nolint
import ( import (
"xorm.io/xorm" "xorm.io/xorm"

@ -1,7 +1,7 @@
// Copyright 2018 The Gitea Authors. All rights reserved. // Copyright 2018 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_7 // nolint package v1_7 //nolint
import "xorm.io/xorm" import "xorm.io/xorm"

@ -1,7 +1,7 @@
// Copyright 2018 The Gitea Authors. All rights reserved. // Copyright 2018 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_7 // nolint package v1_7 //nolint
import ( import (
"xorm.io/builder" "xorm.io/builder"

@ -1,7 +1,7 @@
// Copyright 2018 The Gitea Authors. All rights reserved. // Copyright 2018 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_8 // nolint package v1_8 //nolint
import ( import (
"fmt" "fmt"

@ -1,7 +1,7 @@
// Copyright 2019 The Gitea Authors. All rights reserved. // Copyright 2019 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_8 // nolint package v1_8 //nolint
import ( import (
"xorm.io/xorm" "xorm.io/xorm"

@ -1,7 +1,7 @@
// Copyright 2019 The Gitea Authors. All rights reserved. // Copyright 2019 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_8 // nolint package v1_8 //nolint
import ( import (
"code.gitea.io/gitea/models/migrations/base" "code.gitea.io/gitea/models/migrations/base"

@ -1,7 +1,7 @@
// Copyright 2019 The Gitea Authors. All rights reserved. // Copyright 2019 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_8 // nolint package v1_8 //nolint
import ( import (
"code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/setting"

@ -1,7 +1,7 @@
// Copyright 2019 The Gitea Authors. All rights reserved. // Copyright 2019 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_8 // nolint package v1_8 //nolint
import "xorm.io/xorm" import "xorm.io/xorm"

@ -1,7 +1,7 @@
// Copyright 2019 The Gitea Authors. All rights reserved. // Copyright 2019 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_8 // nolint package v1_8 //nolint
import ( import (
"fmt" "fmt"

@ -1,7 +1,7 @@
// Copyright 2019 The Gitea Authors. All rights reserved. // Copyright 2019 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package v1_9 // nolint package v1_9 //nolint
import ( import (
"fmt" "fmt"

@ -239,7 +239,7 @@ func (counts runeCountType) needsEscape() bool {
type runeType int type runeType int
const ( const (
basicASCIIRuneType runeType = iota //nolint // <- This is technically deadcode but its self-documenting so it should stay basicASCIIRuneType runeType = iota // <- This is technically deadcode but its self-documenting so it should stay
brokenRuneType brokenRuneType
nonBasicASCIIRuneType nonBasicASCIIRuneType
ambiguousRuneType ambiguousRuneType

@ -6,7 +6,7 @@ package log
import "unsafe" import "unsafe"
//go:linkname runtime_getProfLabel runtime/pprof.runtime_getProfLabel //go:linkname runtime_getProfLabel runtime/pprof.runtime_getProfLabel
func runtime_getProfLabel() unsafe.Pointer // nolint func runtime_getProfLabel() unsafe.Pointer //nolint
type labelMap map[string]string type labelMap map[string]string

@ -941,7 +941,7 @@ func loadFromConf(allowEmpty bool, extraConfig string) {
if SecretKey == "" { if SecretKey == "" {
// FIXME: https://github.com/go-gitea/gitea/issues/16832 // FIXME: https://github.com/go-gitea/gitea/issues/16832
// Until it supports rotating an existing secret key, we shouldn't move users off of the widely used default value // Until it supports rotating an existing secret key, we shouldn't move users off of the widely used default value
SecretKey = "!#@FDEWREWR&*(" // nolint:gosec SecretKey = "!#@FDEWREWR&*(" //nolint:gosec
} }
CookieRememberName = sec.Key("COOKIE_REMEMBER_NAME").MustString("gitea_incredible") CookieRememberName = sec.Key("COOKIE_REMEMBER_NAME").MustString("gitea_incredible")

@ -21,8 +21,10 @@ import (
) )
// https://peps.python.org/pep-0426/#name // https://peps.python.org/pep-0426/#name
var normalizer = strings.NewReplacer(".", "-", "_", "-") var (
var nameMatcher = regexp.MustCompile(`\A(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\.\-_]*[a-zA-Z0-9])\z`) normalizer = strings.NewReplacer(".", "-", "_", "-")
nameMatcher = regexp.MustCompile(`\A(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\.\-_]*[a-zA-Z0-9])\z`)
)
// https://peps.python.org/pep-0440/#appendix-b-parsing-version-strings-with-regular-expressions // https://peps.python.org/pep-0440/#appendix-b-parsing-version-strings-with-regular-expressions
var versionMatcher = regexp.MustCompile(`\Av?` + var versionMatcher = regexp.MustCompile(`\Av?` +

Loading…
Cancel
Save