mirror of
https://github.com/scratchfoundation/golangci-lint.git
synced 2025-08-28 22:28:43 -04:00
unused: support passing in options (#4086)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
This commit is contained in:
parent
69d6cc93cb
commit
bce3dfd460
4 changed files with 83 additions and 25 deletions
|
@ -126,6 +126,15 @@ var defaultLintersSettings = LintersSettings{
|
|||
Unparam: UnparamSettings{
|
||||
Algo: "cha",
|
||||
},
|
||||
Unused: UnusedSettings{
|
||||
FieldWritesAreUses: true,
|
||||
PostStatementsAreReads: false,
|
||||
ExportedIsUsed: true,
|
||||
ExportedFieldsAreUsed: true,
|
||||
ParametersAreUsed: true,
|
||||
LocalVariablesAreUsed: true,
|
||||
GeneratedIsUsed: true,
|
||||
},
|
||||
UseStdlibVars: UseStdlibVarsSettings{
|
||||
HTTPMethod: true,
|
||||
HTTPStatusCode: true,
|
||||
|
@ -223,6 +232,7 @@ type LintersSettings struct {
|
|||
Testpackage TestpackageSettings
|
||||
Thelper ThelperSettings
|
||||
Unparam UnparamSettings
|
||||
Unused UnusedSettings
|
||||
UseStdlibVars UseStdlibVarsSettings
|
||||
Varcheck VarCheckSettings
|
||||
Varnamelen VarnamelenSettings
|
||||
|
@ -794,6 +804,16 @@ type UnparamSettings struct {
|
|||
Algo string
|
||||
}
|
||||
|
||||
type UnusedSettings struct {
|
||||
FieldWritesAreUses bool `mapstructure:"field-writes-are-uses"`
|
||||
PostStatementsAreReads bool `mapstructure:"post-statements-are-reads"`
|
||||
ExportedIsUsed bool `mapstructure:"exported-is-used"`
|
||||
ExportedFieldsAreUsed bool `mapstructure:"exported-fields-are-used"`
|
||||
ParametersAreUsed bool `mapstructure:"parameters-are-used"`
|
||||
LocalVariablesAreUsed bool `mapstructure:"local-variables-are-used"`
|
||||
GeneratedIsUsed bool `mapstructure:"generated-is-used"`
|
||||
}
|
||||
|
||||
type VarCheckSettings struct {
|
||||
CheckExportedFields bool `mapstructure:"exported-fields"`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue