chore(deps): update golangci-lint to v2

This commit is contained in:
Julien Neuhart
2025-03-26 20:08:18 +01:00
parent e7c77b7bf3
commit 0b7c51a323
5 changed files with 42 additions and 38 deletions

1
.env
View File

@@ -7,7 +7,6 @@ GOTENBERG_USER_UID=1001
NOTO_COLOR_EMOJI_VERSION=v2.047 # See https://github.com/googlefonts/noto-emoji/releases. NOTO_COLOR_EMOJI_VERSION=v2.047 # See https://github.com/googlefonts/noto-emoji/releases.
PDFTK_VERSION=v3.3.3 # See https://gitlab.com/pdftk-java/pdftk/-/releases - Binary package. PDFTK_VERSION=v3.3.3 # See https://gitlab.com/pdftk-java/pdftk/-/releases - Binary package.
PDFCPU_VERSION=v0.8.1 # See https://github.com/pdfcpu/pdfcpu/releases. PDFCPU_VERSION=v0.8.1 # See https://github.com/pdfcpu/pdfcpu/releases.
GOLANGCI_LINT_VERSION=v1.64.2 # See https://github.com/golangci/golangci-lint/releases.
GOTENBERG_VERSION=snapshot GOTENBERG_VERSION=snapshot
DOCKERFILE=build/Dockerfile DOCKERFILE=build/Dockerfile
DOCKERFILE_CLOUDRUN=build/Dockerfile.cloudrun DOCKERFILE_CLOUDRUN=build/Dockerfile.cloudrun

View File

@@ -31,7 +31,7 @@ jobs:
- name: Run linters - name: Run linters
uses: golangci/golangci-lint-action@v6 uses: golangci/golangci-lint-action@v6
with: with:
version: v1.64.2 version: v2.0.2
lint-prettier: lint-prettier:
name: Lint non-Golang codebase name: Lint non-Golang codebase

View File

@@ -1,56 +1,65 @@
linters-settings: version: "2"
gci: run:
sections: issues-exit-code: 1
- standard tests: false
- default
- prefix(github.com/gotenberg/gotenberg/v8)
skip-generated: true
custom-order: true
linters: linters:
disable-all: true default: none
enable: enable:
- asasalint - asasalint
- asciicheck - asciicheck
- bidichk - bidichk
- bodyclose - bodyclose
- copyloopvar
- decorder - decorder
- dogsled - dogsled
- dupl - dupl
- dupword - dupword
- durationcheck - durationcheck
- copyloopvar
- errcheck - errcheck
- errname - errname
- exhaustive - exhaustive
- gci
- gofmt
- goimports
- gofumpt
- gosec - gosec
- gosimple
- govet - govet
- ineffassign
- importas - importas
- ineffassign
- misspell - misspell
- prealloc - prealloc
- promlinter - promlinter
#- sloglint
- staticcheck - staticcheck
- testableexamples - testableexamples
- tparallel - tparallel
- typecheck
- unconvert - unconvert
- unused - unused
- usetesting - usetesting
- wastedassign - wastedassign
- whitespace - whitespace
exclusions:
run: generated: lax
timeout: 5m presets:
issues-exit-code: 1 - comments
tests: false - common-false-positives
- legacy
output: - std-error-handling
print-issued-lines: true paths:
print-linter-name: true - third_party$
- builtin$
- examples$
formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports
settings:
gci:
sections:
- standard
- default
- prefix(github.com/gotenberg/gotenberg/v8)
custom-order: true
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$

View File

@@ -180,13 +180,9 @@ lint-prettier: ## Lint non-Golang codebase
lint-todo: ## Find TODOs in Golang codebase lint-todo: ## Find TODOs in Golang codebase
golangci-lint run --no-config --disable-all --enable godox golangci-lint run --no-config --disable-all --enable godox
# go install mvdan.cc/gofumpt@latest
# go install github.com/daixiang0/gci@latest
.PHONY: fmt .PHONY: fmt
fmt: ## Format Golang codebase and "optimize" the dependencies fmt: ## Format Golang codebase and "optimize" the dependencies
gofumpt -l -w . golangci-lint fmt
gci write -s standard -s default -s "prefix(github.com/gotenberg/gotenberg/v8)" --skip-generated --skip-vendor --custom-order .
go mod tidy
.PHONY: prettify .PHONY: prettify
prettify: ## Format non-Golang codebase prettify: ## Format non-Golang codebase

View File

@@ -83,7 +83,7 @@ func (ctx *ContextMock) SetLogger(logger *zap.Logger) {
// ctx := &api.ContextMock{Context: &api.Context{}} // ctx := &api.ContextMock{Context: &api.Context{}}
// ctx.setEchoContext(c) // ctx.setEchoContext(c)
func (ctx *ContextMock) SetEchoContext(c echo.Context) { func (ctx *ContextMock) SetEchoContext(c echo.Context) {
ctx.Context.echoCtx = c ctx.echoCtx = c
} }
// SetMkdirAll sets the [gotenberg.MkdirAll]. // SetMkdirAll sets the [gotenberg.MkdirAll].
@@ -91,7 +91,7 @@ func (ctx *ContextMock) SetEchoContext(c echo.Context) {
// ctx := &api.ContextMock{Context: &api.Context{}} // ctx := &api.ContextMock{Context: &api.Context{}}
// ctx.SetMkdirAll(mkdirAll) // ctx.SetMkdirAll(mkdirAll)
func (ctx *ContextMock) SetMkdirAll(mkdirAll gotenberg.MkdirAll) { func (ctx *ContextMock) SetMkdirAll(mkdirAll gotenberg.MkdirAll) {
ctx.Context.mkdirAll = mkdirAll ctx.mkdirAll = mkdirAll
} }
// SetPathRename sets the [gotenberg.PathRename]. // SetPathRename sets the [gotenberg.PathRename].
@@ -99,7 +99,7 @@ func (ctx *ContextMock) SetMkdirAll(mkdirAll gotenberg.MkdirAll) {
// ctx := &api.ContextMock{Context: &api.Context{}} // ctx := &api.ContextMock{Context: &api.Context{}}
// ctx.setPathRename(rename) // ctx.setPathRename(rename)
func (ctx *ContextMock) SetPathRename(rename gotenberg.PathRename) { func (ctx *ContextMock) SetPathRename(rename gotenberg.PathRename) {
ctx.Context.pathRename = rename ctx.pathRename = rename
} }
// RouterMock is a mock for the [Router] interface. // RouterMock is a mock for the [Router] interface.