Merge pull request 'Update golangci-lint to 1.57.2' (#3163) from wetneb/forgejo:3162-update-golangci-lint into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3163 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Reviewed-by: Gusted <gusted@noreply.codeberg.org>
This commit is contained in:
commit
6053dc624f
2
Makefile
2
Makefile
|
@ -29,7 +29,7 @@ XGO_VERSION := go-1.21.x
|
||||||
AIR_PACKAGE ?= github.com/cosmtrek/air@v1.49.0 # renovate: datasource=go
|
AIR_PACKAGE ?= github.com/cosmtrek/air@v1.49.0 # renovate: datasource=go
|
||||||
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@2.7.0 # renovate: datasource=go
|
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@2.7.0 # renovate: datasource=go
|
||||||
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.6.0 # renovate: datasource=go
|
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.6.0 # renovate: datasource=go
|
||||||
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.56.1 # renovate: datasource=go
|
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.57.2 # renovate: datasource=go
|
||||||
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.11 # renovate: datasource=go
|
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.11 # renovate: datasource=go
|
||||||
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/misspell@v0.4.1 # renovate: datasource=go
|
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/misspell@v0.4.1 # renovate: datasource=go
|
||||||
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.30.6-0.20240201115257-bcc7c78b7786 # renovate: datasource=go
|
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.30.6-0.20240201115257-bcc7c78b7786 # renovate: datasource=go
|
||||||
|
|
|
@ -782,7 +782,7 @@ func writeFlushPktLine(ctx context.Context, out io.Writer) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write an Pkt-Line based on `data` to `out` according to the specifcation.
|
// Write an Pkt-Line based on `data` to `out` according to the specification.
|
||||||
// https://git-scm.com/docs/protocol-common
|
// https://git-scm.com/docs/protocol-common
|
||||||
func writeDataPktLine(ctx context.Context, out io.Writer, data []byte) error {
|
func writeDataPktLine(ctx context.Context, out io.Writer, data []byte) error {
|
||||||
// Implementations SHOULD NOT send an empty pkt-line ("0004").
|
// Implementations SHOULD NOT send an empty pkt-line ("0004").
|
||||||
|
|
|
@ -225,13 +225,13 @@ func TestGitAttributeCheckerError(t *testing.T) {
|
||||||
ac, err := gitRepo.GitAttributeChecker("", "linguist-language")
|
ac, err := gitRepo.GitAttributeChecker("", "linguist-language")
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
// calling CheckPath before would allow git to cache part of it and succesfully return later
|
// calling CheckPath before would allow git to cache part of it and successfully return later
|
||||||
assert.NoError(t, os.RemoveAll(gitRepo.Path))
|
assert.NoError(t, os.RemoveAll(gitRepo.Path))
|
||||||
|
|
||||||
_, err = ac.CheckPath("i-am-a-python.p")
|
_, err = ac.CheckPath("i-am-a-python.p")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Skip(
|
t.Skip(
|
||||||
"git check-attr started too fast and CheckPath was succesful (and likely cached)",
|
"git check-attr started too fast and CheckPath was successful (and likely cached)",
|
||||||
"https://codeberg.org/forgejo/forgejo/issues/2948",
|
"https://codeberg.org/forgejo/forgejo/issues/2948",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -391,7 +391,7 @@ func TestCommitMail(t *testing.T) {
|
||||||
t.Run("Upload", func(t *testing.T) {
|
t.Run("Upload", func(t *testing.T) {
|
||||||
defer tests.PrintCurrentTest(t)()
|
defer tests.PrintCurrentTest(t)()
|
||||||
|
|
||||||
// Upload two seperate times, so we have two different 'uploads' that can
|
// Upload two separate times, so we have two different 'uploads' that can
|
||||||
// be used indepently of each other.
|
// be used indepently of each other.
|
||||||
uploadFile := func(t *testing.T, name, content string) string {
|
uploadFile := func(t *testing.T, name, content string) string {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
|
|
|
@ -89,7 +89,7 @@ func TestDataSizeTranslation(t *testing.T) {
|
||||||
fullSize = noDigits.ReplaceAllString(fullSize, "")
|
fullSize = noDigits.ReplaceAllString(fullSize, "")
|
||||||
assert.Equal(t, "git: КиБ; lfs: Б", fullSize)
|
assert.Equal(t, "git: КиБ; lfs: Б", fullSize)
|
||||||
|
|
||||||
// Check if file sizes are correclty translated
|
// Check if file sizes are correctly translated
|
||||||
testFileSizeTranslated(t, session, path.Join(testUser, testRepoName, "src/branch/main/137byteFile.txt"), "137 Б")
|
testFileSizeTranslated(t, session, path.Join(testUser, testRepoName, "src/branch/main/137byteFile.txt"), "137 Б")
|
||||||
testFileSizeTranslated(t, session, path.Join(testUser, testRepoName, "src/branch/main/1.5kibFile.txt"), "1,5 КиБ")
|
testFileSizeTranslated(t, session, path.Join(testUser, testRepoName, "src/branch/main/1.5kibFile.txt"), "1,5 КиБ")
|
||||||
testFileSizeTranslated(t, session, path.Join(testUser, testRepoName, "src/branch/main/1.25mibFile.txt"), "1,3 МиБ")
|
testFileSizeTranslated(t, session, path.Join(testUser, testRepoName, "src/branch/main/1.25mibFile.txt"), "1,3 МиБ")
|
||||||
|
|
Loading…
Reference in New Issue