Skip to content

Commit 73110df

Browse files
authored
build(deps): bump github.com/Antonboom/testifylint from 1.2.0 to 1.3.0 (#4729)
1 parent be1bb6d commit 73110df

File tree

7 files changed

+74
-25
lines changed

7 files changed

+74
-25
lines changed

.golangci.next.reference.yml

+9-3
Original file line numberDiff line numberDiff line change
@@ -2176,9 +2176,10 @@ linters-settings:
21762176
- error-is-as
21772177
- error-nil
21782178
- expected-actual
2179-
- go-require
21802179
- float-compare
2180+
- go-require
21812181
- len
2182+
- negative-positive
21822183
- nil-compare
21832184
- require-error
21842185
- suite-dont-use-pkg
@@ -2192,7 +2193,7 @@ linters-settings:
21922193
# Enable checkers by name
21932194
# (in addition to default
21942195
# blank-import, bool-compare, compares, empty, error-is-as, error-nil, expected-actual, go-require, float-compare,
2195-
# len, nil-compare, require-error, suite-dont-use-pkg, suite-extra-assert-call, useless-assert
2196+
# len, negative-positive, nil-compare, require-error, suite-dont-use-pkg, suite-extra-assert-call, useless-assert
21962197
# ).
21972198
enable:
21982199
- blank-import
@@ -2202,9 +2203,10 @@ linters-settings:
22022203
- error-is-as
22032204
- error-nil
22042205
- expected-actual
2205-
- go-require
22062206
- float-compare
2207+
- go-require
22072208
- len
2209+
- negative-positive
22082210
- nil-compare
22092211
- require-error
22102212
- suite-dont-use-pkg
@@ -2220,6 +2222,10 @@ linters-settings:
22202222
# Regexp for expected variable name.
22212223
# Default: (^(exp(ected)?|want(ed)?)([A-Z]\w*)?$)|(^(\w*[a-z])?(Exp(ected)?|Want(ed)?)$)
22222224
pattern: ^expected
2225+
go-require:
2226+
# To ignore HTTP handlers (like http.HandlerFunc).
2227+
# Default: false
2228+
ignore-http-handlers: true
22232229
require-error:
22242230
# Regexp for assertions to analyze. If defined, then only matched error assertions will be reported.
22252231
# Default: ""

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/Abirdcfly/dupword v0.0.14
1010
github.com/Antonboom/errname v0.1.13
1111
github.com/Antonboom/nilnil v0.1.9
12-
github.com/Antonboom/testifylint v1.2.0
12+
github.com/Antonboom/testifylint v1.3.0
1313
github.com/BurntSushi/toml v1.3.2
1414
github.com/Crocmagnon/fatcontext v0.2.2
1515
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24

go.sum

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

jsonschema/golangci.next.jsonschema.json

+56-18
Original file line numberDiff line numberDiff line change
@@ -2779,16 +2779,6 @@
27792779
"type": "object",
27802780
"additionalProperties": false,
27812781
"properties": {
2782-
"bool-compare": {
2783-
"type": "object",
2784-
"additionalProperties": false,
2785-
"properties": {
2786-
"ignore-custom-types": {
2787-
"type": "boolean",
2788-
"default": false
2789-
}
2790-
}
2791-
},
27922782
"enable-all": {
27932783
"description": "Enable all checkers.",
27942784
"type": "boolean",
@@ -2811,20 +2801,39 @@
28112801
"error-is-as",
28122802
"error-nil",
28132803
"expected-actual",
2814-
"go-require",
28152804
"float-compare",
2805+
"go-require",
28162806
"len",
2807+
"negative-positive",
28172808
"nil-compare",
28182809
"require-error",
28192810
"suite-dont-use-pkg",
28202811
"suite-extra-assert-call",
28212812
"suite-thelper",
28222813
"useless-assert"
28232814
]
2824-
}
2815+
},
2816+
"default": [
2817+
"blank-import",
2818+
"bool-compare",
2819+
"compares",
2820+
"empty",
2821+
"error-is-as",
2822+
"error-nil",
2823+
"expected-actual",
2824+
"float-compare",
2825+
"go-require",
2826+
"len",
2827+
"negative-positive",
2828+
"nil-compare",
2829+
"require-error",
2830+
"suite-dont-use-pkg",
2831+
"suite-extra-assert-call",
2832+
"useless-assert"
2833+
]
28252834
},
28262835
"disable": {
2827-
"description": "Enable specific checkers.",
2836+
"description": "Disable specific checkers.",
28282837
"type": "array",
28292838
"items": {
28302839
"enum": [
@@ -2835,25 +2844,52 @@
28352844
"error-is-as",
28362845
"error-nil",
28372846
"expected-actual",
2838-
"go-require",
28392847
"float-compare",
2848+
"go-require",
28402849
"len",
2850+
"negative-positive",
28412851
"nil-compare",
28422852
"require-error",
28432853
"suite-dont-use-pkg",
28442854
"suite-extra-assert-call",
28452855
"suite-thelper",
28462856
"useless-assert"
2857+
],
2858+
"default": [
2859+
"suite-thelper"
28472860
]
28482861
}
28492862
},
2863+
"bool-compare": {
2864+
"type": "object",
2865+
"additionalProperties": false,
2866+
"properties": {
2867+
"ignore-custom-types": {
2868+
"description": "To ignore user defined types (over builtin bool).",
2869+
"type": "boolean",
2870+
"default": false
2871+
}
2872+
}
2873+
},
28502874
"expected-actual": {
28512875
"type": "object",
28522876
"additionalProperties": false,
28532877
"properties": {
28542878
"pattern": {
28552879
"description": "Regexp for expected variable name.",
2856-
"type": "string"
2880+
"type": "string",
2881+
"default": "(^(exp(ected)?|want(ed)?)([A-Z]\\w*)?$)|(^(\\w*[a-z])?(Exp(ected)?|Want(ed)?)$)"
2882+
}
2883+
}
2884+
},
2885+
"go-require": {
2886+
"type": "object",
2887+
"additionalProperties": false,
2888+
"properties": {
2889+
"ignore-http-handlers": {
2890+
"description": "To ignore HTTP handlers (like http.HandlerFunc).",
2891+
"type": "boolean",
2892+
"default": false
28572893
}
28582894
}
28592895
},
@@ -2862,8 +2898,9 @@
28622898
"additionalProperties": false,
28632899
"properties": {
28642900
"fn-pattern": {
2865-
"description": "Regexp for expected variable name.",
2866-
"type": "string"
2901+
"description": "Regexp for assertions to analyze. If defined, then only matched error assertions will be reported.",
2902+
"type": "string",
2903+
"default": ""
28672904
}
28682905
}
28692906
},
@@ -2874,7 +2911,8 @@
28742911
"mode": {
28752912
"description": "To require or remove extra Assert() call?",
28762913
"type": "string",
2877-
"enum": ["remove", "require"]
2914+
"enum": ["remove", "require"],
2915+
"default": "remove"
28782916
}
28792917
}
28802918
}

