Skip to content

Commit e96d5a2

Browse files
authored
chore(deps): Update dependency golangci/golangci-lint to v2 (#331)
This PR contains the following updates: | Package | Update | Change | Pending | |---|---|---|---| | [golangci/golangci-lint](https://redirect.github.com/golangci/golangci-lint) | major | `v1.64.8` -> `v2.1.5` | `v2.1.6` | --- ### Release Notes <details> <summary>golangci/golangci-lint (golangci/golangci-lint)</summary> ### [`v2.1.5`](https://redirect.github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v215) [Compare Source](https://redirect.github.com/golangci/golangci-lint/compare/v2.1.4...v2.1.5) Due to an error related to Snapcraft, some artifacts of the v2.1.4 release have not been published. This release contains the same things as v2.1.3. ### [`v2.1.4`](https://redirect.github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v214) [Compare Source](https://redirect.github.com/golangci/golangci-lint/compare/v2.1.3...v2.1.4) Due to an error related to Snapcraft, some artifacts of the v2.1.3 release have not been published. This release contains the same things as v2.1.3. ### [`v2.1.3`](https://redirect.github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v213) [Compare Source](https://redirect.github.com/golangci/golangci-lint/compare/v2.1.2...v2.1.3) 1. Linters bug fixes - `fatcontext`: from 0.7.2 to 0.8.0 2. Misc. - migration: fix `nakedret.max-func-lines: 0` - migration: fix order of `staticcheck` settings - fix: add `go.mod` hash to the cache salt - fix: use diagnostic position for related information position ### [`v2.1.2`](https://redirect.github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v212) [Compare Source](https://redirect.github.com/golangci/golangci-lint/compare/v2.1.1...v2.1.2) 1. Linters bug fixes - `exptostd`: from 0.4.2 to 0.4.3 - `gofumpt`: from 0.7.0 to 0.8.0 - `protogetter`: from 0.3.13 to 0.3.15 - `usetesting`: from 0.4.2 to 0.4.3 ### [`v2.1.1`](https://redirect.github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v211) [Compare Source](https://redirect.github.com/golangci/golangci-lint/compare/v2.1.0...v2.1.1) The release process of v2.1.0 failed due to a regression inside goreleaser. The binaries of v2.1.0 have been published, but not the other artifacts (AUR, Docker, etc.). ### [`v2.1.0`](https://redirect.github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v210) [Compare Source](https://redirect.github.com/golangci/golangci-lint/compare/v2.0.2...v2.1.0) 1. Enhancements - Add an option to display absolute paths (`--path-mode=abs`) - Add configuration path placeholder (`${config-path}`) - Add `warn-unused` option for `fmt` command - Colored diff for `fmt` command (`golangci-lint fmt --diff-colored`) 2. New linters - Add `funcorder` linter https://github.com/manuelarte/funcorder 3. Linters new features or changes - `go-errorlint`: from 1.7.1 to 1.8.0 (automatic error comparison and type assertion fixes) - ⚠️ `goconst`: `ignore-strings` is deprecated and replaced by `ignore-string-values` - `goconst`: from 1.7.1 to 1.8.1 (new options: `find-duplicates`, `eval-const-expressions`) - `govet`: add `httpmux` analyzer - `nilnesserr`: from 0.1.2 to 0.2.0 (detect more cases) - `paralleltest`: from 1.0.10 to 1.0.14 (checks only `_test.go` files) - `revive`: from 1.7.0 to 1.9.0 (support kebab case for setting names) - `sloglint`: from 0.9.0 to 0.11.0 (autofix, new option `msg-style`, suggest `slog.DiscardHandler`) - `wrapcheck`: from 2.10.0 to 2.11.0 (new option `report-internal-errors`) - `wsl`: from 4.6.0 to 4.7.0 (cgo files are always excluded) 4. Linters bug fixes - `fatcontext`: from 0.7.1 to 0.7.2 - `gocritic`: fix `importshadow` checker - `gosec`: from 2.22.2 to 2.22.3 - `ireturn`: from 0.3.1 to 0.4.0 - `loggercheck`: from 0.10.1 to 0.11.0 - `nakedret`: from 2.0.5 to 2.0.6 - `nonamedreturns`: from 1.0.5 to 1.0.6 - `protogetter`: from 0.3.12 to 0.3.13 - `testifylint`: from 1.6.0 to 1.6.1 - `unconvert`: update to HEAD 5. Misc. - Fixes memory leaks when using go1.(N) with golangci-lint built with go1.(N-X) - Adds `golangci-lint-fmt` pre-commit hook 6. Documentation - Improvements - Updates section about vscode integration ### [`v2.0.2`](https://redirect.github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v202) [Compare Source](https://redirect.github.com/golangci/golangci-lint/compare/v2.0.1...v2.0.2) 1. Misc. - Fixes flags parsing for formatters - Fixes the filepath used by the exclusion `source` option 2. Documentation - Adds a section about flags migration - Cleaning pages with v1 options ### [`v2.0.1`](https://redirect.github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v201) [Compare Source](https://redirect.github.com/golangci/golangci-lint/compare/v2.0.0...v2.0.1) 1. Linters/formatters bug fixes - `golines`: fix settings during linter load 2. Misc. - Validates the `version` field before the configuration - `forbidigo`: fix migration ### [`v2.0.0`](https://redirect.github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v200) [Compare Source](https://redirect.github.com/golangci/golangci-lint/compare/v1.64.8...v2.0.0) 1. Enhancements - 🌟 New `golangci-lint fmt` command with dedicated [formatter configuration](https://golangci-lint.run/welcome/quick-start/#formatting) - ♻️ New `golangci-lint migrate` command to help migration from v1 to v2 (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/#command-migrate)) - ⚠️ New default values (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/)) - ⚠️ No exclusions by default (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/#issuesexclude-use-default)) - ⚠️ New default sort order (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/#outputsort-order)) - 🌟 New option `run.relative-path-mode` (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/#runrelative-path-mode)) - 🌟 New linters configuration (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/#linters)) - 🌟 New output format configuration (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/#output)) - 🌟 New `--fast-only` flag (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/#lintersfast)) - 🌟 New option `linters.exclusions.warn-unused` to log a warning if an exclusion rule is unused. 2. New linters/formatters - Add `golines` formatter https://github.com/segmentio/golines 3. Linters new features - ⚠️ Merge `staticcheck`, `stylecheck`, `gosimple` into one linter (`staticcheck`) (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/#lintersenablestylecheckgosimplestaticcheck)) - `go-critic`: from 0.12.0 to 0.13.0 - `gomodguard`: from 1.3.5 to 1.4.1 (block explicit indirect dependencies) - `nilnil`: from 1.0.1 to 1.1.0 (new option: `only-two`) - `perfsprint`: from 0.8.2 to 0.9.1 (checker name in the diagnostic message) - `staticcheck`: new `quickfix` set of rules - `testifylint`: from 1.5.2 to 1.6.0 (new options: `equal-values`, `suite-method-signature`, `require-string-msg`) - `wsl`: from 4.5.0 to 4.6.0 (new option: `allow-cuddle-used-in-block`) 4. Linters bug fixes - `bidichk`: from 0.3.2 to 0.3.3 - `errchkjson`: from 0.4.0 to 0.4.1 - `errname`: from 1.0.0 to 1.1.0 - `funlen`: fix `ignore-comments` option - `gci`: from 0.13.5 to 0.13.6 - `gosmopolitan`: from 1.2.2 to 1.3.0 - `inamedparam`: from 0.1.3 to 0.2.0 - `intrange`: from 0.3.0 to 0.3.1 - `protogetter`: from 0.3.9 to 0.3.12 - `unparam`: from [`8a5130c`](https://redirect.github.com/golangci/golangci-lint/commit/8a5130ca722f) to [`0df0534`](https://redirect.github.com/golangci/golangci-lint/commit/0df0534333a4) 5. Misc. - 🧹 Configuration options renaming (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/)) - 🧹 Remove options (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/)) - 🧹 Remove flags (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/)) - 🧹 Remove alternative names (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/#alternative-linter-names)) - 🧹 Remove or replace deprecated elements (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/)) - Adds an option to display some commands as JSON: - `golangci-lint config path --json` - `golangci-lint help linters --json` - `golangci-lint help formatters --json` - `golangci-lint linters --json` - `golangci-lint formatters --json` - `golangci-lint version --json` 6. Documentation - [Migration guide](https://golangci-lint.run/product/migration-guide/) </details> --- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM, on day 1 of the month ( * 0-3 1 * * ) (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://redirect.github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yNjQuMCIsInVwZGF0ZWRJblZlciI6IjM5LjI2NC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
1 parent ec71147 commit e96d5a2

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

.github/workflows/lint_golang.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
go-version-file: go.mod
1919
cache: true
2020
- name: golangci-lint
21-
uses: golangci/golangci-lint-action@v6
21+
uses: golangci/golangci-lint-action@v7
2222
with:
23-
version: v1.64.8
23+
version: v2.1.5
2424
args: --verbose

interfaces/generate_test.go

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,11 @@ func TestGenerate(t *testing.T) {
144144
if err != nil {
145145
t.Fatalf("failed to open file: %v", err)
146146
}
147-
defer f.Close()
147+
defer func() {
148+
if err := f.Close(); err != nil {
149+
t.Fatalf("failed to close file: %v", err)
150+
}
151+
}()
148152
b, err := io.ReadAll(f)
149153
if err != nil {
150154
t.Fatalf("failed to read file: %v", err)
@@ -169,7 +173,11 @@ func TestGenerateMultipleClientsSamePackage(t *testing.T) {
169173
if err != nil {
170174
t.Fatalf("failed to open file: %v", err)
171175
}
172-
defer f.Close()
176+
defer func() {
177+
if err := f.Close(); err != nil {
178+
t.Fatalf("failed to close file: %v", err)
179+
}
180+
}()
173181
b, err := io.ReadAll(f)
174182
if err != nil {
175183
t.Fatalf("failed to read file: %v", err)
@@ -194,7 +202,11 @@ func TestGenerateNonV1(t *testing.T) {
194202
if err != nil {
195203
t.Fatalf("failed to open file: %v", err)
196204
}
197-
defer f.Close()
205+
defer func() {
206+
if err := f.Close(); err != nil {
207+
t.Fatalf("failed to close file: %v", err)
208+
}
209+
}()
198210
b, err := io.ReadAll(f)
199211
if err != nil {
200212
t.Fatalf("failed to read file: %v", err)
@@ -225,7 +237,11 @@ func TestGenerateOverlappingPackageNames(t *testing.T) {
225237
if err != nil {
226238
t.Fatalf("failed to open file: %v", err)
227239
}
228-
defer f.Close()
240+
defer func() {
241+
if err := f.Close(); err != nil {
242+
t.Fatalf("failed to close file: %v", err)
243+
}
244+
}()
229245
b, err := io.ReadAll(f)
230246
if err != nil {
231247
t.Fatalf("failed to read file: %v", err)

0 commit comments

Comments
 (0)