-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad suggested fix for negative-positive #210
Comments
## Changes - Enable new linter: testifylint. - Apply fixes with --fix. - Fix remaining issues (mostly with aider). There were 2 cases we --fix did the wrong thing - this seems to a be a bug in linter: Antonboom/testifylint#210 Nonetheless, I kept that check enabled, it seems useful, just need to be fixed manually after autofix. ## Tests Existing tests
I think I'm the one who added the negative-positive linter. I will take a look in the next days Thanks for reporting the issue |
The problem is right here and might be more general than reported by this
// untype returns v from type(v) expression or v itself if there is no type conversion.
func untype(e ast.Expr) ast.Expr {
ce, ok := e.(*ast.CallExpr)
if !ok || len(ce.Args) != 1 {
return e
}
return ce.Args[0]
} The call to untype transforms not only the untype was added by myself, and nothing else use it. I will check for a better test, or simply existing another helper available in testifylint |
Expected
assert.NotEmpty(t, x)
orassert.Positive(t, len(x))
but not the above.The text was updated successfully, but these errors were encountered: