Skip to content

Commit

Permalink
Apply review findings
Browse files Browse the repository at this point in the history
  • Loading branch information
breml committed Nov 23, 2021
1 parent 2a3a39c commit 10249ca
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
36 changes: 18 additions & 18 deletions .golangci.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/lint/lintersdb/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),

Expand Down

0 comments on commit 10249ca

Please sign in to comment.