mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-03-17 20:57:51 +02:00
[chore]: enable bool-compare rule from testifylint (#5829)
#### Description Testifylint is a linter that provides best practices with the use of testify. This PR enables [bool-compare](https://github.com/Antonboom/testifylint?tab=readme-ov-file#bool-compare) rule from [testifylint](https://github.com/Antonboom/testifylint) It's linter provided by golangci-lint. Here all available rules are activated except those who require to be fixed. This PR only fixes bool-compare so the quantity of changes stays reasonnable for reviewers. Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com> Co-authored-by: Damien Mathieu <42@dmathieu.com>
This commit is contained in:
parent
a200e0a2c6
commit
aef9e4fa2f
@ -25,6 +25,7 @@ linters:
|
||||
- revive
|
||||
- staticcheck
|
||||
- tenv
|
||||
- testifylint
|
||||
- typecheck
|
||||
- unconvert
|
||||
- unused
|
||||
@ -302,3 +303,16 @@ linters-settings:
|
||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#waitgroup-by-value
|
||||
- name: waitgroup-by-value
|
||||
disabled: false
|
||||
testifylint:
|
||||
enable-all: true
|
||||
disable:
|
||||
- empty
|
||||
- error-is-as
|
||||
- error-nil
|
||||
- expected-actual
|
||||
- float-compare
|
||||
- go-require
|
||||
- len
|
||||
- negative-positive
|
||||
- require-error
|
||||
- suite-extra-assert-call
|
||||
|
@ -101,7 +101,7 @@ func TestConfigs(t *testing.T) {
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "someendpoint", c.Metrics.Endpoint)
|
||||
assert.Equal(t, "/somepath", c.Metrics.URLPath)
|
||||
assert.Equal(t, true, c.Metrics.Insecure)
|
||||
assert.True(t, c.Metrics.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -112,7 +112,7 @@ func TestConfigs(t *testing.T) {
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "someendpoint", c.Metrics.Endpoint)
|
||||
assert.Equal(t, "/somepath", c.Metrics.URLPath)
|
||||
assert.Equal(t, false, c.Metrics.Insecure)
|
||||
assert.False(t, c.Metrics.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -213,7 +213,7 @@ func TestConfigs(t *testing.T) {
|
||||
},
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "env_endpoint", c.Metrics.Endpoint)
|
||||
assert.Equal(t, true, c.Metrics.Insecure)
|
||||
assert.True(t, c.Metrics.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -223,7 +223,7 @@ func TestConfigs(t *testing.T) {
|
||||
},
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "env_endpoint", c.Metrics.Endpoint)
|
||||
assert.Equal(t, true, c.Metrics.Insecure)
|
||||
assert.True(t, c.Metrics.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -233,7 +233,7 @@ func TestConfigs(t *testing.T) {
|
||||
},
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "env_endpoint", c.Metrics.Endpoint)
|
||||
assert.Equal(t, false, c.Metrics.Insecure)
|
||||
assert.False(t, c.Metrics.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -244,7 +244,7 @@ func TestConfigs(t *testing.T) {
|
||||
},
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "env_metrics_endpoint", c.Metrics.Endpoint)
|
||||
assert.Equal(t, true, c.Metrics.Insecure)
|
||||
assert.True(t, c.Metrics.Insecure)
|
||||
},
|
||||
},
|
||||
|
||||
|
@ -101,7 +101,7 @@ func TestConfigs(t *testing.T) {
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "someendpoint", c.Metrics.Endpoint)
|
||||
assert.Equal(t, "/somepath", c.Metrics.URLPath)
|
||||
assert.Equal(t, true, c.Metrics.Insecure)
|
||||
assert.True(t, c.Metrics.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -112,7 +112,7 @@ func TestConfigs(t *testing.T) {
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "someendpoint", c.Metrics.Endpoint)
|
||||
assert.Equal(t, "/somepath", c.Metrics.URLPath)
|
||||
assert.Equal(t, false, c.Metrics.Insecure)
|
||||
assert.False(t, c.Metrics.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -213,7 +213,7 @@ func TestConfigs(t *testing.T) {
|
||||
},
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "env_endpoint", c.Metrics.Endpoint)
|
||||
assert.Equal(t, true, c.Metrics.Insecure)
|
||||
assert.True(t, c.Metrics.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -223,7 +223,7 @@ func TestConfigs(t *testing.T) {
|
||||
},
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "env_endpoint", c.Metrics.Endpoint)
|
||||
assert.Equal(t, true, c.Metrics.Insecure)
|
||||
assert.True(t, c.Metrics.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -233,7 +233,7 @@ func TestConfigs(t *testing.T) {
|
||||
},
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "env_endpoint", c.Metrics.Endpoint)
|
||||
assert.Equal(t, false, c.Metrics.Insecure)
|
||||
assert.False(t, c.Metrics.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -244,7 +244,7 @@ func TestConfigs(t *testing.T) {
|
||||
},
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "env_metrics_endpoint", c.Metrics.Endpoint)
|
||||
assert.Equal(t, true, c.Metrics.Insecure)
|
||||
assert.True(t, c.Metrics.Insecure)
|
||||
},
|
||||
},
|
||||
|
||||
|
@ -99,7 +99,7 @@ func TestConfigs(t *testing.T) {
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "someendpoint", c.Traces.Endpoint)
|
||||
assert.Equal(t, "/somepath", c.Traces.URLPath)
|
||||
assert.Equal(t, true, c.Traces.Insecure)
|
||||
assert.True(t, c.Traces.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -110,7 +110,7 @@ func TestConfigs(t *testing.T) {
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "someendpoint", c.Traces.Endpoint)
|
||||
assert.Equal(t, "/somepath", c.Traces.URLPath)
|
||||
assert.Equal(t, false, c.Traces.Insecure)
|
||||
assert.False(t, c.Traces.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -211,7 +211,7 @@ func TestConfigs(t *testing.T) {
|
||||
},
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "env_endpoint", c.Traces.Endpoint)
|
||||
assert.Equal(t, true, c.Traces.Insecure)
|
||||
assert.True(t, c.Traces.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -221,7 +221,7 @@ func TestConfigs(t *testing.T) {
|
||||
},
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "env_endpoint", c.Traces.Endpoint)
|
||||
assert.Equal(t, true, c.Traces.Insecure)
|
||||
assert.True(t, c.Traces.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -231,7 +231,7 @@ func TestConfigs(t *testing.T) {
|
||||
},
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "env_endpoint", c.Traces.Endpoint)
|
||||
assert.Equal(t, false, c.Traces.Insecure)
|
||||
assert.False(t, c.Traces.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -242,7 +242,7 @@ func TestConfigs(t *testing.T) {
|
||||
},
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "env_traces_endpoint", c.Traces.Endpoint)
|
||||
assert.Equal(t, true, c.Traces.Insecure)
|
||||
assert.True(t, c.Traces.Insecure)
|
||||
},
|
||||
},
|
||||
|
||||
|
@ -99,7 +99,7 @@ func TestConfigs(t *testing.T) {
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "someendpoint", c.Traces.Endpoint)
|
||||
assert.Equal(t, "/somepath", c.Traces.URLPath)
|
||||
assert.Equal(t, true, c.Traces.Insecure)
|
||||
assert.True(t, c.Traces.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -110,7 +110,7 @@ func TestConfigs(t *testing.T) {
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "someendpoint", c.Traces.Endpoint)
|
||||
assert.Equal(t, "/somepath", c.Traces.URLPath)
|
||||
assert.Equal(t, false, c.Traces.Insecure)
|
||||
assert.False(t, c.Traces.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -211,7 +211,7 @@ func TestConfigs(t *testing.T) {
|
||||
},
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "env_endpoint", c.Traces.Endpoint)
|
||||
assert.Equal(t, true, c.Traces.Insecure)
|
||||
assert.True(t, c.Traces.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -221,7 +221,7 @@ func TestConfigs(t *testing.T) {
|
||||
},
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "env_endpoint", c.Traces.Endpoint)
|
||||
assert.Equal(t, true, c.Traces.Insecure)
|
||||
assert.True(t, c.Traces.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -231,7 +231,7 @@ func TestConfigs(t *testing.T) {
|
||||
},
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "env_endpoint", c.Traces.Endpoint)
|
||||
assert.Equal(t, false, c.Traces.Insecure)
|
||||
assert.False(t, c.Traces.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -242,7 +242,7 @@ func TestConfigs(t *testing.T) {
|
||||
},
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "env_traces_endpoint", c.Traces.Endpoint)
|
||||
assert.Equal(t, true, c.Traces.Insecure)
|
||||
assert.True(t, c.Traces.Insecure)
|
||||
},
|
||||
},
|
||||
|
||||
|
@ -101,7 +101,7 @@ func TestConfigs(t *testing.T) {
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "someendpoint", c.Metrics.Endpoint)
|
||||
assert.Equal(t, "/somepath", c.Metrics.URLPath)
|
||||
assert.Equal(t, true, c.Metrics.Insecure)
|
||||
assert.True(t, c.Metrics.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -112,7 +112,7 @@ func TestConfigs(t *testing.T) {
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "someendpoint", c.Metrics.Endpoint)
|
||||
assert.Equal(t, "/somepath", c.Metrics.URLPath)
|
||||
assert.Equal(t, false, c.Metrics.Insecure)
|
||||
assert.False(t, c.Metrics.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -213,7 +213,7 @@ func TestConfigs(t *testing.T) {
|
||||
},
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "env_endpoint", c.Metrics.Endpoint)
|
||||
assert.Equal(t, true, c.Metrics.Insecure)
|
||||
assert.True(t, c.Metrics.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -223,7 +223,7 @@ func TestConfigs(t *testing.T) {
|
||||
},
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "env_endpoint", c.Metrics.Endpoint)
|
||||
assert.Equal(t, true, c.Metrics.Insecure)
|
||||
assert.True(t, c.Metrics.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -233,7 +233,7 @@ func TestConfigs(t *testing.T) {
|
||||
},
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "env_endpoint", c.Metrics.Endpoint)
|
||||
assert.Equal(t, false, c.Metrics.Insecure)
|
||||
assert.False(t, c.Metrics.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -244,7 +244,7 @@ func TestConfigs(t *testing.T) {
|
||||
},
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "env_metrics_endpoint", c.Metrics.Endpoint)
|
||||
assert.Equal(t, true, c.Metrics.Insecure)
|
||||
assert.True(t, c.Metrics.Insecure)
|
||||
},
|
||||
},
|
||||
|
||||
|
@ -99,7 +99,7 @@ func TestConfigs(t *testing.T) {
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "someendpoint", c.Traces.Endpoint)
|
||||
assert.Equal(t, "/somepath", c.Traces.URLPath)
|
||||
assert.Equal(t, true, c.Traces.Insecure)
|
||||
assert.True(t, c.Traces.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -110,7 +110,7 @@ func TestConfigs(t *testing.T) {
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "someendpoint", c.Traces.Endpoint)
|
||||
assert.Equal(t, "/somepath", c.Traces.URLPath)
|
||||
assert.Equal(t, false, c.Traces.Insecure)
|
||||
assert.False(t, c.Traces.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -211,7 +211,7 @@ func TestConfigs(t *testing.T) {
|
||||
},
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "env_endpoint", c.Traces.Endpoint)
|
||||
assert.Equal(t, true, c.Traces.Insecure)
|
||||
assert.True(t, c.Traces.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -221,7 +221,7 @@ func TestConfigs(t *testing.T) {
|
||||
},
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "env_endpoint", c.Traces.Endpoint)
|
||||
assert.Equal(t, true, c.Traces.Insecure)
|
||||
assert.True(t, c.Traces.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -231,7 +231,7 @@ func TestConfigs(t *testing.T) {
|
||||
},
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "env_endpoint", c.Traces.Endpoint)
|
||||
assert.Equal(t, false, c.Traces.Insecure)
|
||||
assert.False(t, c.Traces.Insecure)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -242,7 +242,7 @@ func TestConfigs(t *testing.T) {
|
||||
},
|
||||
asserts: func(t *testing.T, c *Config, grpcOption bool) {
|
||||
assert.Equal(t, "env_traces_endpoint", c.Traces.Endpoint)
|
||||
assert.Equal(t, true, c.Traces.Insecure)
|
||||
assert.True(t, c.Traces.Insecure)
|
||||
},
|
||||
},
|
||||
|
||||
|
@ -91,7 +91,7 @@ func TestSortedValueEqual(t *testing.T) {
|
||||
}
|
||||
for _, tc := range testCases {
|
||||
t.Run(tc.value.String(), func(t *testing.T) {
|
||||
assert.Equal(t, true, tc.value.Equal(tc.value2), "%v.Equal(%v)", tc.value, tc.value2)
|
||||
assert.True(t, tc.value.Equal(tc.value2), "%v.Equal(%v)", tc.value, tc.value2)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user