From cb846bbbd28be5311783e7253c3376b4530c10da Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 4 Apr 2025 01:06:33 +0000 Subject: [PATCH 1/3] build(deps): bump go-simpler.org/sloglint from 0.9.0 to 0.10.0 Bumps [go-simpler.org/sloglint](https://github.com/go-simpler/sloglint) from 0.9.0 to 0.10.0. - [Release notes](https://github.com/go-simpler/sloglint/releases) - [Changelog](https://github.com/go-simpler/sloglint/blob/main/.goreleaser.yml) - [Commits](https://github.com/go-simpler/sloglint/compare/v0.9.0...v0.10.0) --- updated-dependencies: - dependency-name: go-simpler.org/sloglint dependency-version: 0.10.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 4 +++- go.sum | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 362c61861eed..36c3abb87ffe 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,8 @@ module github.com/golangci/golangci-lint/v2 go 1.23.0 +toolchain go1.24.1 + require ( 4d63.com/gocheckcompilerdirectives v1.3.0 4d63.com/gochecknoglobals v0.2.2 @@ -125,7 +127,7 @@ require ( github.com/ykadowak/zerologlint v0.1.5 gitlab.com/bosi/decorder v0.4.2 go-simpler.org/musttag v0.13.0 - go-simpler.org/sloglint v0.9.0 + go-simpler.org/sloglint v0.10.0 go.uber.org/automaxprocs v1.6.0 golang.org/x/mod v0.24.0 golang.org/x/sys v0.31.0 diff --git a/go.sum b/go.sum index 68b4c3401cc7..564186f8d411 100644 --- a/go.sum +++ b/go.sum @@ -626,8 +626,8 @@ go-simpler.org/assert v0.9.0 h1:PfpmcSvL7yAnWyChSjOz6Sp6m9j5lyK8Ok9pEL31YkQ= go-simpler.org/assert v0.9.0/go.mod h1:74Eqh5eI6vCK6Y5l3PI8ZYFXG4Sa+tkr70OIPJAUr28= go-simpler.org/musttag v0.13.0 h1:Q/YAW0AHvaoaIbsPj3bvEI5/QFP7w696IMUpnKXQfCE= go-simpler.org/musttag v0.13.0/go.mod h1:FTzIGeK6OkKlUDVpj0iQUXZLUO1Js9+mvykDQy9C5yM= -go-simpler.org/sloglint v0.9.0 h1:/40NQtjRx9txvsB/RN022KsUJU+zaaSb/9q9BSefSrE= -go-simpler.org/sloglint v0.9.0/go.mod h1:G/OrAF6uxj48sHahCzrbarVMptL2kjWTaUeC8+fOGww= +go-simpler.org/sloglint v0.10.0 h1:wrW6kIuFLDZ7rW0tKRmUX5uklauXNo5+HKwjwmeNVvg= +go-simpler.org/sloglint v0.10.0/go.mod h1:CFDO8R1i77dlciGfPEPvYke2ZMx4eyGiEIWkyeW2Pvw= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= From 9617970b9c14558ac4ea015632a6012ee6e574a7 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Fri, 4 Apr 2025 03:13:08 +0200 Subject: [PATCH 2/3] chore: clean --- go.mod | 2 -- 1 file changed, 2 deletions(-) diff --git a/go.mod b/go.mod index 36c3abb87ffe..abf1aef756d0 100644 --- a/go.mod +++ b/go.mod @@ -2,8 +2,6 @@ module github.com/golangci/golangci-lint/v2 go 1.23.0 -toolchain go1.24.1 - require ( 4d63.com/gocheckcompilerdirectives v1.3.0 4d63.com/gochecknoglobals v0.2.2 From 0064d9706b49ee333853a65039649cc1f1878d3f Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Fri, 4 Apr 2025 03:25:38 +0200 Subject: [PATCH 3/3] chore: update implementation --- .golangci.next.reference.yml | 7 ++++++- jsonschema/golangci.next.jsonschema.json | 5 +++++ pkg/config/linters_settings.go | 1 + pkg/golinters/sloglint/sloglint.go | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.golangci.next.reference.yml b/.golangci.next.reference.yml index 144550b4b25d..0e9eb6276c52 100644 --- a/.golangci.next.reference.yml +++ b/.golangci.next.reference.yml @@ -2722,11 +2722,16 @@ linters: # https://github.com/go-simpler/sloglint?tab=readme-ov-file#static-messages # Default: false static-msg: true + # Enforce message style. + # Values: lowercased, capitalized + # https://github.com/go-simpler/sloglint?tab=readme-ov-file#message-style + # Default: "" + msg-style: capitalized # Enforce using constants instead of raw keys. # https://github.com/go-simpler/sloglint?tab=readme-ov-file#no-raw-keys # Default: false no-raw-keys: true - # Enforce a single key naming convention. + # Enforce key naming convention. # Values: snake, kebab, camel, pascal # https://github.com/go-simpler/sloglint?tab=readme-ov-file#key-naming-convention # Default: "" diff --git a/jsonschema/golangci.next.jsonschema.json b/jsonschema/golangci.next.jsonschema.json index dedbf8676bb2..1a056b9c4fcb 100644 --- a/jsonschema/golangci.next.jsonschema.json +++ b/jsonschema/golangci.next.jsonschema.json @@ -2962,6 +2962,11 @@ "type": "boolean", "default": false }, + "msg-style": { + "description": "Enforce message style.", + "enum": ["", "lowercased", "capitalized"], + "default": false + }, "key-naming-case": { "description": "Enforce a single key naming convention.", "enum": ["snake", "kebab", "camel", "pascal"] diff --git a/pkg/config/linters_settings.go b/pkg/config/linters_settings.go index 45109fe4b088..046645e40f98 100644 --- a/pkg/config/linters_settings.go +++ b/pkg/config/linters_settings.go @@ -784,6 +784,7 @@ type SlogLintSettings struct { NoGlobal string `mapstructure:"no-global"` Context string `mapstructure:"context"` StaticMsg bool `mapstructure:"static-msg"` + MsgStyle string `mapstructure:"msg-style"` NoRawKeys bool `mapstructure:"no-raw-keys"` KeyNamingCase string `mapstructure:"key-naming-case"` ForbiddenKeys []string `mapstructure:"forbidden-keys"` diff --git a/pkg/golinters/sloglint/sloglint.go b/pkg/golinters/sloglint/sloglint.go index 01e75e44ab48..021157dd66b7 100644 --- a/pkg/golinters/sloglint/sloglint.go +++ b/pkg/golinters/sloglint/sloglint.go @@ -18,6 +18,7 @@ func New(settings *config.SlogLintSettings) *goanalysis.Linter { NoGlobal: settings.NoGlobal, ContextOnly: settings.Context, StaticMsg: settings.StaticMsg, + MsgStyle: settings.MsgStyle, NoRawKeys: settings.NoRawKeys, KeyNamingCase: settings.KeyNamingCase, ForbiddenKeys: settings.ForbiddenKeys,