Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .golangci.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1855,10 +1855,13 @@ linters-settings:
- github.com/jmoiron/sqlx

sloglint:
# Enforce using key-value pairs only (incompatible with attr-only).
# Enforce not mixing key-value pairs and attributes.
# Default: true
no-mixed-args: false
# Enforce using key-value pairs only (overrides no-mixed-args, incompatible with attr-only).
# Default: false
kv-only: true
# Enforce using attributes only (incompatible with kv-only).
# Enforce using attributes only (overrides no-mixed-args, incompatible with kv-only).
# Default: false
attr-only: true
# Enforce using methods that accept a context.
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ require (
github.com/ykadowak/zerologlint v0.1.5
gitlab.com/bosi/decorder v0.4.1
go-simpler.org/musttag v0.8.0
go-simpler.org/sloglint v0.3.0
go-simpler.org/sloglint v0.4.0
golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea
golang.org/x/tools v0.16.1
gopkg.in/yaml.v3 v3.0.1
Expand All @@ -138,7 +138,7 @@ require (
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/chavacava/garif v0.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/ettle/strcase v0.1.1 // indirect
github.com/ettle/strcase v0.2.0 // indirect
github.com/fatih/structtag v1.2.0 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/config/linters_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ var defaultLintersSettings = LintersSettings{
Qualified: false,
},
SlogLint: SlogLintSettings{
NoMixedArgs: true,
KVOnly: false,
AttrOnly: false,
ContextOnly: false,
Expand Down Expand Up @@ -753,6 +754,7 @@ type RowsErrCheckSettings struct {
}

type SlogLintSettings struct {
NoMixedArgs bool `mapstructure:"no-mixed-args"`
KVOnly bool `mapstructure:"kv-only"`
AttrOnly bool `mapstructure:"attr-only"`
ContextOnly bool `mapstructure:"context-only"`
Expand Down
1 change: 1 addition & 0 deletions pkg/golinters/sloglint.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ func NewSlogLint(settings *config.SlogLintSettings) *goanalysis.Linter {
var opts *sloglint.Options
if settings != nil {
opts = &sloglint.Options{
NoMixedArgs: settings.NoMixedArgs,
KVOnly: settings.KVOnly,
AttrOnly: settings.AttrOnly,
ContextOnly: settings.ContextOnly,
Expand Down