pkg/config/linters_settings.go

+4
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,10 @@ type TestifylintSettings struct {
882882
ExpVarPattern string `mapstructure:"pattern"`
883883
} `mapstructure:"expected-actual"`
884884

885+
GoRequire struct {
886+
IgnoreHTTPHandlers bool `mapstructure:"ignore-http-handlers"`
887+
} `mapstructure:"go-require"`
888+
885889
RequireError struct {
886890
FnPattern string `mapstructure:"fn-pattern"`
887891
} `mapstructure:"require-error"`

pkg/goanalysis/linter.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func (*Linter) configureAnalyzer(a *analysis.Analyzer, cfg map[string]any) error
116116
}
117117

118118
if err := f.Value.Set(valueToString(v)); err != nil {
119-
return fmt.Errorf("failed to set analyzer setting %q with value %v: %w", k, v, err)
119+
return fmt.Errorf("failed to set analyzer setting %q with value %q: %w", k, v, err)
120120
}
121121
}
122122

pkg/golinters/testifylint/testifylint.go

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ func New(settings *config.TestifylintSettings) *goanalysis.Linter {
1818
"disable-all": settings.DisableAll,
1919

2020
"bool-compare.ignore-custom-types": settings.BoolCompare.IgnoreCustomTypes,
21+
"go-require.ignore-http-handlers": settings.GoRequire.IgnoreHTTPHandlers,
2122
}
2223
if len(settings.EnabledCheckers) > 0 {
2324
cfg[a.Name]["enable"] = settings.EnabledCheckers

0 commit comments

Comments
 (0)