linter: testifylint - Checks usage of github.com/stretchr/testify.
checker: negative-positive - More appropriate testify API with clearer failure message.
Example
Before:
assert.Less(t, a, 0)
assert.Greater(t, 0, a)
assert.True(t, a < 0)
assert.True(t, 0 > a)
assert.False(t, a >= 0)
assert.False(t, 0 <= a)
assert.Greater(t, a, 0)
assert.Less(t, 0, a)
assert.True(t, a > 0)
assert.True(t, 0 < a)
assert.False(t, a <= 0)
assert.False(t, 0 >= a)
After:
assert.Negative(t, a)
assert.Positive(t, a)
Expected output
Decision about enabling or not enabling this checker.
Findings
For this checker, the following findings were found in the current codebase:
plugins/inputs/pgbouncer/pgbouncer_test.go:101:2 testifylint negative-positive: use require.Positive
plugins/inputs/pgbouncer/pgbouncer_test.go:213:2 testifylint negative-positive: use require.Positive
plugins/inputs/postgresql/postgresql_test.go:128:2 testifylint negative-positive: use require.Positive
plugins/inputs/postgresql_extensible/postgresql_extensible_test.go:124:2 testifylint negative-positive: use require.Positive
Additional configuration
For this checker, no additional configuration can be provided.
Description
This issue starts a discussion about enabling:
testify
API with clearer failure message.Example
Before:
After:
Expected output
Decision about enabling or not enabling this checker.
Findings
For this checker, the following findings were found in the current codebase:
Additional configuration
For this checker, no additional configuration can be provided.