Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps): update dependency staticcheck to v2024 (#2425)
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [staticcheck](https://togithub.com/dominikh/go-tools) | major | `2023.1.7` -> `2024.1.1` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>dominikh/go-tools (staticcheck)</summary> ### [`v2024.1.1`](https://togithub.com/dominikh/go-tools/releases/tag/2024.1.1): Staticcheck 2024.1.1 (v0.5.1) [Compare Source](https://togithub.com/dominikh/go-tools/compare/2024.1...2024.1.1) This release fixes the detection of the used Go version when Go was compiled with experimental features such as `rangefunc` or `boringcrypto` ([#​1586](https://togithub.com/dominikh/go-tools/issues/1586)). ### [`v2024.1`](https://togithub.com/dominikh/go-tools/releases/tag/2024.1): Staticcheck 2024.1 (v0.5.0) [Compare Source](https://togithub.com/dominikh/go-tools/compare/2023.1.7...2024.1) ### Backwards incompatible changes Staticcheck 2024.1 contains the following backwards incompatible changes: - The `keyify` utility has been removed. The recommended alternative is gopls. - `staticcheck -merge` now exits with a non-zero status if any problems have been found. ### Improved Go 1.22 support This release updates Staticcheck’s database of deprecated standard library APIs to cover the Go 1.22 release. Furthermore, checks have been updated to correctly handle the new “for” loop variable scoping behavior as well as ranging over integers. ### Added Go 1.23 support Staticcheck 2024.1 has full support for iterators / range-over-func. Furthermore, [SA1015](https://staticcheck.dev/docs/checks/#SA1015) will skip any code targeting Go 1.23 or newer, as it is now possible to use `time.Tick` without leaking memory. ### Improved handling of Go versions Go 1.21 more rigorously defined the meaning of the `go` directive in `go.mod` files, as well as its interactions with `//go:build go1.N` build constraints. The go directive now specifies a minimum Go version for the module. Furthermore, it sets the language version that is in effect, which may change the semantics of Go code. For example, before Go 1.22, loop variables were reused across iterations, but since Go 1.22, loop variables only exist for the duration of an iteration. Modules that specify `go 1.22` will use the new semantics, while modules that specify an older version will not. Individual files can both upgrade and downgrade their language version by using `//go:build go1.N` directives. In a module that requires Go 1.22, a file specifying Go 1.21 will experience the old loop variable semantics, and vice versa. Because the Go module as a whole still specifies a minimum version, even files specifying an older version will have access to the standard library of the minimum version. Staticcheck 2024.1 takes all of this into consideration when analyzing the behavior of Go code, when determining which checks are applicable, and when making suggestions. Older versions of Staticcheck were already aware of Go versions, but 2024.1 works on a more fine-grained, per-file basis, and differentiates between the pre- and post-1.21 semantics of the go directive. The `-go` command line flag continues to exist. It will override any module-based version selection. This is primarily useful for Go modules that target older Go versions (because here, the go directive didn’t specify a minimum version), or when working outside of Go modules. To prevent misinterpreting code, Staticcheck now refuses to analyze modules that require a version of Go that is newer than that with which Staticcheck was built. ### Checks #### New checks The following checks have been added: - [SA1031](https://staticcheck.dev/docs/checks/#SA1031) flags overlapping destination and source slices passed to certain encoding functions. - [SA1032](https://staticcheck.dev/docs/checks/#SA1032) flags calls to [`errors.Is`](https://pkg.go.dev/errors#Is) where the two arguments have been swapped. - [SA4032](https://staticcheck.dev/docs/checks/#SA4032) flags impossible comparisons of [runtime.GOOS](https://pkg.go.dev/runtime#GOOS) and [runtime.GOARCH](https://pkg.go.dev/runtime#GOARCH) based on the file’s build tags. - [SA6006](https://staticcheck.dev/docs/checks/#SA6006) flags `io.WriteString(w, string(b))` as it would be both simpler and more efficient to use `w.Write(b)`. - [SA9009](https://staticcheck.dev/docs/checks/#SA9009) flags comments that look like they intend to be compiler directives but which aren’t due to extraneous whitespace. #### Changed checks The following checks have been improved: - [QF1001](https://staticcheck.dev/docs/checks/#QF1001) no longer panics on expressions involving “key: value” pairs ([issue 1484](https://staticcheck.dev/issues/1484)). - [S1008](https://staticcheck.dev/docs/checks/#S1008) now understands that some built-in functions never return negative values. For example, it now negates `len(x) > 0` as `len(x) == 0` ([issue 1422](https://staticcheck.dev/issues/1422)). - [S1009](https://staticcheck.dev/docs/checks/#S1009) now flags unnecessary nil checks that involve selector expressions ([issue 1527](https://staticcheck.dev/issues/1527)). - [S1017](https://staticcheck.dev/docs/checks/#S1017) no longer flags `if else` branches ([issue 1447](https://staticcheck.dev/issues/1447)). - [SA1006](https://staticcheck.dev/docs/checks/#SA1006) now detects more Printf-like functions from the standard library ([issue 1528](https://staticcheck.dev/issues/1528)). - [SA1015](https://staticcheck.dev/docs/checks/#SA1015) now skips any code targeting Go 1.23 or newer ([issue 1558](https://staticcheck.dev/issues/1558)). - [SA1029](https://staticcheck.dev/docs/checks/#SA1029) now flags uses of the empty struct (`struct{}`) as context keys ([issue 1504](https://staticcheck.dev/issues/1504)). - [SA4003](https://staticcheck.dev/docs/checks/#SA4003) now flags pointless integer comparisons that involve literals, not just constants from the `math` package ([issue 1470](https://staticcheck.dev/issues/1470)). - [SA4015](https://staticcheck.dev/docs/checks/#SA4015) now supports conversions that involve generics. - [SA4023](https://staticcheck.dev/docs/checks/#SA4023) no longer panics on type sets that contain arrays ([issue 1397](https://staticcheck.dev/issues/1397)). - [SA5001](https://staticcheck.dev/docs/checks/#SA5001) now emits a clearer message ([issue 1489](https://staticcheck.dev/issues/1489)). - [SA9003](https://staticcheck.dev/docs/checks/#SA9003) has been disabled by default because of too many noisy positives ([issue 321](https://staticcheck.dev/issues/321)). - [ST1000](https://staticcheck.dev/docs/checks/#ST1000) now permits punctuation following the package name, as in “Package pkg, which …” ([issue 1452](https://staticcheck.dev/issues/1452)). - [ST1018](https://staticcheck.dev/docs/checks/#ST1018) now accepts variation selectors in emoji and certain Arabic formatting characters in string literals ([issue 1456](https://staticcheck.dev/issues/1456)). - [ST1020](https://staticcheck.dev/docs/checks/#ST1020) no longer flags comments that start with a deprecation notice ([issue 1378](https://staticcheck.dev/issues/1378)). - [U1000](https://staticcheck.dev/docs/checks/#U1000) handles generic interfaces slightly better, reducing the number of false positives. - Due to improvements in the intermediate representation, various checks may now detect more problems. ### Miscellaneous changes and fixes - The `keyify` utility has been deleted. This functionality is provided by gopls nowadays. - `staticcheck -merge` now exits with a non-zero exit status if any problems were found. This matches the behavior of non-merge uses. - Malformed `staticcheck.conf` files now cause more useful errors to be emitted. - Labeled statements with blank labels no longer cause panics. - Functions with named return parameters that never actually return no longer cause panics ([issue 1533](https://staticcheck.dev/issues/1533)). </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on Monday" (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 was generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View the [repository job log](https://developer.mend.io/github/TBD54566975/ftl). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguMjYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
- Loading branch information