Config migration omits nakedret
config when max-func-lines
is set to 0
#5754
Labels
nakedret
config when max-func-lines
is set to 0
#5754
Welcome
typecheck
section of the FAQ.How did you install golangci-lint?
Other
Description of the problem
The following config fails to be migrated from v1 to v2 using the
migrate
command:as the
nakedret
config is missing from the migrated config.For example:
becomes:
I've confirmed that the tests will fail if
testdata/yaml/linters-settings_nakedret[.golden].yml
are changed to specify 0 as the value formax-func-lines
.I tried tweaking the
NakedretSettings
struct inpkg/commands/internal/migrate/versiontwo/linters_settings.go
to see whether this would resolve the issue (I realise this is an autogenerated file) but it does not. Basically, the resulting struct is indistinguishable from the zero value. This is a bit of an edge-case as this is the only config setting for this linter and 0 is a valid, non-default, value.Version of golangci-lint
Configuration
Go environment
Verbose output of running
A minimal reproducible example or link to a public repository
.golangci.yml
:then run
golangci-lint migrate
.Validation
Supporter
The text was updated successfully, but these errors were encountered: