diff --git a/.golangci.example.yml b/.golangci.example.yml index 18cbde45b2f4..ddfc00cb4897 100644 --- a/.golangci.example.yml +++ b/.golangci.example.yml @@ -103,24 +103,6 @@ linters-settings: # should ignore tests (default false) skip-tests: false - errchkjson: - # with check-error-free-encoding set to true, errchkjson does warn about errors - # from json encoding functions that are safe to be ignored, - # because they are not possible to happen (default false) - # - # if check-error-free-encoding is set to true and errcheck linter is enabled, - # it is recommended to add the following exceptions to prevent from false positives: - # - # linters-settings: - # errcheck: - # exclude-functions: - # - encoding/json.Marshal - # - encoding/json.MarshalIndent - # - (*encoding/json.Encoder).Encode - check-error-free-encoding: false - # if report-no-exported is true, encoding a struct without exported fields is reported as issue (default false) - report-no-exported: false - dogsled: # checks assignments with too many blank identifiers; default is 2 max-blank-identifiers: 2 @@ -155,6 +137,24 @@ linters-settings: - io.Copy(*bytes.Buffer) - io.Copy(os.Stdout) + errchkjson: + # with check-error-free-encoding set to true, errchkjson does warn about errors + # from json encoding functions that are safe to be ignored, + # because they are not possible to happen (default false) + # + # if check-error-free-encoding is set to true and errcheck linter is enabled, + # it is recommended to add the following exceptions to prevent from false positives: + # + # linters-settings: + # errcheck: + # exclude-functions: + # - encoding/json.Marshal + # - encoding/json.MarshalIndent + # - (*encoding/json.Encoder).Encode + check-error-free-encoding: false + # if report-no-exported is true, encoding a struct without exported fields is reported as issue (default false) + report-no-exported: false + errorlint: # Check whether fmt.Errorf uses the %w verb for formatting errors. See the readme for caveats errorf: true diff --git a/pkg/lint/lintersdb/manager.go b/pkg/lint/lintersdb/manager.go index b380d3786176..b853f3ab6dfa 100644 --- a/pkg/lint/lintersdb/manager.go +++ b/pkg/lint/lintersdb/manager.go @@ -552,7 +552,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { WithURL("https://github.com/breml/bidichk"), linter.NewConfig(golinters.NewErrChkJSONFuncName(errchkjsonCfg)). WithSince("1.44.0"). - WithPresets(linter.PresetBugs, linter.PresetUnused). + WithPresets(linter.PresetBugs). WithLoadForGoAnalysis(). WithURL("https://github.com/breml/errchkjson"),