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/go.mod b/go.mod index 362c61861eed..abf1aef756d0 100644 --- a/go.mod +++ b/go.mod @@ -125,7 +125,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= 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,