Skip to content

Commit 7644bd3

Browse files
committed
feat: update to v0.8.0 merge config
Update to v0.8.0 which adds merge config support. This improves compatibility with golangci-lint by allowing the internal rules to be applied and overridden with minimal configuration.
1 parent 5d2af72 commit 7644bd3

File tree

4 files changed

+25
-43
lines changed

4 files changed

+25
-43
lines changed

.golangci.reference.yml

+14-37
Original file line numberDiff line numberDiff line change
@@ -1743,45 +1743,22 @@ linters-settings:
17431743
begin: false
17441744

17451745
uncalled:
1746-
default-category: uncalled
1746+
# Disables all rules.
1747+
# Default: false
1748+
disabled-all: true
1749+
# Disables the given rules.
1750+
# Default: []
1751+
disabled:
1752+
- context-cancel
1753+
# Enables specific rules, in combination with disable all.
1754+
# Default: []
1755+
enabled:
1756+
- sql-rows-err
1757+
# Add or override default rules.
1758+
# Default: []
17471759
rules:
1748-
# Checks for missing sql Rows.Err() calls.
1749-
- name: sql-rows-err
1750-
# Default: false
1751-
disabled: true
1752-
category: sql
1753-
packages:
1754-
- database/sql
1755-
- github.com/jmoiron/sqlx
1756-
methods: []
1757-
results:
1758-
- type: .Rows
1759-
pointer: true
1760-
expect:
1761-
call: .Err
1762-
args: []
1763-
- type: error
1764-
pointer: false
1765-
# Checks for missing http Reponse.Body.Close() calls.
1766-
- name: http-response-body-close
1767-
# Default: false
1768-
disabled: true
1769-
category: http
1770-
packages:
1771-
- net/http
1772-
methods: []
1773-
results:
1774-
- type: .Response
1775-
pointer: true
1776-
expect:
1777-
call: .Body.Close
1778-
args: []
1779-
- type: error
1780-
pointer: false
1781-
# Checks for missing context CancelFunc() calls.
1760+
# Check for missing context CancelFunc() calls.
17821761
- name: context-cancel
1783-
# Default: false
1784-
disabled: true
17851762
category: context
17861763
packages:
17871764
- context

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ require (
9393
github.com/spf13/viper v1.12.0
9494
github.com/ssgreg/nlreturn/v2 v2.2.1
9595
github.com/stbenjam/no-sprintf-host-port v0.1.1
96-
github.com/stevenh/go-uncalled v0.7.3
96+
github.com/stevenh/go-uncalled v0.8.0
9797
github.com/stretchr/testify v1.8.1
9898
github.com/tdakkota/asciicheck v0.1.1
9999
github.com/tetafro/godot v1.4.11

go.sum

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/config/linters_settings.go

+8-3
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,12 @@ var defaultLintersSettings = LintersSettings{
109109
SkipRegexp: `(export|internal)_test\.go`,
110110
AllowPackages: []string{"main"},
111111
},
112-
Uncalled: uncalled.DefaultConfig(),
112+
Uncalled: UncalledSettings{
113+
DisableAll: false,
114+
Enabled: nil,
115+
Disabled: nil,
116+
Rules: nil,
117+
},
113118
Unparam: UnparamSettings{
114119
Algo: "cha",
115120
},
@@ -603,8 +608,6 @@ type ReviveSettings struct {
603608
}
604609
}
605610

606-
type UncalledSettings = uncalled.Config
607-
608611
type RowsErrCheckSettings struct {
609612
Packages []string
610613
}
@@ -671,6 +674,8 @@ type UseStdlibVarsSettings struct {
671674
SyslogPriority bool `mapstructure:"syslog-priority"`
672675
}
673676

677+
type UncalledSettings = uncalled.Config
678+
674679
type UnparamSettings struct {
675680
CheckExported bool `mapstructure:"check-exported"`
676681
Algo string

0 commit comments

Comments
 (0)