diff --git a/linter/ginkgo_linter.go b/linter/ginkgo_linter.go index 8abbd2c..39758bc 100644 --- a/linter/ginkgo_linter.go +++ b/linter/ginkgo_linter.go @@ -16,6 +16,7 @@ import ( "github.com/nunnatsa/ginkgolinter/ginkgohandler" "github.com/nunnatsa/ginkgolinter/gomegahandler" "github.com/nunnatsa/ginkgolinter/interfaces" + "github.com/nunnatsa/ginkgolinter/reports" "github.com/nunnatsa/ginkgolinter/reverseassertion" "github.com/nunnatsa/ginkgolinter/types" ) @@ -26,25 +27,24 @@ import ( const ( linterName = "ginkgo-linter" - wrongLengthWarningTemplate = linterName + ": wrong length assertion; consider using `%s` instead" - wrongNilWarningTemplate = linterName + ": wrong nil assertion; consider using `%s` instead" - wrongBoolWarningTemplate = linterName + ": wrong boolean assertion; consider using `%s` instead" - wrongErrWarningTemplate = linterName + ": wrong error assertion; consider using `%s` instead" - wrongCompareWarningTemplate = linterName + ": wrong comparison assertion; consider using `%s` instead" - doubleNegativeWarningTemplate = linterName + ": avoid double negative assertion; consider using `%s` instead" - valueInEventually = linterName + ": use a function call in %s. This actually checks nothing, because %s receives the function returned value, instead of function itself, and this value is never changed" - comparePointerToValue = linterName + ": comparing a pointer to a value will always fail. consider using `%s` instead" - missingAssertionMessage = linterName + `: %q: missing assertion method. Expected "Should()", "To()", "ShouldNot()", "ToNot()" or "NotTo()"` - missingAsyncAssertionMessage = linterName + `: %q: missing assertion method. Expected "Should()" or "ShouldNot()"` - focusContainerFound = linterName + ": Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with %q" - focusSpecFound = linterName + ": Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it" - compareDifferentTypes = linterName + ": use %[1]s with different types: Comparing %[2]s with %[3]s; either change the expected value type if possible, or use the BeEquivalentTo() matcher, instead of %[1]s()" - matchErrorArgWrongType = linterName + ": the MatchError matcher used to assert a non error type (%s)" - matchErrorWrongTypeAssertion = linterName + ": MatchError first parameter (%s) must be error, string, GomegaMatcher or func(error)bool are allowed" - matchErrorMissingDescription = linterName + ": missing function description as second parameter of MatchError" - matchErrorRedundantArg = linterName + ": redundant MatchError arguments; consider removing them; consider using `%s` instead" - matchErrorNoFuncDescription = linterName + ": The second parameter of MatchError must be the function description (string)" - forceExpectToTemplate = linterName + ": must not use Expect with %s" + wrongLengthWarningTemplate = "wrong length assertion" + wrongNilWarningTemplate = "wrong nil assertion" + wrongBoolWarningTemplate = "wrong boolean assertion" + wrongErrWarningTemplate = "wrong error assertion" + wrongCompareWarningTemplate = "wrong comparison assertion" + doubleNegativeWarningTemplate = "avoid double negative assertion" + valueInEventually = "use a function call in %s. This actually checks nothing, because %s receives the function returned value, instead of function itself, and this value is never changed" + comparePointerToValue = "comparing a pointer to a value will always fail" + missingAssertionMessage = linterName + `: %q: missing assertion method. Expected %s` + focusContainerFound = linterName + ": Focus container found. This is used only for local debug and should not be part of the actual source code. Consider to replace with %q" + focusSpecFound = linterName + ": Focus spec found. This is used only for local debug and should not be part of the actual source code. Consider to remove it" + compareDifferentTypes = "use %[1]s with different types: Comparing %[2]s with %[3]s; either change the expected value type if possible, or use the BeEquivalentTo() matcher, instead of %[1]s()" + matchErrorArgWrongType = "the MatchError matcher used to assert a non error type (%s)" + matchErrorWrongTypeAssertion = "MatchError first parameter (%s) must be error, string, GomegaMatcher or func(error)bool are allowed" + matchErrorMissingDescription = "missing function description as second parameter of MatchError" + matchErrorRedundantArg = "redundant MatchError arguments; consider removing them" + matchErrorNoFuncDescription = "The second parameter of MatchError must be the function description (string)" + forceExpectToTemplate = "must not use Expect with %s" ) const ( // gomega matchers @@ -82,6 +82,7 @@ type GinkgoLinter struct { config *types.Config } +// NewGinkgoLinter return new ginkgolinter object func NewGinkgoLinter(config *types.Config) *GinkgoLinter { return &GinkgoLinter{ config: config, @@ -110,8 +111,7 @@ func (l *GinkgoLinter) Run(pass *analysis.Pass) (interface{}, error) { if ok { for _, val := range spec.Values { if exp, ok := val.(*ast.CallExpr); ok { - if found, diag := checkFocusContainer(pass, ginkgoHndlr, exp); found { - report(pass, diag) + if checkFocusContainer(pass, ginkgoHndlr, exp) { return true } } @@ -137,8 +137,7 @@ func (l *GinkgoLinter) Run(pass *analysis.Pass) (interface{}, error) { } if ginkgoHndlr != nil && bool(config.ForbidFocus) { - if found, diags := checkFocusContainer(pass, ginkgoHndlr, assertionExp); found { - report(pass, diags) + if checkFocusContainer(pass, ginkgoHndlr, assertionExp) { return true } } @@ -151,12 +150,12 @@ func (l *GinkgoLinter) Run(pass *analysis.Pass) (interface{}, error) { assertionFunc, ok := assertionExp.Fun.(*ast.SelectorExpr) if !ok { - report(pass, checkNoAssertion(assertionExp, gomegaHndlr)) + checkNoAssertion(pass, assertionExp, gomegaHndlr) return true } if !isAssertionFunc(assertionFunc.Sel.Name) { - report(pass, checkNoAssertion(assertionExp, gomegaHndlr)) + checkNoAssertion(pass, assertionExp, gomegaHndlr) return true } @@ -171,62 +170,61 @@ func (l *GinkgoLinter) Run(pass *analysis.Pass) (interface{}, error) { return nil, nil } -func checkFocusContainer(pass *analysis.Pass, ginkgoHndlr ginkgohandler.Handler, exp *ast.CallExpr) (bool, []analysis.Diagnostic) { +func checkFocusContainer(pass *analysis.Pass, ginkgoHndlr ginkgohandler.Handler, exp *ast.CallExpr) bool { foundFocus := false - var diagnostics []analysis.Diagnostic isFocus, id := ginkgoHndlr.GetFocusContainerName(exp) if isFocus { - diagnostics = append(diagnostics, reportNewName(id, id.Name[1:], focusContainerFound, id.Name)) + reportNewName(pass, id, id.Name[1:], focusContainerFound, id.Name) foundFocus = true } if id != nil && ginkgohandler.IsContainer(id) { for _, arg := range exp.Args { if ginkgoHndlr.IsFocusSpec(arg) { - diagnostics = append(diagnostics, reportNoFix(arg.Pos(), focusSpecFound)) + reportNoFix(pass, arg.Pos(), focusSpecFound) foundFocus = true } else if callExp, ok := arg.(*ast.CallExpr); ok { - if found, diags := checkFocusContainer(pass, ginkgoHndlr, callExp); found { // handle table entries + if checkFocusContainer(pass, ginkgoHndlr, callExp) { // handle table entries foundFocus = true - diagnostics = append(diagnostics, diags...) } } } } - return foundFocus, diagnostics + return foundFocus } func checkExpression(pass *analysis.Pass, config types.Config, assertionExp *ast.CallExpr, actualExpr *ast.CallExpr, handler gomegahandler.Handler) bool { expr := astcopy.CallExpr(assertionExp) - oldExpr := goFmt(pass.Fset, expr) - if found, diags := checkAsyncAssertion(pass, config, expr, actualExpr, handler, oldExpr); found { - report(pass, diags) - return true - } + reportBuilder := reports.NewBuilder(pass.Fset, expr) - actualArg := getActualArg(actualExpr, handler) - if actualArg == nil { - return true - } + goNested := false + if checkAsyncAssertion(pass, config, expr, actualExpr, handler, reportBuilder) { + goNested = true + } else { - goNested, diagnostics := doCheckExpression(pass, config, assertionExp, actualArg, expr, handler, oldExpr) + actualArg := getActualArg(actualExpr, handler) + if actualArg == nil { + return true + } - if config.ForceExpectTo { - if valid, diags := forceExpectTo(pass, expr, handler, oldExpr); !valid { - diagnostics = append(diagnostics, diags...) + if config.ForceExpectTo { + goNested = forceExpectTo(expr, handler, reportBuilder) || goNested } + + goNested = doCheckExpression(pass, config, assertionExp, actualArg, expr, handler, reportBuilder) || goNested } - if len(diagnostics) > 0 { - report(pass, diagnostics) + if reportBuilder.HasReport() { + reportBuilder.SetFixOffer(pass.Fset, expr) + pass.Report(reportBuilder.Build()) } return goNested } -func forceExpectTo(pass *analysis.Pass, expr *ast.CallExpr, handler gomegahandler.Handler, oldExpr string) (bool, []analysis.Diagnostic) { +func forceExpectTo(expr *ast.CallExpr, handler gomegahandler.Handler, reportBuilder *reports.Builder) bool { if asrtFun, ok := expr.Fun.(*ast.SelectorExpr); ok { if actualFuncName, ok := handler.GetActualFuncName(expr); ok && actualFuncName == expect { var ( @@ -240,118 +238,106 @@ func forceExpectTo(pass *analysis.Pass, expr *ast.CallExpr, handler gomegahandle case "ShouldNot": newIdent = ast.NewIdent("ToNot") default: - return true, nil + return false } handler.ReplaceFunction(expr, newIdent) - return false, prepareReport(pass, expr, fmt.Sprintf(forceExpectToTemplate, name)+"; consider using `%s` instead", oldExpr) + reportBuilder.AddIssue(true, fmt.Sprintf(forceExpectToTemplate, name)) + return true } } - return false, nil + return false } -func doCheckExpression(pass *analysis.Pass, config types.Config, assertionExp *ast.CallExpr, actualArg ast.Expr, expr *ast.CallExpr, handler gomegahandler.Handler, oldExpr string) (bool, []analysis.Diagnostic) { +func doCheckExpression(pass *analysis.Pass, config types.Config, assertionExp *ast.CallExpr, actualArg ast.Expr, expr *ast.CallExpr, handler gomegahandler.Handler, reportBuilder *reports.Builder) bool { if !bool(config.SuppressLen) && isActualIsLenFunc(actualArg) { - return checkLengthMatcher(expr, pass, handler, oldExpr) + return checkLengthMatcher(expr, pass, handler, reportBuilder) } else if nilable, compOp := getNilableFromComparison(actualArg); nilable != nil { if isExprError(pass, nilable) { if config.SuppressErr { - return true, nil + return true } } else if config.SuppressNil { - return true, nil + return true } - return checkNilMatcher(expr, pass, nilable, handler, compOp == token.NEQ, oldExpr) + return checkNilMatcher(expr, pass, nilable, handler, compOp == token.NEQ, reportBuilder) } else if first, second, op, ok := isComparison(pass, actualArg); ok { matcher, shouldContinue := startCheckComparison(expr, handler) if !shouldContinue { - return false, nil + return false } if !bool(config.SuppressLen) && isActualIsLenFunc(first) { - if found, diags := handleLenComparison(pass, expr, matcher, first, second, op, handler, oldExpr); found { - return false, diags + if handleLenComparison(pass, expr, matcher, first, second, op, handler, reportBuilder) { + return false } } - if config.SuppressCompare { - return true, nil - } - return checkComparison(expr, pass, matcher, handler, first, second, op, oldExpr) + return bool(config.SuppressCompare) || checkComparison(expr, pass, matcher, handler, first, second, op, reportBuilder) - } else if goNested, diags := checkMatchError(pass, assertionExp, actualArg, handler, oldExpr); goNested { - return false, diags + } else if checkMatchError(pass, assertionExp, actualArg, handler, reportBuilder) { + return false } else if isExprError(pass, actualArg) { - if config.SuppressErr { - return true, nil - } - return checkNilError(pass, expr, handler, actualArg, oldExpr) + return bool(config.SuppressErr) || checkNilError(pass, expr, handler, actualArg, reportBuilder) - } else if goNested, diags = checkPointerComparison(pass, config, assertionExp, expr, actualArg, handler, oldExpr); goNested { - return false, diags - } else if valid, diags := handleAssertionOnly(pass, config, expr, handler, actualArg, oldExpr, true); !valid { - return false, diags + } else if checkPointerComparison(pass, config, assertionExp, expr, actualArg, handler, reportBuilder) { + return false + } else if !handleAssertionOnly(pass, config, expr, handler, actualArg, reportBuilder) { + return false } else if !config.SuppressTypeCompare { - if found, diags := checkEqualWrongType(pass, assertionExp, actualArg, handler, oldExpr); found { - return false, diags - } + return !checkEqualWrongType(pass, assertionExp, actualArg, handler, reportBuilder) } - return true, nil + return true } -func checkMatchError(pass *analysis.Pass, origExp *ast.CallExpr, actualArg ast.Expr, handler gomegahandler.Handler, oldExpr string) (bool, []analysis.Diagnostic) { +func checkMatchError(pass *analysis.Pass, origExp *ast.CallExpr, actualArg ast.Expr, handler gomegahandler.Handler, reportBuilder *reports.Builder) bool { matcher, ok := origExp.Args[0].(*ast.CallExpr) if !ok { - return false, nil + return false } - return doCheckMatchError(pass, origExp, matcher, actualArg, handler, oldExpr) + return doCheckMatchError(pass, origExp, matcher, actualArg, handler, reportBuilder) } -func doCheckMatchError(pass *analysis.Pass, origExp *ast.CallExpr, matcher *ast.CallExpr, actualArg ast.Expr, handler gomegahandler.Handler, oldExpr string) (bool, []analysis.Diagnostic) { +func doCheckMatchError(pass *analysis.Pass, origExp *ast.CallExpr, matcher *ast.CallExpr, actualArg ast.Expr, handler gomegahandler.Handler, reportBuilder *reports.Builder) bool { name, ok := handler.GetActualFuncName(matcher) if !ok { - return false, nil + return false } switch name { case matchError: case not: nested, ok := matcher.Args[0].(*ast.CallExpr) if !ok { - return false, nil + return false } - return doCheckMatchError(pass, origExp, nested, actualArg, handler, oldExpr) + return doCheckMatchError(pass, origExp, nested, actualArg, handler, reportBuilder) case and, or: res := false - var diagnostics []analysis.Diagnostic for _, arg := range matcher.Args { if nested, ok := arg.(*ast.CallExpr); ok { - if valid, diag := doCheckMatchError(pass, origExp, nested, actualArg, handler, oldExpr); valid { + if valid := doCheckMatchError(pass, origExp, nested, actualArg, handler, reportBuilder); valid { res = true - if len(diag) > 0 { - diagnostics = append(diagnostics, diag...) - } } } } - return res, diagnostics + return res default: - return false, nil + return false } - var diagnostics []analysis.Diagnostic if !isExprError(pass, actualArg) { - diagnostics = append(diagnostics, reportNoFix(origExp.Pos(), matchErrorArgWrongType, goFmt(pass.Fset, actualArg))) + reportBuilder.AddIssue(false, matchErrorArgWrongType, goFmt(pass.Fset, actualArg)) } expr := astcopy.CallExpr(matcher) validAssertion, requiredParams := checkMatchErrorAssertion(pass, matcher) if !validAssertion { - return true, append(diagnostics, reportNoFix(expr.Pos(), matchErrorWrongTypeAssertion, goFmt(pass.Fset, matcher.Args[0]))) + reportBuilder.AddIssue(false, matchErrorWrongTypeAssertion, goFmt(pass.Fset, matcher.Args[0])) } numParams := len(matcher.Args) @@ -359,14 +345,16 @@ func doCheckMatchError(pass *analysis.Pass, origExp *ast.CallExpr, matcher *ast. if numParams == 2 { t := pass.TypesInfo.TypeOf(matcher.Args[1]) if !gotypes.Identical(t, gotypes.Typ[gotypes.String]) { - return true, append(diagnostics, analysis.Diagnostic{Pos: expr.Pos(), Message: matchErrorNoFuncDescription}) + reportBuilder.AddIssue(false, matchErrorNoFuncDescription) + return true } } - return true, diagnostics + return true } if requiredParams == 2 && numParams == 1 { - return true, append(diagnostics, reportNoFix(expr.Pos(), matchErrorMissingDescription)) + reportBuilder.AddIssue(false, matchErrorMissingDescription) + return true } var newArgsSuggestion = []ast.Expr{expr.Args[0]} @@ -375,7 +363,8 @@ func doCheckMatchError(pass *analysis.Pass, origExp *ast.CallExpr, matcher *ast. } expr.Args = newArgsSuggestion - return true, append(diagnostics, prepareReport(pass, expr, matchErrorRedundantArg, oldExpr)...) + reportBuilder.AddIssue(true, matchErrorRedundantArg) + return true } func checkMatchErrorAssertion(pass *analysis.Pass, matcher *ast.CallExpr) (bool, int) { @@ -427,19 +416,19 @@ func isErrorMatcherValidArg(pass *analysis.Pass, arg ast.Expr) bool { return interfaces.ImplementsGomegaMatcher(t) } -func checkEqualWrongType(pass *analysis.Pass, origExp *ast.CallExpr, actualArg ast.Expr, handler gomegahandler.Handler, old string) (bool, []analysis.Diagnostic) { +func checkEqualWrongType(pass *analysis.Pass, origExp *ast.CallExpr, actualArg ast.Expr, handler gomegahandler.Handler, reportBuilder *reports.Builder) bool { matcher, ok := origExp.Args[0].(*ast.CallExpr) if !ok { - return false, nil + return false } - return checkEqualDifferentTypes(pass, matcher, actualArg, handler, old, false) + return checkEqualDifferentTypes(pass, matcher, actualArg, handler, false, reportBuilder) } -func checkEqualDifferentTypes(pass *analysis.Pass, matcher *ast.CallExpr, actualArg ast.Expr, handler gomegahandler.Handler, old string, parentPointer bool) (bool, []analysis.Diagnostic) { +func checkEqualDifferentTypes(pass *analysis.Pass, matcher *ast.CallExpr, actualArg ast.Expr, handler gomegahandler.Handler, parentPointer bool, reportBuilder *reports.Builder) bool { matcherFuncName, ok := handler.GetActualFuncName(matcher) if !ok { - return false, nil + return false } actualType := pass.TypesInfo.TypeOf(actualArg) @@ -448,34 +437,30 @@ func checkEqualDifferentTypes(pass *analysis.Pass, matcher *ast.CallExpr, actual case equal, beIdenticalTo: // continue case and, or: foundIssue := false - var diagnostics []analysis.Diagnostic for _, nestedExp := range matcher.Args { nested, ok := nestedExp.(*ast.CallExpr) if !ok { continue } - if found, diags := checkEqualDifferentTypes(pass, nested, actualArg, handler, old, parentPointer); found { - if len(diags) > 0 { - diagnostics = append(diagnostics, diags...) - } + if checkEqualDifferentTypes(pass, nested, actualArg, handler, parentPointer, reportBuilder) { foundIssue = true } } - return foundIssue, diagnostics + return foundIssue case withTransform: nested, ok := matcher.Args[1].(*ast.CallExpr) if !ok { - return false, nil + return false } matcherFuncName, ok = handler.GetActualFuncName(nested) switch matcherFuncName { case equal, beIdenticalTo: case not: - return checkEqualDifferentTypes(pass, nested, actualArg, handler, old, parentPointer) + return checkEqualDifferentTypes(pass, nested, actualArg, handler, parentPointer, reportBuilder) default: - return false, nil + return false } if t := getFuncType(pass, matcher.Args[0]); t != nil { @@ -483,29 +468,29 @@ func checkEqualDifferentTypes(pass *analysis.Pass, matcher *ast.CallExpr, actual matcher = nested if !ok { - return false, nil + return false } } else { - return checkEqualDifferentTypes(pass, nested, actualArg, handler, old, parentPointer) + return checkEqualDifferentTypes(pass, nested, actualArg, handler, parentPointer, reportBuilder) } case not: nested, ok := matcher.Args[0].(*ast.CallExpr) if !ok { - return false, nil + return false } - return checkEqualDifferentTypes(pass, nested, actualArg, handler, old, parentPointer) + return checkEqualDifferentTypes(pass, nested, actualArg, handler, parentPointer, reportBuilder) case haveValue: nested, ok := matcher.Args[0].(*ast.CallExpr) if !ok { - return false, nil + return false } - return checkEqualDifferentTypes(pass, nested, actualArg, handler, old, true) + return checkEqualDifferentTypes(pass, nested, actualArg, handler, true, reportBuilder) default: - return false, nil + return false } matcherValue := matcher.Args[0] @@ -524,13 +509,14 @@ func checkEqualDifferentTypes(pass *analysis.Pass, matcher *ast.CallExpr, actual if !reflect.DeepEqual(matcherType, actualType) { // Equal can handle comparison of interface and a value that implements it if isImplementing(matcherType, actualType) || isImplementing(actualType, matcherType) { - return false, nil + return false } - return true, []analysis.Diagnostic{reportNoFix(matcher.Pos(), compareDifferentTypes, matcherFuncName, actualType, matcherType)} + reportBuilder.AddIssue(false, compareDifferentTypes, matcherFuncName, actualType, matcherType) + return true } - return false, nil + return false } func getFuncType(pass *analysis.Pass, expr ast.Expr) gotypes.Type { @@ -571,18 +557,18 @@ func isImplementing(ifs, impl gotypes.Type) bool { } // be careful - never change origExp!!! only modify its clone, expr!!! -func checkPointerComparison(pass *analysis.Pass, config types.Config, origExp *ast.CallExpr, expr *ast.CallExpr, actualArg ast.Expr, handler gomegahandler.Handler, oldExpr string) (bool, []analysis.Diagnostic) { +func checkPointerComparison(pass *analysis.Pass, config types.Config, origExp *ast.CallExpr, expr *ast.CallExpr, actualArg ast.Expr, handler gomegahandler.Handler, reportBuilder *reports.Builder) bool { if !isPointer(pass, actualArg) { - return false, nil + return false } matcher, ok := origExp.Args[0].(*ast.CallExpr) if !ok { - return false, nil + return false } matcherFuncName, ok := handler.GetActualFuncName(matcher) if !ok { - return false, nil + return false } // not using recurse here, since we need the original expression, in order to get the TypeInfo, while we should not @@ -592,12 +578,12 @@ func checkPointerComparison(pass *analysis.Pass, config types.Config, origExp *a expr.Args[0] = expr.Args[0].(*ast.CallExpr).Args[0] matcher, ok = matcher.Args[0].(*ast.CallExpr) if !ok { - return false, nil + return false } matcherFuncName, ok = handler.GetActualFuncName(matcher) if !ok { - return false, nil + return false } } @@ -605,34 +591,35 @@ func checkPointerComparison(pass *analysis.Pass, config types.Config, origExp *a case equal, beIdenticalTo, beEquivalentTo: arg := matcher.Args[0] if isPointer(pass, arg) { - return false, nil + return false } if isNil(arg) { - return false, nil + return false } if isInterface(pass, arg) { - return false, nil + return false } case beFalse, beTrue, beNumerically: default: - return false, nil + return false } - handleAssertionOnly(pass, config, expr, handler, actualArg, oldExpr, false) + handleAssertionOnly(pass, config, expr, handler, actualArg, reportBuilder) args := []ast.Expr{astcopy.CallExpr(expr.Args[0].(*ast.CallExpr))} handler.ReplaceFunction(expr.Args[0].(*ast.CallExpr), ast.NewIdent(haveValue)) expr.Args[0].(*ast.CallExpr).Args = args - return true, prepareReport(pass, expr, comparePointerToValue, oldExpr) + reportBuilder.AddIssue(true, comparePointerToValue) + return true } // check async assertion does not assert function call. This is a real bug in the test. In this case, the assertion is // done on the returned value, instead of polling the result of a function, for instance. -func checkAsyncAssertion(pass *analysis.Pass, config types.Config, expr *ast.CallExpr, actualExpr *ast.CallExpr, handler gomegahandler.Handler, oldExpr string) (bool, []analysis.Diagnostic) { +func checkAsyncAssertion(pass *analysis.Pass, config types.Config, expr *ast.CallExpr, actualExpr *ast.CallExpr, handler gomegahandler.Handler, reportBuilder *reports.Builder) bool { funcName, ok := handler.GetActualFuncName(actualExpr) if !ok { - return false, nil + return false } var funcIndex int @@ -642,7 +629,7 @@ func checkAsyncAssertion(pass *analysis.Pass, config types.Config, expr *ast.Cal case eventuallyWithOffset, consistentlyWithOffset: funcIndex = 1 default: - return false, nil + return false } if !config.SuppressAsync && len(actualExpr.Args) > funcIndex { @@ -679,16 +666,16 @@ func checkAsyncAssertion(pass *analysis.Pass, config types.Config, expr *ast.Cal actualExpr.Args[funcIndex] = fun.Fun } - _, diags := handleAssertionOnly(pass, config, expr, handler, actualExpr, oldExpr, false) - diags = append(diags, prepareReport(pass, expr, fmt.Sprintf(valueInEventually, funcName, funcName)+"; consider using `%s` instead", oldExpr)...) - return true, diags + handleAssertionOnly(pass, config, expr, handler, actualExpr, reportBuilder) + reportBuilder.AddIssue(true, valueInEventually, funcName, funcName) + return true } } } } - _, diags := handleAssertionOnly(pass, config, expr, handler, actualExpr, oldExpr, false) - return true, diags + handleAssertionOnly(pass, config, expr, handler, actualExpr, reportBuilder) + return true } func isValidAsyncValueType(t gotypes.Type) bool { @@ -742,15 +729,15 @@ func startCheckComparison(exp *ast.CallExpr, handler gomegahandler.Handler) (*as return matcher, true } -func checkComparison(exp *ast.CallExpr, pass *analysis.Pass, matcher *ast.CallExpr, handler gomegahandler.Handler, first ast.Expr, second ast.Expr, op token.Token, oldExp string) (bool, []analysis.Diagnostic) { +func checkComparison(exp *ast.CallExpr, pass *analysis.Pass, matcher *ast.CallExpr, handler gomegahandler.Handler, first ast.Expr, second ast.Expr, op token.Token, reportBuilder *reports.Builder) bool { fun, ok := exp.Fun.(*ast.SelectorExpr) if !ok { - return true, nil + return true } call := handler.GetActualExpr(fun) if call == nil { - return true, nil + return true } switch op { @@ -762,7 +749,7 @@ func checkComparison(exp *ast.CallExpr, pass *analysis.Pass, matcher *ast.CallEx handleEqualComparison(pass, matcher, first, second, handler) case token.GTR, token.GEQ, token.LSS, token.LEQ: if !isNumeric(pass, first) { - return true, nil + return true } handler.ReplaceFunction(matcher, ast.NewIdent(beNumerically)) matcher.Args = []ast.Expr{ @@ -770,11 +757,12 @@ func checkComparison(exp *ast.CallExpr, pass *analysis.Pass, matcher *ast.CallEx second, } default: - return true, nil + return true } call.Args = []ast.Expr{first} - return false, prepareReport(pass, exp, wrongCompareWarningTemplate, oldExp) + reportBuilder.AddIssue(true, wrongCompareWarningTemplate) + return false } func handleEqualComparison(pass *analysis.Pass, matcher *ast.CallExpr, first ast.Expr, second ast.Expr, handler gomegahandler.Handler) { @@ -795,13 +783,13 @@ func handleEqualComparison(pass *analysis.Pass, matcher *ast.CallExpr, first ast } } -func handleLenComparison(pass *analysis.Pass, exp *ast.CallExpr, matcher *ast.CallExpr, first ast.Expr, second ast.Expr, op token.Token, handler gomegahandler.Handler, oldExpr string) (bool, []analysis.Diagnostic) { +func handleLenComparison(pass *analysis.Pass, exp *ast.CallExpr, matcher *ast.CallExpr, first ast.Expr, second ast.Expr, op token.Token, handler gomegahandler.Handler, reportBuilder *reports.Builder) bool { switch op { case token.EQL: case token.NEQ: reverseAssertionFuncLogic(exp) default: - return false, nil + return false } var eql *ast.Ident @@ -815,14 +803,15 @@ func handleLenComparison(pass *analysis.Pass, exp *ast.CallExpr, matcher *ast.Ca handler.ReplaceFunction(matcher, eql) firstLen, ok := first.(*ast.CallExpr) // assuming it's len() if !ok { - return false, nil // should never happen + return false // should never happen } val := firstLen.Args[0] fun := handler.GetActualExpr(exp.Fun.(*ast.SelectorExpr)) fun.Args = []ast.Expr{val} - return true, prepareReport(pass, exp, wrongLengthWarningTemplate, oldExpr) + reportBuilder.AddIssue(true, wrongLengthWarningTemplate) + return true } // Check if the "actual" argument is a call to the golang built-in len() function @@ -837,85 +826,86 @@ func isActualIsLenFunc(actualArg ast.Expr) bool { } // Check if matcher function is in one of the patterns we want to avoid -func checkLengthMatcher(exp *ast.CallExpr, pass *analysis.Pass, handler gomegahandler.Handler, oldExp string) (bool, []analysis.Diagnostic) { +func checkLengthMatcher(exp *ast.CallExpr, pass *analysis.Pass, handler gomegahandler.Handler, reportBuilder *reports.Builder) bool { matcher, ok := exp.Args[0].(*ast.CallExpr) if !ok { - return true, nil + return true } matcherFuncName, ok := handler.GetActualFuncName(matcher) if !ok { - return true, nil + return true } switch matcherFuncName { case equal: - return false, handleEqualMatcher(matcher, pass, exp, handler, oldExp) + handleEqualMatcher(matcher, pass, exp, handler, reportBuilder) + return false case beZero: - return false, handleBeZero(pass, exp, handler, oldExp) + handleBeZero(exp, handler, reportBuilder) + return false case beNumerically: - return handleBeNumerically(matcher, pass, exp, handler, oldExp) + return handleBeNumerically(matcher, pass, exp, handler, reportBuilder) case not: reverseAssertionFuncLogic(exp) exp.Args[0] = exp.Args[0].(*ast.CallExpr).Args[0] - return checkLengthMatcher(exp, pass, handler, oldExp) + return checkLengthMatcher(exp, pass, handler, reportBuilder) default: - return true, nil + return true } } // Check if matcher function is in one of the patterns we want to avoid -func checkNilMatcher(exp *ast.CallExpr, pass *analysis.Pass, nilable ast.Expr, handler gomegahandler.Handler, notEqual bool, oldExp string) (bool, []analysis.Diagnostic) { +func checkNilMatcher(exp *ast.CallExpr, pass *analysis.Pass, nilable ast.Expr, handler gomegahandler.Handler, notEqual bool, reportBuilder *reports.Builder) bool { matcher, ok := exp.Args[0].(*ast.CallExpr) if !ok { - return true, nil + return true } matcherFuncName, ok := handler.GetActualFuncName(matcher) if !ok { - return true, nil + return true } - var diagnostics []analysis.Diagnostic switch matcherFuncName { case equal: - diagnostics = handleEqualNilMatcher(matcher, pass, exp, handler, nilable, notEqual, oldExp) + handleEqualNilMatcher(matcher, pass, exp, handler, nilable, notEqual, reportBuilder) case beTrue: - diagnostics = handleNilBeBoolMatcher(pass, exp, handler, nilable, notEqual, oldExp) + handleNilBeBoolMatcher(pass, exp, handler, nilable, notEqual, reportBuilder) case beFalse: reverseAssertionFuncLogic(exp) - diagnostics = handleNilBeBoolMatcher(pass, exp, handler, nilable, notEqual, oldExp) + handleNilBeBoolMatcher(pass, exp, handler, nilable, notEqual, reportBuilder) case not: reverseAssertionFuncLogic(exp) exp.Args[0] = exp.Args[0].(*ast.CallExpr).Args[0] - return checkNilMatcher(exp, pass, nilable, handler, notEqual, oldExp) + return checkNilMatcher(exp, pass, nilable, handler, notEqual, reportBuilder) default: - return true, nil + return true } - return false, diagnostics + return false } -func checkNilError(pass *analysis.Pass, assertionExp *ast.CallExpr, handler gomegahandler.Handler, actualArg ast.Expr, oldExpr string) (bool, []analysis.Diagnostic) { +func checkNilError(pass *analysis.Pass, assertionExp *ast.CallExpr, handler gomegahandler.Handler, actualArg ast.Expr, reportBuilder *reports.Builder) bool { if len(assertionExp.Args) == 0 { - return true, nil + return true } equalFuncExpr, ok := assertionExp.Args[0].(*ast.CallExpr) if !ok { - return true, nil + return true } funcName, ok := handler.GetActualFuncName(equalFuncExpr) if !ok { - return true, nil + return true } switch funcName { @@ -923,20 +913,20 @@ func checkNilError(pass *analysis.Pass, assertionExp *ast.CallExpr, handler gome case equal: if len(equalFuncExpr.Args) == 0 { - return true, nil + return true } nilable, ok := equalFuncExpr.Args[0].(*ast.Ident) if !ok || nilable.Name != "nil" { - return true, nil + return true } case not: reverseAssertionFuncLogic(assertionExp) assertionExp.Args[0] = assertionExp.Args[0].(*ast.CallExpr).Args[0] - return checkNilError(pass, assertionExp, handler, actualArg, oldExpr) + return checkNilError(pass, assertionExp, handler, actualArg, reportBuilder) default: - return true, nil + return true } var newFuncName string @@ -950,7 +940,8 @@ func checkNilError(pass *analysis.Pass, assertionExp *ast.CallExpr, handler gome handler.ReplaceFunction(equalFuncExpr, ast.NewIdent(newFuncName)) equalFuncExpr.Args = nil - return false, prepareReport(pass, assertionExp, wrongErrWarningTemplate, oldExpr) + reportBuilder.AddIssue(true, wrongErrWarningTemplate) + return false } // handleAssertionOnly checks use-cases when the actual value is valid, but only the assertion should be fixed @@ -960,30 +951,30 @@ func checkNilError(pass *analysis.Pass, assertionExp *ast.CallExpr, handler gome // Equal(true) => BeTrue() // Equal(false) => BeFalse() // HaveLen(0) => BeEmpty() -func handleAssertionOnly(pass *analysis.Pass, config types.Config, expr *ast.CallExpr, handler gomegahandler.Handler, actualArg ast.Expr, oldExpr string, shouldReport bool) (bool, []analysis.Diagnostic) { +func handleAssertionOnly(pass *analysis.Pass, config types.Config, expr *ast.CallExpr, handler gomegahandler.Handler, actualArg ast.Expr, reportBuilder *reports.Builder) bool { if len(expr.Args) == 0 { - return true, nil + return true } equalFuncExpr, ok := expr.Args[0].(*ast.CallExpr) if !ok { - return true, nil + return true } funcName, ok := handler.GetActualFuncName(equalFuncExpr) if !ok { - return true, nil + return true } switch funcName { case equal: if len(equalFuncExpr.Args) == 0 { - return true, nil + return true } tkn, ok := equalFuncExpr.Args[0].(*ast.Ident) if !ok { - return true, nil + return true } var replacement string @@ -991,7 +982,7 @@ func handleAssertionOnly(pass *analysis.Pass, config types.Config, expr *ast.Cal switch tkn.Name { case "nil": if config.SuppressNil { - return true, nil + return true } replacement = beNil template = wrongNilWarningTemplate @@ -1007,43 +998,46 @@ func handleAssertionOnly(pass *analysis.Pass, config types.Config, expr *ast.Cal } template = wrongBoolWarningTemplate default: - return true, nil + return true } handler.ReplaceFunction(equalFuncExpr, ast.NewIdent(replacement)) equalFuncExpr.Args = nil - return false, prepareReport(pass, expr, template, oldExpr) + reportBuilder.AddIssue(true, template) + return false case beFalse: if isNegativeAssertion(expr) { reverseAssertionFuncLogic(expr) handler.ReplaceFunction(equalFuncExpr, ast.NewIdent(beTrue)) - return false, prepareReport(pass, expr, doubleNegativeWarningTemplate, oldExpr) + reportBuilder.AddIssue(true, doubleNegativeWarningTemplate) + return false } - return false, nil + return false case haveLen: if config.AllowHaveLen0 { - return true, nil + return true } if len(equalFuncExpr.Args) > 0 { if isZero(pass, equalFuncExpr.Args[0]) { handler.ReplaceFunction(equalFuncExpr, ast.NewIdent(beEmpty)) equalFuncExpr.Args = nil - return false, prepareReport(pass, expr, wrongLengthWarningTemplate, oldExpr) + reportBuilder.AddIssue(true, wrongLengthWarningTemplate) + return false } } - return true, nil + return true case not: reverseAssertionFuncLogic(expr) expr.Args[0] = expr.Args[0].(*ast.CallExpr).Args[0] - return handleAssertionOnly(pass, config, expr, handler, actualArg, oldExpr, shouldReport) + return handleAssertionOnly(pass, config, expr, handler, actualArg, reportBuilder) default: - return true, nil + return true } } @@ -1134,7 +1128,7 @@ func replaceNilActualArg(actualExpr *ast.CallExpr, handler gomegahandler.Handler } // For the BeNumerically matcher, we want to avoid the assertion of length to be > 0 or >= 1, or just == number -func handleBeNumerically(matcher *ast.CallExpr, pass *analysis.Pass, exp *ast.CallExpr, handler gomegahandler.Handler, oldExp string) (bool, []analysis.Diagnostic) { +func handleBeNumerically(matcher *ast.CallExpr, pass *analysis.Pass, exp *ast.CallExpr, handler gomegahandler.Handler, reportBuilder *reports.Builder) bool { opExp, ok1 := matcher.Args[0].(*ast.BasicLit) valExp, ok2 := matcher.Args[1].(*ast.BasicLit) @@ -1146,20 +1140,20 @@ func handleBeNumerically(matcher *ast.CallExpr, pass *analysis.Pass, exp *ast.Ca reverseAssertionFuncLogic(exp) handler.ReplaceFunction(exp.Args[0].(*ast.CallExpr), ast.NewIdent(beEmpty)) exp.Args[0].(*ast.CallExpr).Args = nil - - return false, reportLengthAssertion(pass, exp, handler, oldExp) + reportLengthAssertion(exp, handler, reportBuilder) + return false } else if op == `"=="` { chooseNumericMatcher(pass, exp, handler, valExp) - - return false, reportLengthAssertion(pass, exp, handler, oldExp) + reportLengthAssertion(exp, handler, reportBuilder) + return false } else if op == `"!="` { reverseAssertionFuncLogic(exp) chooseNumericMatcher(pass, exp, handler, valExp) - - return false, reportLengthAssertion(pass, exp, handler, oldExp) + reportLengthAssertion(exp, handler, reportBuilder) + return false } } - return true, nil + return true } func chooseNumericMatcher(pass *analysis.Pass, exp *ast.CallExpr, handler gomegahandler.Handler, valExp ast.Expr) { @@ -1183,7 +1177,7 @@ func isNegativeAssertion(exp *ast.CallExpr) bool { return reverseassertion.IsNegativeLogic(assertionFunc.Name) } -func handleEqualMatcher(matcher *ast.CallExpr, pass *analysis.Pass, exp *ast.CallExpr, handler gomegahandler.Handler, oldExp string) []analysis.Diagnostic { +func handleEqualMatcher(matcher *ast.CallExpr, pass *analysis.Pass, exp *ast.CallExpr, handler gomegahandler.Handler, reportBuilder *reports.Builder) { equalTo, ok := matcher.Args[0].(*ast.BasicLit) if ok { chooseNumericMatcher(pass, exp, handler, equalTo) @@ -1191,25 +1185,25 @@ func handleEqualMatcher(matcher *ast.CallExpr, pass *analysis.Pass, exp *ast.Cal handler.ReplaceFunction(exp.Args[0].(*ast.CallExpr), ast.NewIdent(haveLen)) exp.Args[0].(*ast.CallExpr).Args = []ast.Expr{matcher.Args[0]} } - return reportLengthAssertion(pass, exp, handler, oldExp) + reportLengthAssertion(exp, handler, reportBuilder) } -func handleBeZero(pass *analysis.Pass, exp *ast.CallExpr, handler gomegahandler.Handler, oldExp string) []analysis.Diagnostic { +func handleBeZero(exp *ast.CallExpr, handler gomegahandler.Handler, reportBuilder *reports.Builder) { exp.Args[0].(*ast.CallExpr).Args = nil handler.ReplaceFunction(exp.Args[0].(*ast.CallExpr), ast.NewIdent(beEmpty)) - return reportLengthAssertion(pass, exp, handler, oldExp) + reportLengthAssertion(exp, handler, reportBuilder) } -func handleEqualNilMatcher(matcher *ast.CallExpr, pass *analysis.Pass, exp *ast.CallExpr, handler gomegahandler.Handler, nilable ast.Expr, notEqual bool, oldExp string) []analysis.Diagnostic { +func handleEqualNilMatcher(matcher *ast.CallExpr, pass *analysis.Pass, exp *ast.CallExpr, handler gomegahandler.Handler, nilable ast.Expr, notEqual bool, reportBuilder *reports.Builder) { equalTo, ok := matcher.Args[0].(*ast.Ident) if !ok { - return nil + return } if equalTo.Name == "false" { reverseAssertionFuncLogic(exp) } else if equalTo.Name != "true" { - return nil + return } newFuncName, isItError := handleNilComparisonErr(pass, exp, nilable) @@ -1217,15 +1211,15 @@ func handleEqualNilMatcher(matcher *ast.CallExpr, pass *analysis.Pass, exp *ast. handler.ReplaceFunction(exp.Args[0].(*ast.CallExpr), ast.NewIdent(newFuncName)) exp.Args[0].(*ast.CallExpr).Args = nil - return reportNilAssertion(pass, exp, handler, nilable, notEqual, oldExp, isItError) + reportNilAssertion(exp, handler, nilable, notEqual, isItError, reportBuilder) } -func handleNilBeBoolMatcher(pass *analysis.Pass, exp *ast.CallExpr, handler gomegahandler.Handler, nilable ast.Expr, notEqual bool, oldExp string) []analysis.Diagnostic { +func handleNilBeBoolMatcher(pass *analysis.Pass, exp *ast.CallExpr, handler gomegahandler.Handler, nilable ast.Expr, notEqual bool, reportBuilder *reports.Builder) { newFuncName, isItError := handleNilComparisonErr(pass, exp, nilable) handler.ReplaceFunction(exp.Args[0].(*ast.CallExpr), ast.NewIdent(newFuncName)) exp.Args[0].(*ast.CallExpr).Args = nil - return reportNilAssertion(pass, exp, handler, nilable, notEqual, oldExp, isItError) + reportNilAssertion(exp, handler, nilable, notEqual, isItError, reportBuilder) } func handleNilComparisonErr(pass *analysis.Pass, exp *ast.CallExpr, nilable ast.Expr) (string, bool) { @@ -1251,18 +1245,18 @@ func isAssertionFunc(name string) bool { return false } -func reportLengthAssertion(pass *analysis.Pass, expr *ast.CallExpr, handler gomegahandler.Handler, oldExpr string) []analysis.Diagnostic { +func reportLengthAssertion(expr *ast.CallExpr, handler gomegahandler.Handler, reportBuilder *reports.Builder) { actualExpr := handler.GetActualExpr(expr.Fun.(*ast.SelectorExpr)) replaceLenActualArg(actualExpr, handler) - return prepareReport(pass, expr, wrongLengthWarningTemplate, oldExpr) + reportBuilder.AddIssue(true, wrongLengthWarningTemplate) } -func reportNilAssertion(pass *analysis.Pass, expr *ast.CallExpr, handler gomegahandler.Handler, nilable ast.Expr, notEqual bool, oldExpr string, isItError bool) []analysis.Diagnostic { +func reportNilAssertion(expr *ast.CallExpr, handler gomegahandler.Handler, nilable ast.Expr, notEqual bool, isItError bool, reportBuilder *reports.Builder) { actualExpr := handler.GetActualExpr(expr.Fun.(*ast.SelectorExpr)) changed := replaceNilActualArg(actualExpr, handler, nilable) if !changed { - return nil + return } if notEqual { @@ -1273,59 +1267,11 @@ func reportNilAssertion(pass *analysis.Pass, expr *ast.CallExpr, handler gomegah template = wrongErrWarningTemplate } - return prepareReport(pass, expr, template, oldExpr) + reportBuilder.AddIssue(true, template) } -func prepareReport(pass *analysis.Pass, expr ast.Expr, messageTemplate, oldExpr string) []analysis.Diagnostic { - newExp := goFmt(pass.Fset, expr) - return []analysis.Diagnostic{ - { - Pos: expr.Pos(), - Message: fmt.Sprintf(messageTemplate, newExp), - SuggestedFixes: []analysis.SuggestedFix{ - { - Message: fmt.Sprintf("should replace %s with %s", oldExpr, newExp), - TextEdits: []analysis.TextEdit{ - { - Pos: expr.Pos(), - End: expr.End(), - NewText: []byte(newExp), - }, - }, - }, - }, - }, - } -} - -func report(pass *analysis.Pass, diagnostics []analysis.Diagnostic) { - switch len(diagnostics) { - case 0: - return - - case 1: - pass.Report(diagnostics[0]) - - default: - // use only the latest SuggestedFix, to avoid conflicts - var fixes []analysis.SuggestedFix - for i := range diagnostics[:len(diagnostics)-1] { - if len(diagnostics[i].SuggestedFixes) > 0 { - fixes = diagnostics[i].SuggestedFixes - diagnostics[i].SuggestedFixes = nil - } - pass.Report(diagnostics[i]) - } - lastDiag := diagnostics[len(diagnostics)-1] - if len(lastDiag.SuggestedFixes) == 0 && len(fixes) > 0 { - lastDiag.SuggestedFixes = fixes - } - pass.Report(lastDiag) - } -} - -func reportNewName(id *ast.Ident, newName string, messageTemplate, oldExpr string) analysis.Diagnostic { - return analysis.Diagnostic{ +func reportNewName(pass *analysis.Pass, id *ast.Ident, newName string, messageTemplate, oldExpr string) { + pass.Report(analysis.Diagnostic{ Pos: id.Pos(), Message: fmt.Sprintf(messageTemplate, newName), SuggestedFixes: []analysis.SuggestedFix{ @@ -1340,18 +1286,18 @@ func reportNewName(id *ast.Ident, newName string, messageTemplate, oldExpr strin }, }, }, - } + }) } -func reportNoFix(pos token.Pos, message string, args ...any) analysis.Diagnostic { +func reportNoFix(pass *analysis.Pass, pos token.Pos, message string, args ...any) { if len(args) > 0 { message = fmt.Sprintf(message, args...) } - return analysis.Diagnostic{ + pass.Report(analysis.Diagnostic{ Pos: pos, Message: message, - } + }) } func getNilableFromComparison(actualArg ast.Expr) (ast.Expr, token.Token) { @@ -1461,28 +1407,20 @@ func isNumeric(pass *analysis.Pass, node ast.Expr) bool { return false } -func checkNoAssertion(expr *ast.CallExpr, handler gomegahandler.Handler) []analysis.Diagnostic { +func checkNoAssertion(pass *analysis.Pass, expr *ast.CallExpr, handler gomegahandler.Handler) { funcName, ok := handler.GetActualFuncName(expr) if ok { - var diagnostics []analysis.Diagnostic - if isActualFunc(funcName) { - diagnostics = []analysis.Diagnostic{reportNoFix(expr.Pos(), missingAssertionMessage, funcName)} - } else if isActualAsyncFunc(funcName) { - diagnostics = []analysis.Diagnostic{reportNoFix(expr.Pos(), missingAsyncAssertionMessage, funcName)} + var allowedFunction string + switch funcName { + case expect, expectWithOffset: + allowedFunction = `"To()", "ToNot()" or "NotTo()"` + case eventually, eventuallyWithOffset, consistently, consistentlyWithOffset: + allowedFunction = `"Should()" or "ShouldNot()"` + case omega: + allowedFunction = `"Should()", "To()", "ShouldNot()", "ToNot()" or "NotTo()"` + default: + return } - return diagnostics + reportNoFix(pass, expr.Pos(), missingAssertionMessage, funcName, allowedFunction) } - return nil -} - -func isActualFunc(name string) bool { - return name == expect || name == expectWithOffset -} - -func isActualAsyncFunc(name string) bool { - switch name { - case eventually, eventuallyWithOffset, consistently, consistentlyWithOffset: - return true - } - return false } diff --git a/reports/report-builder.go b/reports/report-builder.go new file mode 100644 index 0000000..b55de9e --- /dev/null +++ b/reports/report-builder.go @@ -0,0 +1,97 @@ +package reports + +import ( + "bytes" + "fmt" + "go/ast" + "go/printer" + "go/token" + "golang.org/x/tools/go/analysis" + "strings" +) + +type Builder struct { + pos token.Pos + end token.Pos + oldExpr string + issues []string + fixOffer string + suggestFix bool +} + +func NewBuilder(fset *token.FileSet, oldExpr ast.Expr) *Builder { + b := &Builder{ + pos: oldExpr.Pos(), + end: oldExpr.End(), + oldExpr: goFmt(fset, oldExpr), + suggestFix: false, + } + + return b +} + +func (b *Builder) AddIssue(suggestFix bool, issue string, args ...any) { + if len(args) > 0 { + issue = fmt.Sprintf(issue, args...) + } + b.issues = append(b.issues, issue) + + if suggestFix { + b.suggestFix = true + } +} + +func (b *Builder) SetFixOffer(fset *token.FileSet, fixOffer ast.Expr) { + if offer := goFmt(fset, fixOffer); offer != b.oldExpr { + b.fixOffer = offer + } +} + +func (b *Builder) HasReport() bool { + return len(b.issues) > 0 +} + +func (b *Builder) Build() analysis.Diagnostic { + diagnostic := analysis.Diagnostic{ + Pos: b.pos, + Message: b.getMessage(), + } + + if b.suggestFix && len(b.fixOffer) > 0 { + diagnostic.SuggestedFixes = []analysis.SuggestedFix{ + { + Message: fmt.Sprintf("should replace %s with %s", b.oldExpr, b.fixOffer), + TextEdits: []analysis.TextEdit{ + { + Pos: b.pos, + End: b.end, + NewText: []byte(b.fixOffer), + }, + }, + }, + } + } + + return diagnostic +} + +func goFmt(fset *token.FileSet, x ast.Expr) string { + var b bytes.Buffer + _ = printer.Fprint(&b, fset, x) + return b.String() +} + +func (b *Builder) getMessage() string { + sb := strings.Builder{} + sb.WriteString("ginkgo-linter: ") + if len(b.issues) > 1 { + sb.WriteString("multiple issues: ") + } + sb.WriteString(strings.Join(b.issues, "; ")) + + if b.suggestFix && len(b.fixOffer) != 0 { + sb.WriteString(fmt.Sprintf(". Consider using `%s` instead", b.fixOffer)) + } + + return sb.String() +} diff --git a/testdata/src/a/asyncconfig/asyncConfig.go b/testdata/src/a/asyncconfig/asyncConfig.go index 768c51d..ecf8db5 100644 --- a/testdata/src/a/asyncconfig/asyncConfig.go +++ b/testdata/src/a/asyncconfig/asyncConfig.go @@ -24,6 +24,6 @@ var _ = Describe("test async suppress configuration", func() { Eventually(slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) }) It("should trigger comparison waring", func() { - Eventually(slowBool()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(true)) // want `ginkgo-linter: wrong boolean assertion; consider using .Eventually\(slowBool\(\)\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(BeTrue\(\)\). instead` + Eventually(slowBool()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(true)) // want `ginkgo-linter: wrong boolean assertion\. Consider using .Eventually\(slowBool\(\)\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(BeTrue\(\)\). instead` }) }) diff --git a/testdata/src/a/asyncconfig/asyncConfig.gomega.go b/testdata/src/a/asyncconfig/asyncConfig.gomega.go index 7d87aed..c782648 100644 --- a/testdata/src/a/asyncconfig/asyncConfig.gomega.go +++ b/testdata/src/a/asyncconfig/asyncConfig.gomega.go @@ -14,6 +14,6 @@ var _ = Describe("test async suppress configuration", func() { g.Eventually(slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(g.Equal(42)) }) It("should trigger comparison waring", func() { - g.Eventually(slowBool()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(g.Equal(true)) // want `ginkgo-linter: wrong boolean assertion; consider using .g\.Eventually\(slowBool\(\)\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(g\.BeTrue\(\)\). instead` + g.Eventually(slowBool()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(g.Equal(true)) // want `ginkgo-linter: wrong boolean assertion\. Consider using .g\.Eventually\(slowBool\(\)\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(g\.BeTrue\(\)\). instead` }) }) diff --git a/testdata/src/a/boolean/bool.go b/testdata/src/a/boolean/bool.go index 8088754..7a8b1c8 100644 --- a/testdata/src/a/boolean/bool.go +++ b/testdata/src/a/boolean/bool.go @@ -10,18 +10,18 @@ var _ = Describe("boolean warnings", func() { f := false It("check Equal(true/false)", func() { - Expect(t).To(Equal(true)) // want `ginkgo-linter: wrong boolean assertion; consider using .Expect\(t\)\.To\(BeTrue\(\)\). instead` - Expect(f).To(Equal(false)) // want `ginkgo-linter: wrong boolean assertion; consider using .Expect\(f\)\.To\(BeFalse\(\)\). instead` - ExpectWithOffset(2, t).Should(Not(Equal(false))) // want `ginkgo-linter: wrong boolean assertion; consider using .ExpectWithOffset\(2, t\)\.Should\(BeTrue\(\)\). instead` - ExpectWithOffset(2, t).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong boolean assertion; consider using .ExpectWithOffset\(2, t\)\.Should\(BeTrue\(\)\). instead` - Expect(t).WithOffset(2).ToNot(Equal(false)) // want `ginkgo-linter: wrong boolean assertion; consider using .Expect\(t\)\.WithOffset\(2\)\.To\(BeTrue\(\)\). instead` - Expect(t).NotTo(Equal(false)) // want `ginkgo-linter: wrong boolean assertion; consider using .Expect\(t\)\.To\(BeTrue\(\)\). instead` - Expect(f).WithOffset(1).ToNot(Equal(true)) // want `ginkgo-linter: wrong boolean assertion; consider using .Expect\(f\)\.WithOffset\(1\)\.ToNot\(BeTrue\(\)\). instead` + Expect(t).To(Equal(true)) // want `ginkgo-linter: wrong boolean assertion\. Consider using .Expect\(t\)\.To\(BeTrue\(\)\). instead` + Expect(f).To(Equal(false)) // want `ginkgo-linter: wrong boolean assertion\. Consider using .Expect\(f\)\.To\(BeFalse\(\)\). instead` + ExpectWithOffset(2, t).Should(Not(Equal(false))) // want `ginkgo-linter: wrong boolean assertion\. Consider using .ExpectWithOffset\(2, t\)\.Should\(BeTrue\(\)\). instead` + ExpectWithOffset(2, t).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong boolean assertion\. Consider using .ExpectWithOffset\(2, t\)\.Should\(BeTrue\(\)\). instead` + Expect(t).WithOffset(2).ToNot(Equal(false)) // want `ginkgo-linter: wrong boolean assertion\. Consider using .Expect\(t\)\.WithOffset\(2\)\.To\(BeTrue\(\)\). instead` + Expect(t).NotTo(Equal(false)) // want `ginkgo-linter: wrong boolean assertion\. Consider using .Expect\(t\)\.To\(BeTrue\(\)\). instead` + Expect(f).WithOffset(1).ToNot(Equal(true)) // want `ginkgo-linter: wrong boolean assertion\. Consider using .Expect\(f\)\.WithOffset\(1\)\.ToNot\(BeTrue\(\)\). instead` }) It("check double negative", func() { - Expect(t).ToNot(BeFalse()) // want `ginkgo-linter: avoid double negative assertion; consider using .Expect\(t\)\.To\(BeTrue\(\)\). instead` - Expect(t).NotTo(BeFalse()) // want `ginkgo-linter: avoid double negative assertion; consider using .Expect\(t\)\.To\(BeTrue\(\)\). instead` - Expect(t).WithOffset(2).ShouldNot(BeFalse()) // want `ginkgo-linter: avoid double negative assertion; consider using .Expect\(t\)\.WithOffset\(2\)\.Should\(BeTrue\(\)\). instead` + Expect(t).ToNot(BeFalse()) // want `ginkgo-linter: avoid double negative assertion\. Consider using .Expect\(t\)\.To\(BeTrue\(\)\). instead` + Expect(t).NotTo(BeFalse()) // want `ginkgo-linter: avoid double negative assertion\. Consider using .Expect\(t\)\.To\(BeTrue\(\)\). instead` + Expect(t).WithOffset(2).ShouldNot(BeFalse()) // want `ginkgo-linter: avoid double negative assertion\. Consider using .Expect\(t\)\.WithOffset\(2\)\.Should\(BeTrue\(\)\). instead` }) }) diff --git a/testdata/src/a/comparetypes/comparetypes.gomega_test.go b/testdata/src/a/comparetypes/comparetypes.gomega_test.go index 2a262a6..666ea5c 100644 --- a/testdata/src/a/comparetypes/comparetypes.gomega_test.go +++ b/testdata/src/a/comparetypes/comparetypes.gomega_test.go @@ -43,17 +43,17 @@ var _ = Describe("compare different types", func() { gomega.Expect(a).ShouldNot(gomega.Equal(5)) gomega.Expect(a).ShouldNot(gomega.Equal(uint(5))) // want `ginkgo-linter: use Equal with different types: Comparing int with uint; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` gomega.Expect(fint64()).ShouldNot(gomega.Equal(uint64(5))) // want `ginkgo-linter: use Equal with different types: Comparing int64 with uint64; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` - gomega.Expect(fmytype()).ShouldNot(gomega.Equal(uint64(5))) // want `ginkgo-linter: use Equal with different types: Comparing a/comparetypes_test.mytype with uint64; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` + gomega.Expect(fmytype()).ShouldNot(gomega.Equal(uint64(5))) // want `ginkgo-linter: use Equal with different types: Comparing a/comparetypes_test\.mytype with uint64; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` gomega.Expect(a).ShouldNot(gomega.Equal(int32(5))) // want `ginkgo-linter: use Equal with different types: Comparing int with int32; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` gomega.Expect(a).ShouldNot(gomega.Equal(uint8(5))) // want `ginkgo-linter: use Equal with different types: Comparing int with uint8; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` - gomega.Expect(a).ShouldNot(gomega.Equal(mytype(5))) // want `ginkgo-linter: use Equal with different types: Comparing int with a/comparetypes_test.mytype; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` - gomega.Expect(5).ShouldNot(gomega.Equal(mytype(5))) // want `ginkgo-linter: use Equal with different types: Comparing int with a/comparetypes_test.mytype; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` + gomega.Expect(a).ShouldNot(gomega.Equal(mytype(5))) // want `ginkgo-linter: use Equal with different types: Comparing int with a/comparetypes_test\.mytype; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` + gomega.Expect(5).ShouldNot(gomega.Equal(mytype(5))) // want `ginkgo-linter: use Equal with different types: Comparing int with a/comparetypes_test\.mytype; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` b := int16(5) gomega.Expect(a).ShouldNot(gomega.Equal(b)) // want `ginkgo-linter: use Equal with different types: Comparing int with int16; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` c := mytype(5) - gomega.Expect(a).ShouldNot(gomega.Equal(c)) // want `ginkgo-linter: use Equal with different types: Comparing int with a/comparetypes_test.mytype; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` + gomega.Expect(a).ShouldNot(gomega.Equal(c)) // want `ginkgo-linter: use Equal with different types: Comparing int with a/comparetypes_test\.mytype; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` }) It("compare interfaces", func() { @@ -72,8 +72,8 @@ var _ = Describe("compare different types", func() { gomega.Expect(pa).Should(gomega.HaveValue(gomega.Equal(uint64(5)))) // want `ginkgo-linter: use Equal with different types: Comparing int with uint64; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` gomega.Expect(a).Should(gomega.Not(gomega.Equal(uint64(5)))) // want `ginkgo-linter: use Equal with different types: Comparing int with uint64; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` - gomega.Expect(a).Should(gomega.And(gomega.Equal(uint64(5)), gomega.Not(gomega.Equal(int32(6))))) // want `ginkgo-linter: use Equal with different types: Comparing int with uint64; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` `ginkgo-linter: use Equal with different types: Comparing int with int32; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` - gomega.Expect(a).Should(gomega.Or(gomega.Equal(uint64(5)), gomega.Not(gomega.Equal(int32(6))), gomega.Not(gomega.Equal(int8(4))))) // want `ginkgo-linter: use Equal with different types: Comparing int with uint64; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` `ginkgo-linter: use Equal with different types: Comparing int with int32; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` `ginkgo-linter: use Equal with different types: Comparing int with int8; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` + gomega.Expect(a).Should(gomega.And(gomega.Equal(uint64(5)), gomega.Not(gomega.Equal(int32(6))))) // want `ginkgo-linter: multiple issues: use Equal with different types: Comparing int with uint64; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\); use Equal with different types: Comparing int with int32; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` + gomega.Expect(a).Should(gomega.Or(gomega.Equal(uint64(5)), gomega.Not(gomega.Equal(int32(6))), gomega.Not(gomega.Equal(int8(4))))) // want `ginkgo-linter: multiple issues: use Equal with different types: Comparing int with uint64; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\); use Equal with different types: Comparing int with int32; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\); use Equal with different types: Comparing int with int8; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` gomega.Expect(a).Should(gomega.WithTransform(func(i int) int { return i + 1 }, gomega.Equal(uint(6)))) // want `ginkgo-linter: use Equal with different types: Comparing int with uint; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` }) diff --git a/testdata/src/a/comparetypes/comparetypes_test.go b/testdata/src/a/comparetypes/comparetypes_test.go index 6c28fef..f32b2f8 100644 --- a/testdata/src/a/comparetypes/comparetypes_test.go +++ b/testdata/src/a/comparetypes/comparetypes_test.go @@ -18,17 +18,17 @@ var _ = Describe("compare different types", func() { Expect(a).ShouldNot(Equal(5)) Expect(a).ShouldNot(Equal(uint(5))) // want `ginkgo-linter: use Equal with different types: Comparing int with uint; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` Expect(fint64()).ShouldNot(Equal(uint64(5))) // want `ginkgo-linter: use Equal with different types: Comparing int64 with uint64; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` - Expect(fmytype()).ShouldNot(Equal(uint64(5))) // want `ginkgo-linter: use Equal with different types: Comparing a/comparetypes_test.mytype with uint64; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` + Expect(fmytype()).ShouldNot(Equal(uint64(5))) // want `ginkgo-linter: use Equal with different types: Comparing a/comparetypes_test\.mytype with uint64; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` Expect(a).ShouldNot(Equal(int32(5))) // want `ginkgo-linter: use Equal with different types: Comparing int with int32; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` Expect(a).ShouldNot(Equal(uint8(5))) // want `ginkgo-linter: use Equal with different types: Comparing int with uint8; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` - Expect(a).ShouldNot(Equal(mytype(5))) // want `ginkgo-linter: use Equal with different types: Comparing int with a/comparetypes_test.mytype; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` - Expect(5).ShouldNot(Equal(mytype(5))) // want `ginkgo-linter: use Equal with different types: Comparing int with a/comparetypes_test.mytype; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` + Expect(a).ShouldNot(Equal(mytype(5))) // want `ginkgo-linter: use Equal with different types: Comparing int with a/comparetypes_test\.mytype; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` + Expect(5).ShouldNot(Equal(mytype(5))) // want `ginkgo-linter: use Equal with different types: Comparing int with a/comparetypes_test\.mytype; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` b := int16(5) Expect(a).ShouldNot(Equal(b)) // want `ginkgo-linter: use Equal with different types: Comparing int with int16; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` c := mytype(5) - Expect(a).ShouldNot(Equal(c)) // want `ginkgo-linter: use Equal with different types: Comparing int with a/comparetypes_test.mytype; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` + Expect(a).ShouldNot(Equal(c)) // want `ginkgo-linter: use Equal with different types: Comparing int with a/comparetypes_test\.mytype; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` }) It("compare interfaces", func() { @@ -47,8 +47,8 @@ var _ = Describe("compare different types", func() { Expect(pa).Should(HaveValue(Equal(uint64(5)))) // want `ginkgo-linter: use Equal with different types: Comparing int with uint64; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` Expect(a).Should(Not(Equal(uint64(5)))) // want `ginkgo-linter: use Equal with different types: Comparing int with uint64; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` - Expect(a).Should(And(Equal(uint64(5)), Not(Equal(int32(6))))) // want `ginkgo-linter: use Equal with different types: Comparing int with uint64; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` `ginkgo-linter: use Equal with different types: Comparing int with int32; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` - Expect(a).Should(Or(Equal(uint64(5)), Not(Equal(int32(6))), Not(Equal(int8(4))))) // want `ginkgo-linter: use Equal with different types: Comparing int with uint64; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` `ginkgo-linter: use Equal with different types: Comparing int with int32; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` `ginkgo-linter: use Equal with different types: Comparing int with int8; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` + Expect(a).Should(And(Equal(uint64(5)), Not(Equal(int32(6))))) // want `ginkgo-linter: multiple issues: use Equal with different types: Comparing int with uint64; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\); use Equal with different types: Comparing int with int32; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` + Expect(a).Should(Or(Equal(uint64(5)), Not(Equal(int32(6))), Not(Equal(int8(4))))) // want `ginkgo-linter: multiple issues: use Equal with different types: Comparing int with uint64; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\); use Equal with different types: Comparing int with int32; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\); use Equal with different types: Comparing int with int8; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` Expect(a).Should(WithTransform(func(i int) int { return i + 1 }, Equal(uint(6)))) // want `ginkgo-linter: use Equal with different types: Comparing int with uint; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` }) diff --git a/testdata/src/a/comparison/comparison.go b/testdata/src/a/comparison/comparison.go index 49e9ff8..eb2f0b2 100644 --- a/testdata/src/a/comparison/comparison.go +++ b/testdata/src/a/comparison/comparison.go @@ -26,93 +26,93 @@ func retNum() int { var _ = Describe("remove comparison", func() { Context("equal/not equal cases", func() { It("should find comparison assertions", func() { - Expect(exampleInt == 0).To(Equal(false)) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\).ToNot\(BeZero\(\)\). instead` - Expect(0 == exampleInt).To(Equal(false)) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\).ToNot\(BeZero\(\)\). instead` - Expect(exampleInt == 0).To(BeFalse()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\).ToNot\(BeZero\(\)\). instead` + Expect(exampleInt == 0).To(Equal(false)) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.ToNot\(BeZero\(\)\). instead` + Expect(0 == exampleInt).To(Equal(false)) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.ToNot\(BeZero\(\)\). instead` + Expect(exampleInt == 0).To(BeFalse()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.ToNot\(BeZero\(\)\). instead` - Expect(exampleInt == constZero).To(Equal(false)) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\).ToNot\(BeZero\(\)\). instead` - Expect(constZero == exampleInt).To(Equal(false)) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\).ToNot\(BeZero\(\)\). instead` - Expect(exampleInt == constZero).To(BeFalse()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\).ToNot\(BeZero\(\)\). instead` + Expect(exampleInt == constZero).To(Equal(false)) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.ToNot\(BeZero\(\)\). instead` + Expect(constZero == exampleInt).To(Equal(false)) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.ToNot\(BeZero\(\)\). instead` + Expect(exampleInt == constZero).To(BeFalse()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.ToNot\(BeZero\(\)\). instead` Expect(exampleInt).To(Equal(1)) - Expect(exampleInt == 1).To(Equal(true)) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\)\.To\(Equal\(1\)\). instead` - Expect(exampleInt != 1).To(Equal(false)) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\)\.To\(Equal\(1\)\). instead` + Expect(exampleInt == 1).To(Equal(true)) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.To\(Equal\(1\)\). instead` + Expect(exampleInt != 1).To(Equal(false)) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.To\(Equal\(1\)\). instead` - Expect(1 == retNum()).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(retNum\(\)\)\.To\(Equal\(1\)\). instead` - Expect(retNum() == 1).To(Equal(true)) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(retNum\(\)\)\.To\(Equal\(1\)\). instead` - Expect(retNum() != 1).To(Equal(false)) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(retNum\(\)\)\.To\(Equal\(1\)\). instead` + Expect(1 == retNum()).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(retNum\(\)\)\.To\(Equal\(1\)\). instead` + Expect(retNum() == 1).To(Equal(true)) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(retNum\(\)\)\.To\(Equal\(1\)\). instead` + Expect(retNum() != 1).To(Equal(false)) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(retNum\(\)\)\.To\(Equal\(1\)\). instead` exampleInt = 0 - Expect(exampleInt == 0).To(Equal(true)) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\)\.To\(BeZero\(\)\). instead` - Expect(exampleInt == 0).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\)\.To\(BeZero\(\)\). instead` - Expect(exampleInt == 0).WithOffset(5).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\)\.WithOffset\(5\)\.To\(BeZero\(\)\). instead` + Expect(exampleInt == 0).To(Equal(true)) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.To\(BeZero\(\)\). instead` + Expect(exampleInt == 0).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.To\(BeZero\(\)\). instead` + Expect(exampleInt == 0).WithOffset(5).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.WithOffset\(5\)\.To\(BeZero\(\)\). instead` }) It("should find comparison assertions", func() { - Expect(exampleInt == 1).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\)\.To\(Equal\(1\)\). instead` - Expect(exampleInt != 1).To(BeFalse()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\)\.To\(Equal\(1\)\). instead` + Expect(exampleInt == 1).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.To\(Equal\(1\)\). instead` + Expect(exampleInt != 1).To(BeFalse()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.To\(Equal\(1\)\). instead` }) It("should find comparison assertions", func() { - Expect(exampleInt == constOne).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\)\.To\(Equal\(constOne\)\). instead` + Expect(exampleInt == constOne).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.To\(Equal\(constOne\)\). instead` }) It("should find comparison assertions", func() { - Expect(exampleFloat32 == 1).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleFloat32\)\.To\(Equal\(1\)\). instead` + Expect(exampleFloat32 == 1).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleFloat32\)\.To\(Equal\(1\)\). instead` }) It("should find comparison assertions", func() { - Expect(exampleFloat32 == 1.0).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleFloat32\)\.To\(Equal\(1.0\)\). instead` + Expect(exampleFloat32 == 1.0).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleFloat32\)\.To\(Equal\(1\.0\)\). instead` }) It("should find comparison assertions", func() { - Expect(exampleFloat32 == constOne).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleFloat32\)\.To\(Equal\(constOne\)\). instead` + Expect(exampleFloat32 == constOne).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleFloat32\)\.To\(Equal\(constOne\)\). instead` }) It("imported const", func() { - Expect(time.Millisecond == 1000000).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(time.Millisecond\)\.To\(Equal\(1000000\)\). instead` + Expect(time.Millisecond == 1000000).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(time\.Millisecond\)\.To\(Equal\(1000000\)\). instead` }) It("string const", func() { var s = "abcd" - Expect(s == constStr).Should(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(s\)\.Should\(Equal\(constStr\)\). instead` - Expect(constStr == s).Should(Equal(true)) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(s\)\.Should\(Equal\(constStr\)\). instead` + Expect(s == constStr).Should(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(s\)\.Should\(Equal\(constStr\)\). instead` + Expect(constStr == s).Should(Equal(true)) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(s\)\.Should\(Equal\(constStr\)\). instead` }) }) Context("less than", func() { It("check greater than", func() { - Expect(exampleInt > constZero).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\)\.To\(BeNumerically\(">", constZero\)\). instead` - Expect(constZero < exampleInt).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\)\.To\(BeNumerically\(">", constZero\)\). instead` + Expect(exampleInt > constZero).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.To\(BeNumerically\(">", constZero\)\). instead` + Expect(constZero < exampleInt).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.To\(BeNumerically\(">", constZero\)\). instead` Expect(exampleInt).To(BeNumerically(">", 0)) - Expect(exampleInt > 0).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\)\.To\(BeNumerically\(">", 0\)\). instead` - Expect(0 < exampleInt).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\)\.To\(BeNumerically\(">", 0\)\). instead` + Expect(exampleInt > 0).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.To\(BeNumerically\(">", 0\)\). instead` + Expect(0 < exampleInt).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.To\(BeNumerically\(">", 0\)\). instead` - Expect(retNum() > constZero).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(retNum\(\)\)\.To\(BeNumerically\(">", constZero\)\). instead` - Expect(constZero < retNum()).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(retNum\(\)\)\.To\(BeNumerically\(">", constZero\)\). instead` + Expect(retNum() > constZero).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(retNum\(\)\)\.To\(BeNumerically\(">", constZero\)\). instead` + Expect(constZero < retNum()).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(retNum\(\)\)\.To\(BeNumerically\(">", constZero\)\). instead` Expect(retNum()).To(BeNumerically(">", 0)) - Expect(retNum() > 0).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(retNum\(\)\)\.To\(BeNumerically\(">", 0\)\). instead` - Expect(0 < retNum()).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(retNum\(\)\)\.To\(BeNumerically\(">", 0\)\). instead` + Expect(retNum() > 0).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(retNum\(\)\)\.To\(BeNumerically\(">", 0\)\). instead` + Expect(0 < retNum()).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(retNum\(\)\)\.To\(BeNumerically\(">", 0\)\). instead` }) It("check greater than or equal", func() { - Expect(constZero <= exampleInt).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\)\.To\(BeNumerically\(">=", constZero\)\). instead` - Expect(exampleInt >= constZero).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\)\.To\(BeNumerically\(">=", constZero\)\). instead` + Expect(constZero <= exampleInt).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.To\(BeNumerically\(">=", constZero\)\). instead` + Expect(exampleInt >= constZero).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.To\(BeNumerically\(">=", constZero\)\). instead` Expect(exampleInt).To(BeNumerically(">=", 0)) - Expect(exampleInt >= 0).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\)\.To\(BeNumerically\(">=", 0\)\). instead` - Expect(0 <= exampleInt).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\)\.To\(BeNumerically\(">=", 0\)\). instead` + Expect(exampleInt >= 0).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.To\(BeNumerically\(">=", 0\)\). instead` + Expect(0 <= exampleInt).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.To\(BeNumerically\(">=", 0\)\). instead` }) It("check less than", func() { - Expect(exampleInt < constTwo).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\)\.To\(BeNumerically\("<", constTwo\)\). instead` - Expect(constTwo > exampleInt).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\)\.To\(BeNumerically\("<", constTwo\)\). instead` + Expect(exampleInt < constTwo).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.To\(BeNumerically\("<", constTwo\)\). instead` + Expect(constTwo > exampleInt).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.To\(BeNumerically\("<", constTwo\)\). instead` Expect(exampleInt).To(BeNumerically("<", 2)) - Expect(exampleInt < 2).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\)\.To\(BeNumerically\("<", 2\)\). instead` - Expect(2 > exampleInt).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\)\.To\(BeNumerically\("<", 2\)\). instead` + Expect(exampleInt < 2).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.To\(BeNumerically\("<", 2\)\). instead` + Expect(2 > exampleInt).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.To\(BeNumerically\("<", 2\)\). instead` }) It("check less than or equal", func() { - Expect(constTwo >= exampleInt).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\)\.To\(BeNumerically\("<=", constTwo\)\). instead` - Expect(exampleInt <= constTwo).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\)\.To\(BeNumerically\("<=", constTwo\)\). instead` + Expect(constTwo >= exampleInt).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.To\(BeNumerically\("<=", constTwo\)\). instead` + Expect(exampleInt <= constTwo).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.To\(BeNumerically\("<=", constTwo\)\). instead` Expect(exampleInt).To(BeNumerically("<=", 2)) - Expect(exampleInt <= 2).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\)\.To\(BeNumerically\("<=", 2\)\). instead` - Expect(2 >= exampleInt).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\)\.To\(BeNumerically\("<=", 2\)\). instead` - Expect(2 >= exampleInt).ToNot(BeFalse()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(exampleInt\)\.To\(BeNumerically\("<=", 2\)\). instead` + Expect(exampleInt <= 2).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.To\(BeNumerically\("<=", 2\)\). instead` + Expect(2 >= exampleInt).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.To\(BeNumerically\("<=", 2\)\). instead` + Expect(2 >= exampleInt).ToNot(BeFalse()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(exampleInt\)\.To\(BeNumerically\("<=", 2\)\). instead` }) }) @@ -120,20 +120,20 @@ var _ = Describe("remove comparison", func() { Context("length comparison", func() { It("should not allow len() comparison", func() { s := []int{1, 2, 3, 4} - Expect(len(s) == 4).Should(BeTrue()) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(s\)\.Should\(HaveLen\(4\)\). instead` + Expect(len(s) == 4).Should(BeTrue()) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(s\)\.Should\(HaveLen\(4\)\). instead` Expect(s).Should(HaveLen(4)) - Expect(len(s) == 4).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(s\)\.Should\(HaveLen\(4\)\). instead` - Expect(len(s) != 5).Should(BeTrue()) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(s\)\.ShouldNot\(HaveLen\(5\)\). instead` - Expect(len(s) != 5).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(s\)\.ShouldNot\(HaveLen\(5\)\). instead` - Expect(len(s) != 0).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(s\)\.ShouldNot\(BeEmpty\(\)\). instead` - Expect(len(s) < 5).Should(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(len\(s\)\)\.Should\(BeNumerically\("<", 5\)\). instead` - Expect(len(s) < 5).Should(Equal(true)) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(len\(s\)\)\.Should\(BeNumerically\("<", 5\)\). instead` - Expect(len(s) < 5).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(len\(s\)\)\.Should\(BeNumerically\("<", 5\)\). instead` - Expect(len(s) <= 5).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(len\(s\)\)\.Should\(BeNumerically\("<=", 5\)\). instead` - Expect(len(s) > 3).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(len\(s\)\)\.Should\(BeNumerically\(">", 3\)\). instead` - Expect(len(s) >= 3).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(len\(s\)\)\.Should\(BeNumerically\(">=", 3\)\). instead` - Expect(len(s) < 3).Should(BeFalse()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(len\(s\)\)\.ShouldNot\(BeNumerically\("<", 3\)\). instead` + Expect(len(s) == 4).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(s\)\.Should\(HaveLen\(4\)\). instead` + Expect(len(s) != 5).Should(BeTrue()) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(s\)\.ShouldNot\(HaveLen\(5\)\). instead` + Expect(len(s) != 5).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(s\)\.ShouldNot\(HaveLen\(5\)\). instead` + Expect(len(s) != 0).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(s\)\.ShouldNot\(BeEmpty\(\)\). instead` + Expect(len(s) < 5).Should(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(len\(s\)\)\.Should\(BeNumerically\("<", 5\)\). instead` + Expect(len(s) < 5).Should(Equal(true)) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(len\(s\)\)\.Should\(BeNumerically\("<", 5\)\). instead` + Expect(len(s) < 5).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(len\(s\)\)\.Should\(BeNumerically\("<", 5\)\). instead` + Expect(len(s) <= 5).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(len\(s\)\)\.Should\(BeNumerically\("<=", 5\)\). instead` + Expect(len(s) > 3).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(len\(s\)\)\.Should\(BeNumerically\(">", 3\)\). instead` + Expect(len(s) >= 3).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(len\(s\)\)\.Should\(BeNumerically\(">=", 3\)\). instead` + Expect(len(s) < 3).Should(BeFalse()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(len\(s\)\)\.ShouldNot\(BeNumerically\("<", 3\)\). instead` }) }) }) diff --git a/testdata/src/a/comparison/comparison.gomega.go b/testdata/src/a/comparison/comparison.gomega.go index 023b9f3..b60fb25 100644 --- a/testdata/src/a/comparison/comparison.gomega.go +++ b/testdata/src/a/comparison/comparison.gomega.go @@ -9,90 +9,90 @@ import ( var _ = Describe("remove comparison", func() { Context("equal/not equal cases", func() { It("should find comparison assertions", func() { - g.Expect(exampleInt == 0).To(g.Equal(false)) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.ToNot\(g\.BeZero\(\)\). instead` - g.Expect(0 == exampleInt).To(g.Equal(false)) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.ToNot\(g\.BeZero\(\)\). instead` - g.Expect(exampleInt == 0).To(g.BeFalse()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.ToNot\(g\.BeZero\(\)\). instead` + g.Expect(exampleInt == 0).To(g.Equal(false)) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.ToNot\(g\.BeZero\(\)\). instead` + g.Expect(0 == exampleInt).To(g.Equal(false)) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.ToNot\(g\.BeZero\(\)\). instead` + g.Expect(exampleInt == 0).To(g.BeFalse()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.ToNot\(g\.BeZero\(\)\). instead` - g.Expect(exampleInt == constZero).To(g.Equal(false)) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.ToNot\(g\.BeZero\(\)\). instead` - g.Expect(constZero == exampleInt).To(g.Equal(false)) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.ToNot\(g\.BeZero\(\)\). instead` - g.Expect(exampleInt == constZero).To(g.BeFalse()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.ToNot\(g\.BeZero\(\)\). instead` - g.Expect(exampleInt != constZero).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.ToNot\(g\.BeZero\(\)\). instead` - g.Expect(constZero != exampleInt).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.ToNot\(g\.BeZero\(\)\). instead` + g.Expect(exampleInt == constZero).To(g.Equal(false)) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.ToNot\(g\.BeZero\(\)\). instead` + g.Expect(constZero == exampleInt).To(g.Equal(false)) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.ToNot\(g\.BeZero\(\)\). instead` + g.Expect(exampleInt == constZero).To(g.BeFalse()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.ToNot\(g\.BeZero\(\)\). instead` + g.Expect(exampleInt != constZero).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.ToNot\(g\.BeZero\(\)\). instead` + g.Expect(constZero != exampleInt).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.ToNot\(g\.BeZero\(\)\). instead` g.Expect(exampleInt).To(g.Equal(1)) - g.Expect(exampleInt == 1).To(g.Equal(true)) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.To\(g\.Equal\(1\)\). instead` - g.Expect(exampleInt != 1).To(g.Equal(false)) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.To\(g\.Equal\(1\)\). instead` + g.Expect(exampleInt == 1).To(g.Equal(true)) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.To\(g\.Equal\(1\)\). instead` + g.Expect(exampleInt != 1).To(g.Equal(false)) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.To\(g\.Equal\(1\)\). instead` - g.Expect(1 == retNum()).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(retNum\(\)\)\.To\(g\.Equal\(1\)\). instead` - g.Expect(retNum() == 1).To(g.Equal(true)) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(retNum\(\)\)\.To\(g\.Equal\(1\)\). instead` - g.Expect(retNum() != 1).To(g.Equal(false)) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(retNum\(\)\)\.To\(g\.Equal\(1\)\). instead` + g.Expect(1 == retNum()).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(retNum\(\)\)\.To\(g\.Equal\(1\)\). instead` + g.Expect(retNum() == 1).To(g.Equal(true)) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(retNum\(\)\)\.To\(g\.Equal\(1\)\). instead` + g.Expect(retNum() != 1).To(g.Equal(false)) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(retNum\(\)\)\.To\(g\.Equal\(1\)\). instead` exampleInt = 0 - g.Expect(exampleInt == 0).To(g.Equal(true)) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.To\(g\.BeZero\(\)\). instead` - g.Expect(exampleInt == 0).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.To\(g\.BeZero\(\)\). instead` - g.Expect(exampleInt == 0).WithOffset(5).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g.Expect\(exampleInt\)\.WithOffset\(5\)\.To\(g\.BeZero\(\)\). instead` + g.Expect(exampleInt == 0).To(g.Equal(true)) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.To\(g\.BeZero\(\)\). instead` + g.Expect(exampleInt == 0).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.To\(g\.BeZero\(\)\). instead` + g.Expect(exampleInt == 0).WithOffset(5).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.WithOffset\(5\)\.To\(g\.BeZero\(\)\). instead` }) It("should find comparison assertions", func() { - g.Expect(exampleInt == 1).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.To\(g\.Equal\(1\)\). instead` - g.Expect(exampleInt != 1).To(g.BeFalse()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.To\(g\.Equal\(1\)\). instead` + g.Expect(exampleInt == 1).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.To\(g\.Equal\(1\)\). instead` + g.Expect(exampleInt != 1).To(g.BeFalse()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.To\(g\.Equal\(1\)\). instead` }) It("should find comparison assertions", func() { - g.Expect(exampleInt == constOne).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.To\(g\.Equal\(constOne\)\). instead` + g.Expect(exampleInt == constOne).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.To\(g\.Equal\(constOne\)\). instead` }) It("should find comparison assertions", func() { - g.Expect(exampleFloat32 == 1).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleFloat32\)\.To\(g\.Equal\(1\)\). instead` + g.Expect(exampleFloat32 == 1).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleFloat32\)\.To\(g\.Equal\(1\)\). instead` }) It("should find comparison assertions", func() { - g.Expect(exampleFloat32 == 1.0).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleFloat32\)\.To\(g\.Equal\(1.0\)\). instead` + g.Expect(exampleFloat32 == 1.0).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleFloat32\)\.To\(g\.Equal\(1\.0\)\). instead` }) It("should find comparison assertions", func() { - g.Expect(exampleFloat32 == constOne).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleFloat32\)\.To\(g\.Equal\(constOne\)\). instead` + g.Expect(exampleFloat32 == constOne).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleFloat32\)\.To\(g\.Equal\(constOne\)\). instead` }) It("imported const", func() { - g.Expect(time.Millisecond == 1000000).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(time.Millisecond\)\.To\(g\.Equal\(1000000\)\). instead` - g.Expect(time.Millisecond == 1000000).WithOffset(6).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(time.Millisecond\)\.WithOffset\(6\)\.To\(g\.Equal\(1000000\)\). instead` + g.Expect(time.Millisecond == 1000000).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(time\.Millisecond\)\.To\(g\.Equal\(1000000\)\). instead` + g.Expect(time.Millisecond == 1000000).WithOffset(6).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(time\.Millisecond\)\.WithOffset\(6\)\.To\(g\.Equal\(1000000\)\). instead` }) }) Context("non-equal comparisons", func() { It("check greater than", func() { - g.Expect(exampleInt > constZero).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\(">", constZero\)\). instead` - g.Expect(constZero < exampleInt).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\(">", constZero\)\). instead` + g.Expect(exampleInt > constZero).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\(">", constZero\)\). instead` + g.Expect(constZero < exampleInt).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\(">", constZero\)\). instead` g.Expect(exampleInt).To(g.BeNumerically(">", 0)) - g.Expect(exampleInt > 0).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\(">", 0\)\). instead` - g.Expect(0 < exampleInt).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\(">", 0\)\). instead` + g.Expect(exampleInt > 0).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\(">", 0\)\). instead` + g.Expect(0 < exampleInt).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\(">", 0\)\). instead` - g.Expect(retNum() > constZero).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(retNum\(\)\)\.To\(g\.BeNumerically\(">", constZero\)\). instead` - g.Expect(constZero < retNum()).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(retNum\(\)\)\.To\(g\.BeNumerically\(">", constZero\)\). instead` + g.Expect(retNum() > constZero).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(retNum\(\)\)\.To\(g\.BeNumerically\(">", constZero\)\). instead` + g.Expect(constZero < retNum()).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(retNum\(\)\)\.To\(g\.BeNumerically\(">", constZero\)\). instead` g.Expect(retNum()).To(g.BeNumerically(">", 0)) - g.Expect(retNum() > 0).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(retNum\(\)\)\.To\(g\.BeNumerically\(">", 0\)\). instead` - g.Expect(0 < retNum()).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(retNum\(\)\)\.To\(g\.BeNumerically\(">", 0\)\). instead` + g.Expect(retNum() > 0).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(retNum\(\)\)\.To\(g\.BeNumerically\(">", 0\)\). instead` + g.Expect(0 < retNum()).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(retNum\(\)\)\.To\(g\.BeNumerically\(">", 0\)\). instead` }) It("check greater than or equal", func() { - g.Expect(constZero <= exampleInt).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\(">=", constZero\)\). instead` - g.Expect(exampleInt >= constZero).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\(">=", constZero\)\). instead` + g.Expect(constZero <= exampleInt).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\(">=", constZero\)\). instead` + g.Expect(exampleInt >= constZero).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\(">=", constZero\)\). instead` g.Expect(exampleInt).To(g.BeNumerically(">=", 0)) - g.Expect(exampleInt >= 0).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\(">=", 0\)\). instead` - g.Expect(0 <= exampleInt).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\(">=", 0\)\). instead` + g.Expect(exampleInt >= 0).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\(">=", 0\)\). instead` + g.Expect(0 <= exampleInt).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\(">=", 0\)\). instead` }) It("check less than", func() { - g.Expect(exampleInt < constTwo).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\("<", constTwo\)\). instead` - g.Expect(constTwo > exampleInt).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\("<", constTwo\)\). instead` + g.Expect(exampleInt < constTwo).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\("<", constTwo\)\). instead` + g.Expect(constTwo > exampleInt).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\("<", constTwo\)\). instead` g.Expect(exampleInt).To(g.BeNumerically("<", 2)) - g.Expect(exampleInt < 2).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\("<", 2\)\). instead` - g.Expect(2 > exampleInt).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\("<", 2\)\). instead` + g.Expect(exampleInt < 2).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\("<", 2\)\). instead` + g.Expect(2 > exampleInt).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\("<", 2\)\). instead` }) It("check less than or equal", func() { - g.Expect(constTwo >= exampleInt).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\("<=", constTwo\)\). instead` - g.Expect(exampleInt <= constTwo).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\("<=", constTwo\)\). instead` + g.Expect(constTwo >= exampleInt).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\("<=", constTwo\)\). instead` + g.Expect(exampleInt <= constTwo).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\("<=", constTwo\)\). instead` g.Expect(exampleInt).To(g.BeNumerically("<=", 2)) - g.Expect(exampleInt <= 2).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\("<=", 2\)\). instead` - g.Expect(2 >= exampleInt).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\("<=", 2\)\). instead` + g.Expect(exampleInt <= 2).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\("<=", 2\)\). instead` + g.Expect(2 >= exampleInt).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(exampleInt\)\.To\(g\.BeNumerically\("<=", 2\)\). instead` }) }) diff --git a/testdata/src/a/equalnil/a.go b/testdata/src/a/equalnil/a.go index 8e70346..4eb43e2 100644 --- a/testdata/src/a/equalnil/a.go +++ b/testdata/src/a/equalnil/a.go @@ -10,9 +10,9 @@ var _ = Describe("Check Equal(nil)", func() { var x *int var y = 5 var py = &y - Expect(x).Should(Equal(nil)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` - Expect(py).Should(Not(Equal(nil))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(py\)\.ShouldNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, py).Should(Not(Equal(nil))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, py\)\.ShouldNot\(BeNil\(\)\). instead` - Expect(py).WithOffset(1).Should(Not(Equal(nil))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(py\)\.WithOffset\(1\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(x).Should(Equal(nil)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` + Expect(py).Should(Not(Equal(nil))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(py\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, py).Should(Not(Equal(nil))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, py\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(py).WithOffset(1).Should(Not(Equal(nil))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(py\)\.WithOffset\(1\)\.ShouldNot\(BeNil\(\)\). instead` }) }) diff --git a/testdata/src/a/errnil/a.go b/testdata/src/a/errnil/a.go index a73ccc6..13145eb 100644 --- a/testdata/src/a/errnil/a.go +++ b/testdata/src/a/errnil/a.go @@ -41,58 +41,58 @@ var _ = Describe("check Expect(err).To(BeNil())", func() { tt := t{} It("check Expect(err).To(BeNil())", func() { - Expect(errors.New("fake error")).To(Equal(nil)) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(errors\.New\("fake error"\)\)\.To\(Succeed\(\)\). instead` - Expect(err).To(BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(err\)\.ToNot\(HaveOccurred\(\)\). instead` - ExpectWithOffset(1, err).To(BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .ExpectWithOffset\(1, err\)\.ToNot\(HaveOccurred\(\)\). instead` - Expect(err).To(Not(BeNil())) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(err\)\.To\(HaveOccurred\(\)\). instead` - Expect(err).ToNot(BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(err\)\.To\(HaveOccurred\(\)\). instead` - Expect(err).WithOffset(1).ToNot(BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(err\)\.WithOffset\(1\)\.To\(HaveOccurred\(\)\). instead` - - Expect(tt.err).To(BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(tt\.err\)\.ToNot\(HaveOccurred\(\)\). instead` - - Expect(errFunc()).To(BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(errFunc\(\)\)\.To\(Succeed\(\)\). instead` - Expect(errFunc()).To(Not(BeNil())) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(errFunc\(\)\)\.ToNot\(Succeed\(\)\). instead` - Expect(tupleFunc()).ToNot(BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(tupleFunc\(\)\)\.ToNot\(Succeed\(\)\). instead` + Expect(errors.New("fake error")).To(Equal(nil)) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(errors\.New\("fake error"\)\)\.To\(Succeed\(\)\). instead` + Expect(err).To(BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(err\)\.ToNot\(HaveOccurred\(\)\). instead` + ExpectWithOffset(1, err).To(BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .ExpectWithOffset\(1, err\)\.ToNot\(HaveOccurred\(\)\). instead` + Expect(err).To(Not(BeNil())) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(err\)\.To\(HaveOccurred\(\)\). instead` + Expect(err).ToNot(BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(err\)\.To\(HaveOccurred\(\)\). instead` + Expect(err).WithOffset(1).ToNot(BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(err\)\.WithOffset\(1\)\.To\(HaveOccurred\(\)\). instead` + + Expect(tt.err).To(BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(tt\.err\)\.ToNot\(HaveOccurred\(\)\). instead` + + Expect(errFunc()).To(BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(errFunc\(\)\)\.To\(Succeed\(\)\). instead` + Expect(errFunc()).To(Not(BeNil())) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(errFunc\(\)\)\.ToNot\(Succeed\(\)\). instead` + Expect(tupleFunc()).ToNot(BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(tupleFunc\(\)\)\.ToNot\(Succeed\(\)\). instead` Expect(noErrorFunc()).ToNot(Equal(1)) - Expect(tt.typeErrorFunc()).ToNot(BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(tt\.typeErrorFunc\(\)\)\.ToNot\(Succeed\(\)\). instead` - Expect(tt.typeTupleFunc()).ToNot(BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(tt\.typeTupleFunc\(\)\)\.ToNot\(Succeed\(\)\). instead` + Expect(tt.typeErrorFunc()).ToNot(BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(tt\.typeErrorFunc\(\)\)\.ToNot\(Succeed\(\)\). instead` + Expect(tt.typeTupleFunc()).ToNot(BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(tt\.typeTupleFunc\(\)\)\.ToNot\(Succeed\(\)\). instead` Expect(tt.typeNoErrorFunc()).ToNot(Equal(1)) }) It("check Expect(err).To(Equal(nil))", func() { - Expect(err).To(Equal(nil)) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(err\)\.ToNot\(HaveOccurred\(\)\). instead` - Expect(err).To(Not(Equal(nil))) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(err\)\.To\(HaveOccurred\(\)\). instead` - Expect(err).ToNot(Equal(nil)) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(err\)\.To\(HaveOccurred\(\)\). instead` - Expect(tt.err).To(Equal(nil)) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(tt\.err\)\.ToNot\(HaveOccurred\(\)\). instead` - Expect(tt.err).WithOffset(1).To(Equal(nil)) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(tt\.err\)\.WithOffset\(1\)\.ToNot\(HaveOccurred\(\)\). instead` - - Expect(errFunc()).To(Equal(nil)) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(errFunc\(\)\)\.To\(Succeed\(\)\). instead` - Expect(errFunc()).To(Not(Equal(nil))) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(errFunc\(\)\)\.ToNot\(Succeed\(\)\). instead` - Expect(tupleFunc()).ToNot(Equal(nil)) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(tupleFunc\(\)\)\.ToNot\(Succeed\(\)\). instead` + Expect(err).To(Equal(nil)) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(err\)\.ToNot\(HaveOccurred\(\)\). instead` + Expect(err).To(Not(Equal(nil))) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(err\)\.To\(HaveOccurred\(\)\). instead` + Expect(err).ToNot(Equal(nil)) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(err\)\.To\(HaveOccurred\(\)\). instead` + Expect(tt.err).To(Equal(nil)) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(tt\.err\)\.ToNot\(HaveOccurred\(\)\). instead` + Expect(tt.err).WithOffset(1).To(Equal(nil)) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(tt\.err\)\.WithOffset\(1\)\.ToNot\(HaveOccurred\(\)\). instead` + + Expect(errFunc()).To(Equal(nil)) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(errFunc\(\)\)\.To\(Succeed\(\)\). instead` + Expect(errFunc()).To(Not(Equal(nil))) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(errFunc\(\)\)\.ToNot\(Succeed\(\)\). instead` + Expect(tupleFunc()).ToNot(Equal(nil)) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(tupleFunc\(\)\)\.ToNot\(Succeed\(\)\). instead` Expect(noErrorFunc()).ToNot(Equal(1)) - Expect(tt.typeErrorFunc()).ToNot(Equal(nil)) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(tt.typeErrorFunc\(\)\)\.ToNot\(Succeed\(\)\). instead` - Expect(tt.typeTupleFunc()).ToNot(Equal(nil)) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(tt.typeTupleFunc\(\)\)\.ToNot\(Succeed\(\)\). instead` + Expect(tt.typeErrorFunc()).ToNot(Equal(nil)) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(tt\.typeErrorFunc\(\)\)\.ToNot\(Succeed\(\)\). instead` + Expect(tt.typeTupleFunc()).ToNot(Equal(nil)) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(tt\.typeTupleFunc\(\)\)\.ToNot\(Succeed\(\)\). instead` Expect(tt.typeTupleFunc()).ToNot(HaveOccurred()) Expect(tt.typeTupleFunc()).To(Succeed()) Expect(tt.typeNoErrorFunc()).ToNot(Equal(1)) }) It("check err == nil", func() { - Expect(err == nil).To(Equal(true)) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(err\)\.ToNot\(HaveOccurred\(\)\). instead` - Expect(err == nil).To(Equal(false)) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(err\)\.To\(HaveOccurred\(\)\). instead` - Expect(err != nil).To(Equal(true)) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(err\)\.To\(HaveOccurred\(\)\). instead` - Expect(err != nil).To(Equal(false)) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(err\)\.ToNot\(HaveOccurred\(\)\). instead` - Expect(nil == err).To(Equal(true)) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(err\)\.ToNot\(HaveOccurred\(\)\). instead` - Expect(nil == err).WithOffset(1).To(Equal(true)) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(err\)\.WithOffset\(1\)\.ToNot\(HaveOccurred\(\)\). instead` - Expect(nil == errFunc()).To(Equal(true)) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(errFunc\(\)\)\.To\(Succeed\(\)\). instead` - Expect(errFunc() != nil).To(Equal(true)) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(errFunc\(\)\)\.ToNot\(Succeed\(\)\). instead` - - Expect(err == nil).To(BeTrue()) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(err\)\.ToNot\(HaveOccurred\(\)\). instead` - Expect(err != nil).To(BeFalse()) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(err\)\.ToNot\(HaveOccurred\(\)\). instead` - Expect(nil == err).To(BeTrue()) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(err\)\.ToNot\(HaveOccurred\(\)\). instead` - Expect(nil == errFunc()).To(BeTrue()) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(errFunc\(\)\)\.To\(Succeed\(\)\). instead` - Expect(errFunc() != nil).To(BeFalse()) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(errFunc\(\)\)\.To\(Succeed\(\)\). instead` - Expect(errFunc() != nil).WithOffset(1).To(BeFalse()) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(errFunc\(\)\)\.WithOffset\(1\)\.To\(Succeed\(\)\). instead` + Expect(err == nil).To(Equal(true)) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(err\)\.ToNot\(HaveOccurred\(\)\). instead` + Expect(err == nil).To(Equal(false)) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(err\)\.To\(HaveOccurred\(\)\). instead` + Expect(err != nil).To(Equal(true)) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(err\)\.To\(HaveOccurred\(\)\). instead` + Expect(err != nil).To(Equal(false)) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(err\)\.ToNot\(HaveOccurred\(\)\). instead` + Expect(nil == err).To(Equal(true)) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(err\)\.ToNot\(HaveOccurred\(\)\). instead` + Expect(nil == err).WithOffset(1).To(Equal(true)) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(err\)\.WithOffset\(1\)\.ToNot\(HaveOccurred\(\)\). instead` + Expect(nil == errFunc()).To(Equal(true)) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(errFunc\(\)\)\.To\(Succeed\(\)\). instead` + Expect(errFunc() != nil).To(Equal(true)) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(errFunc\(\)\)\.ToNot\(Succeed\(\)\). instead` + + Expect(err == nil).To(BeTrue()) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(err\)\.ToNot\(HaveOccurred\(\)\). instead` + Expect(err != nil).To(BeFalse()) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(err\)\.ToNot\(HaveOccurred\(\)\). instead` + Expect(nil == err).To(BeTrue()) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(err\)\.ToNot\(HaveOccurred\(\)\). instead` + Expect(nil == errFunc()).To(BeTrue()) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(errFunc\(\)\)\.To\(Succeed\(\)\). instead` + Expect(errFunc() != nil).To(BeFalse()) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(errFunc\(\)\)\.To\(Succeed\(\)\). instead` + Expect(errFunc() != nil).WithOffset(1).To(BeFalse()) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(errFunc\(\)\)\.WithOffset\(1\)\.To\(Succeed\(\)\). instead` }) }) diff --git a/testdata/src/a/errnil/b.go b/testdata/src/a/errnil/b.go index a864d5c..a2641a3 100644 --- a/testdata/src/a/errnil/b.go +++ b/testdata/src/a/errnil/b.go @@ -12,32 +12,32 @@ var _ = Describe("check Expect(err).To(BeNil())", func() { tt := t{} It("check Expect(err).To(BeNil())", func() { - gomega.Expect(errors.New("fake error")).To(gomega.Equal(nil)) // want `ginkgo-linter: wrong error assertion; consider using .gomega\.Expect\(errors\.New\("fake error"\)\)\.To\(gomega\.Succeed\(\)\). instead` - gomega.Expect(err).To(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .gomega\.Expect\(err\)\.ToNot\(gomega\.HaveOccurred\(\)\). instead` - gomega.ExpectWithOffset(1, err).To(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .gomega\.ExpectWithOffset\(1, err\)\.ToNot\(gomega\.HaveOccurred\(\)\). instead` - gomega.Expect(err).To(gomega.Not(gomega.BeNil())) // want `ginkgo-linter: wrong error assertion; consider using .gomega\.Expect\(err\)\.To\(gomega\.HaveOccurred\(\)\). instead` - gomega.Expect(err).ToNot(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .gomega\.Expect\(err\)\.To\(gomega\.HaveOccurred\(\)\). instead` - gomega.Expect(err).ToNot(gomega.Equal(nil)) // want `ginkgo-linter: wrong error assertion; consider using .gomega\.Expect\(err\)\.To\(gomega\.HaveOccurred\(\)\). instead` - - gomega.Expect(tt.err).To(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .gomega\.Expect\(tt\.err\)\.ToNot\(gomega\.HaveOccurred\(\)\). instead` - - gomega.Expect(errFunc()).To(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .gomega\.Expect\(errFunc\(\)\)\.To\(gomega\.Succeed\(\)\). instead` - gomega.Expect(errFunc()).To(gomega.Not(gomega.BeNil())) // want `ginkgo-linter: wrong error assertion; consider using .gomega\.Expect\(errFunc\(\)\)\.ToNot\(gomega\.Succeed\(\)\). instead` - gomega.Expect(tupleFunc()).ToNot(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .gomega\.Expect\(tupleFunc\(\)\)\.ToNot\(gomega\.Succeed\(\)\). instead` + gomega.Expect(errors.New("fake error")).To(gomega.Equal(nil)) // want `ginkgo-linter: wrong error assertion\. Consider using .gomega\.Expect\(errors\.New\("fake error"\)\)\.To\(gomega\.Succeed\(\)\). instead` + gomega.Expect(err).To(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .gomega\.Expect\(err\)\.ToNot\(gomega\.HaveOccurred\(\)\). instead` + gomega.ExpectWithOffset(1, err).To(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .gomega\.ExpectWithOffset\(1, err\)\.ToNot\(gomega\.HaveOccurred\(\)\). instead` + gomega.Expect(err).To(gomega.Not(gomega.BeNil())) // want `ginkgo-linter: wrong error assertion\. Consider using .gomega\.Expect\(err\)\.To\(gomega\.HaveOccurred\(\)\). instead` + gomega.Expect(err).ToNot(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .gomega\.Expect\(err\)\.To\(gomega\.HaveOccurred\(\)\). instead` + gomega.Expect(err).ToNot(gomega.Equal(nil)) // want `ginkgo-linter: wrong error assertion\. Consider using .gomega\.Expect\(err\)\.To\(gomega\.HaveOccurred\(\)\). instead` + + gomega.Expect(tt.err).To(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .gomega\.Expect\(tt\.err\)\.ToNot\(gomega\.HaveOccurred\(\)\). instead` + + gomega.Expect(errFunc()).To(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .gomega\.Expect\(errFunc\(\)\)\.To\(gomega\.Succeed\(\)\). instead` + gomega.Expect(errFunc()).To(gomega.Not(gomega.BeNil())) // want `ginkgo-linter: wrong error assertion\. Consider using .gomega\.Expect\(errFunc\(\)\)\.ToNot\(gomega\.Succeed\(\)\). instead` + gomega.Expect(tupleFunc()).ToNot(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .gomega\.Expect\(tupleFunc\(\)\)\.ToNot\(gomega\.Succeed\(\)\). instead` gomega.Expect(noErrorFunc()).ToNot(gomega.Equal(1)) - gomega.Expect(tt.typeErrorFunc()).ToNot(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .gomega\.Expect\(tt\.typeErrorFunc\(\)\)\.ToNot\(gomega\.Succeed\(\)\). instead` - gomega.Expect(tt.typeTupleFunc()).ToNot(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .gomega\.Expect\(tt\.typeTupleFunc\(\)\)\.ToNot\(gomega\.Succeed\(\)\). instead` - gomega.Expect(tt.typeTupleFunc()).WithOffset(1).ToNot(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .gomega\.Expect\(tt\.typeTupleFunc\(\)\)\.WithOffset\(1\)\.ToNot\(gomega\.Succeed\(\)\). instead` + gomega.Expect(tt.typeErrorFunc()).ToNot(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .gomega\.Expect\(tt\.typeErrorFunc\(\)\)\.ToNot\(gomega\.Succeed\(\)\). instead` + gomega.Expect(tt.typeTupleFunc()).ToNot(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .gomega\.Expect\(tt\.typeTupleFunc\(\)\)\.ToNot\(gomega\.Succeed\(\)\). instead` + gomega.Expect(tt.typeTupleFunc()).WithOffset(1).ToNot(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .gomega\.Expect\(tt\.typeTupleFunc\(\)\)\.WithOffset\(1\)\.ToNot\(gomega\.Succeed\(\)\). instead` gomega.Expect(tt.typeNoErrorFunc()).ToNot(gomega.Equal(1)) }) It("check err == nil", func() { - gomega.Expect(err == nil).To(gomega.BeTrue()) // want `ginkgo-linter: wrong error assertion; consider using .gomega\.Expect\(err\)\.ToNot\(gomega\.HaveOccurred\(\)\). instead` - gomega.Expect(err == nil).WithOffset(1).To(gomega.BeTrue()) // want `ginkgo-linter: wrong error assertion; consider using .gomega\.Expect\(err\)\.WithOffset\(1\)\.ToNot\(gomega\.HaveOccurred\(\)\). instead` - gomega.Expect(err != nil).To(gomega.BeFalse()) // want `ginkgo-linter: wrong error assertion; consider using .gomega\.Expect\(err\)\.ToNot\(gomega\.HaveOccurred\(\)\). instead` - gomega.Expect(nil == err).To(gomega.BeTrue()) // want `ginkgo-linter: wrong error assertion; consider using .gomega\.Expect\(err\)\.ToNot\(gomega\.HaveOccurred\(\)\). instead` - gomega.Expect(nil == errFunc()).To(gomega.BeTrue()) // want `ginkgo-linter: wrong error assertion; consider using .gomega\.Expect\(errFunc\(\)\)\.To\(gomega\.Succeed\(\)\). instead` - gomega.Expect(errFunc() != nil).To(gomega.BeFalse()) // want `ginkgo-linter: wrong error assertion; consider using .gomega\.Expect\(errFunc\(\)\)\.To\(gomega\.Succeed\(\)\). instead` + gomega.Expect(err == nil).To(gomega.BeTrue()) // want `ginkgo-linter: wrong error assertion\. Consider using .gomega\.Expect\(err\)\.ToNot\(gomega\.HaveOccurred\(\)\). instead` + gomega.Expect(err == nil).WithOffset(1).To(gomega.BeTrue()) // want `ginkgo-linter: wrong error assertion\. Consider using .gomega\.Expect\(err\)\.WithOffset\(1\)\.ToNot\(gomega\.HaveOccurred\(\)\). instead` + gomega.Expect(err != nil).To(gomega.BeFalse()) // want `ginkgo-linter: wrong error assertion\. Consider using .gomega\.Expect\(err\)\.ToNot\(gomega\.HaveOccurred\(\)\). instead` + gomega.Expect(nil == err).To(gomega.BeTrue()) // want `ginkgo-linter: wrong error assertion\. Consider using .gomega\.Expect\(err\)\.ToNot\(gomega\.HaveOccurred\(\)\). instead` + gomega.Expect(nil == errFunc()).To(gomega.BeTrue()) // want `ginkgo-linter: wrong error assertion\. Consider using .gomega\.Expect\(errFunc\(\)\)\.To\(gomega\.Succeed\(\)\). instead` + gomega.Expect(errFunc() != nil).To(gomega.BeFalse()) // want `ginkgo-linter: wrong error assertion\. Consider using .gomega\.Expect\(errFunc\(\)\)\.To\(gomega\.Succeed\(\)\). instead` }) }) diff --git a/testdata/src/a/eventually/eventuallyFunc.go b/testdata/src/a/eventually/eventuallyFunc.go index f71f7f6..cb3d723 100644 --- a/testdata/src/a/eventually/eventuallyFunc.go +++ b/testdata/src/a/eventually/eventuallyFunc.go @@ -62,26 +62,26 @@ var _ = Describe("Eventually with function", func() { ch := make(chan int) Eventually(ch).Should(BeClosed()) // valid Eventually(slowInt).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // valid - Eventually(slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // want `ginkgo-linter: use a function call in Eventually. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed` - Eventually(context.TODO(), slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // want `ginkgo-linter: use a function call in Eventually. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed` + Eventually(slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // want `ginkgo-linter: use a function call in Eventually\. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed\. Consider using .Eventually\(slowInt\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(Equal\(42\)\). instead` + Eventually(context.TODO(), slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // want `ginkgo-linter: use a function call in Eventually\. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed\. Consider using .Eventually\(context\.TODO\(\), slowInt\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(Equal\(42\)\). instead` ctx := context.TODO() - Eventually(ctx, slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // want `ginkgo-linter: use a function call in Eventually. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed` + Eventually(ctx, slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // want `ginkgo-linter: use a function call in Eventually\. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed\. Consider using .Eventually\(ctx, slowInt\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(Equal\(42\)\). instead` Eventually(ctx, slowInt).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // valid Eventually(ctx, func(g Gomega) { // make sure the existing rules are still applied within "Eventually" - g.Expect(len("a")).Should(Equal(1)) // want `ginkgo-linter: wrong length assertion; consider using .g.Expect\("a"\)\.Should\(HaveLen\(1\)\). instead` + g.Expect(len("a")).Should(Equal(1)) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\("a"\)\.Should\(HaveLen\(1\)\). instead` }).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // valid Eventually(os.Getwd).Should(Equal("something")) // valid - Eventually(os.Getwd()).Should(Equal("something")) // want `ginkgo-linter: use a function call in Eventually. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed` + Eventually(os.Getwd()).Should(Equal("something")) // want `ginkgo-linter: use a function call in Eventually\. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed\. Consider using .Eventually\(os\.Getwd\)\.Should\(Equal\("something"\)\). instead` tst := test{} Eventually(tst.slowInt).Should(Equal(42)) // valid Eventually(retMethod(tst)).Should(Equal(42)) // valid. The function returns a method - Eventually(tst.slowInt()).Should(Equal(42)) // want `ginkgo-linter: use a function call in Eventually. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed` - Eventually(withArguments(4, 5)).Should(Equal(42)) // want `ginkgo-linter: use a function call in Eventually. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed` + Eventually(tst.slowInt()).Should(Equal(42)) // want `ginkgo-linter: use a function call in Eventually\. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed\. Consider using .Eventually\(tst\.slowInt\)\.Should\(Equal\(42\)\). instead` + Eventually(withArguments(4, 5)).Should(Equal(42)) // want `ginkgo-linter: use a function call in Eventually\. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed\. Consider using .Eventually\(withArguments\)\.WithArguments\(4, 5\)\.Should\(Equal\(42\)\). instead` Eventually(withArguments).WithArguments(4, 5).Should(Equal(42)) // valid Eventually(tst.withArguments).WithArguments(4, 5).Should(Equal(42)) // valid - Eventually(tst.withArguments(4, 5)).Should(Equal(42)) // want `ginkgo-linter: use a function call in Eventually. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed; consider using .Eventually\(tst\.withArguments\)\.WithArguments\(4, 5\)\.Should\(Equal\(42\)\). instead` + Eventually(tst.withArguments(4, 5)).Should(Equal(42)) // want `ginkgo-linter: use a function call in Eventually\. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed\. Consider using .Eventually\(tst\.withArguments\)\.WithArguments\(4, 5\)\.Should\(Equal\(42\)\). instead` Eventually(func(a, b int) int { return withArguments(a, b) }).WithArguments(4, 5).Should(Equal(42)) // valid @@ -89,26 +89,26 @@ var _ = Describe("Eventually with function", func() { }) Context("Two errors in one assertion", func() { Eventually(func() *test { return nil }()).Should(BeNil()) - Eventually(func() []int { return nil }()).Should(HaveLen(0)) // want `ginkgo-linter: use a function call in Eventually. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed; consider using .Eventually\(func\(\) \[\]int { return nil }\)\.Should\(BeEmpty\(\)\). instead` `ginkgo-linter: wrong length assertion; consider using .Eventually\(func\(\) \[\]int { return nil }\)\.Should\(BeEmpty\(\)\). instead` - Eventually(func() []int { return nil }).Should(HaveLen(0)) // want `ginkgo-linter: wrong length assertion; consider using .Eventually\(func\(\) \[\]int { return nil }\).Should\(BeEmpty\(\)\). instead` - Eventually(func() bool { return true }()).Should(Equal(true)) // want `ginkgo-linter: use a function call in Eventually. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed; consider using .Eventually\(func\(\) bool { return true }\).Should\(BeTrue\(\)\). instead` `ginkgo-linter: wrong boolean assertion; consider using .Eventually\(func\(\) bool { return true }\)\.Should\(BeTrue\(\)\). instead` - Eventually(func() bool { return true }).Should(Equal(true)) // want `ginkgo-linter: wrong boolean assertion; consider using .Eventually\(func\(\) bool { return true }\)\.Should\(BeTrue\(\)\). instead` - Eventually(func() bool { return true }).Should(Not(Equal(false))) // want `ginkgo-linter: wrong boolean assertion; consider using .Eventually\(func\(\) bool { return true }\)\.Should\(BeTrue\(\)\). instead` - Eventually(func() bool { return true }()).Should(Not(Equal(false))) // want `ginkgo-linter: use a function call in Eventually. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed; consider using .Eventually\(func\(\) bool { return true }\)\.Should\(BeTrue\(\)\). instead` `ginkgo-linter: wrong boolean assertion; consider using .Eventually\(func\(\) bool { return true }\)\.Should\(BeTrue\(\)\). instead` + Eventually(func() []int { return nil }()).Should(HaveLen(0)) // want `ginkgo-linter: multiple issues: wrong length assertion; use a function call in Eventually\. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed\. Consider using .Eventually\(func\(\) \[\]int { return nil }\)\.Should\(BeEmpty\(\)\). instead` + Eventually(func() []int { return nil }).Should(HaveLen(0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Eventually\(func\(\) \[\]int { return nil }\)\.Should\(BeEmpty\(\)\). instead` + Eventually(func() bool { return true }()).Should(Equal(true)) // want `ginkgo-linter: multiple issues: wrong boolean assertion; use a function call in Eventually\. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed\. Consider using .Eventually\(func\(\) bool { return true }\)\.Should\(BeTrue\(\)\). instead` + Eventually(func() bool { return true }).Should(Equal(true)) // want `ginkgo-linter: wrong boolean assertion\. Consider using .Eventually\(func\(\) bool { return true }\)\.Should\(BeTrue\(\)\). instead` + Eventually(func() bool { return true }).Should(Not(Equal(false))) // want `ginkgo-linter: wrong boolean assertion\. Consider using .Eventually\(func\(\) bool { return true }\)\.Should\(BeTrue\(\)\). instead` + Eventually(func() bool { return true }()).Should(Not(Equal(false))) // want `ginkgo-linter: multiple issues: wrong boolean assertion; use a function call in Eventually\. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed\. Consider using .Eventually\(func\(\) bool { return true }\)\.Should\(BeTrue\(\)\). instead` }) Context("EventuallyWithOffset", func() { ch := make(chan int) EventuallyWithOffset(1, ch).Should(BeClosed()) // valid EventuallyWithOffset(1, slowInt).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // valid - EventuallyWithOffset(1, slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // want `ginkgo-linter: use a function call in EventuallyWithOffset. This actually checks nothing, because EventuallyWithOffset receives the function returned value, instead of function itself, and this value is never changed` - EventuallyWithOffset(1, context.TODO(), slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // want `ginkgo-linter: use a function call in EventuallyWithOffset. This actually checks nothing, because EventuallyWithOffset receives the function returned value, instead of function itself, and this value is never changed` + EventuallyWithOffset(1, slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // want `ginkgo-linter: use a function call in EventuallyWithOffset\. This actually checks nothing, because EventuallyWithOffset receives the function returned value, instead of function itself, and this value is never changed\. Consider using .EventuallyWithOffset\(1, slowInt\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(Equal\(42\)\). instead` + EventuallyWithOffset(1, context.TODO(), slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // want `ginkgo-linter: use a function call in EventuallyWithOffset\. This actually checks nothing, because EventuallyWithOffset receives the function returned value, instead of function itself, and this value is never changed\. Consider using .EventuallyWithOffset\(1, context\.TODO\(\), slowInt\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(Equal\(42\)\). instead` ctx := context.TODO() - EventuallyWithOffset(1, ctx, slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // want `ginkgo-linter: use a function call in EventuallyWithOffset. This actually checks nothing, because EventuallyWithOffset receives the function returned value, instead of function itself, and this value is never changed` + EventuallyWithOffset(1, ctx, slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // want `ginkgo-linter: use a function call in EventuallyWithOffset\. This actually checks nothing, because EventuallyWithOffset receives the function returned value, instead of function itself, and this value is never changed\. Consider using .EventuallyWithOffset\(1, ctx, slowInt\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(Equal\(42\)\). instead` EventuallyWithOffset(1, ctx, slowInt).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // valid EventuallyWithOffset(1, ctx, func(g Gomega) { // make sure the existing rules are still applied within "EventuallyWithOffset" - g.Expect(len("a")).Should(Equal(1)) // want `ginkgo-linter: wrong length assertion; consider using .g.Expect\("a"\)\.Should\(HaveLen\(1\)\). instead` + g.Expect(len("a")).Should(Equal(1)) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\("a"\)\.Should\(HaveLen\(1\)\). instead` }).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // valid }) @@ -116,14 +116,14 @@ var _ = Describe("Eventually with function", func() { ch := make(chan int) Consistently(ch).Should(BeClosed()) // valid Consistently(slowInt).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // valid - Consistently(slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // want `ginkgo-linter: use a function call in Consistently. This actually checks nothing, because Consistently receives the function returned value, instead of function itself, and this value is never changed` - Consistently(context.TODO(), slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // want `ginkgo-linter: use a function call in Consistently. This actually checks nothing, because Consistently receives the function returned value, instead of function itself, and this value is never changed` + Consistently(slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // want `ginkgo-linter: use a function call in Consistently\. This actually checks nothing, because Consistently receives the function returned value, instead of function itself, and this value is never changed\. Consider using .Consistently\(slowInt\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(Equal\(42\)\). instead` + Consistently(context.TODO(), slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // want `ginkgo-linter: use a function call in Consistently\. This actually checks nothing, because Consistently receives the function returned value, instead of function itself, and this value is never changed\. Consider using .Consistently\(context\.TODO\(\), slowInt\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(Equal\(42\)\). instead` ctx := context.TODO() - Consistently(ctx, slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // want `ginkgo-linter: use a function call in Consistently. This actually checks nothing, because Consistently receives the function returned value, instead of function itself, and this value is never changed` + Consistently(ctx, slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // want `ginkgo-linter: use a function call in Consistently\. This actually checks nothing, because Consistently receives the function returned value, instead of function itself, and this value is never changed\. Consider using .Consistently\(ctx, slowInt\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(Equal\(42\)\). instead` Consistently(ctx, slowInt).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // valid Consistently(ctx, func(g Gomega) { // make sure the existing rules are still applied within "Consistently" - g.Expect(len("a")).Should(Equal(1)) // want `ginkgo-linter: wrong length assertion; consider using .g.Expect\("a"\)\.Should\(HaveLen\(1\)\). instead` + g.Expect(len("a")).Should(Equal(1)) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\("a"\)\.Should\(HaveLen\(1\)\). instead` }).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // valid }) @@ -131,14 +131,14 @@ var _ = Describe("Eventually with function", func() { ch := make(chan int) ConsistentlyWithOffset(1, ch).Should(BeClosed()) // valid ConsistentlyWithOffset(1, slowInt).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // valid - ConsistentlyWithOffset(1, slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // want `ginkgo-linter: use a function call in ConsistentlyWithOffset. This actually checks nothing, because ConsistentlyWithOffset receives the function returned value, instead of function itself, and this value is never changed` - ConsistentlyWithOffset(1, context.TODO(), slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // want `ginkgo-linter: use a function call in ConsistentlyWithOffset. This actually checks nothing, because ConsistentlyWithOffset receives the function returned value, instead of function itself, and this value is never changed` + ConsistentlyWithOffset(1, slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // want `ginkgo-linter: use a function call in ConsistentlyWithOffset\. This actually checks nothing, because ConsistentlyWithOffset receives the function returned value, instead of function itself, and this value is never changed\. Consider using .ConsistentlyWithOffset\(1, slowInt\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(Equal\(42\)\). instead` + ConsistentlyWithOffset(1, context.TODO(), slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // want `ginkgo-linter: use a function call in ConsistentlyWithOffset\. This actually checks nothing, because ConsistentlyWithOffset receives the function returned value, instead of function itself, and this value is never changed\. Consider using .ConsistentlyWithOffset\(1, context\.TODO\(\), slowInt\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(Equal\(42\)\). instead` ctx := context.TODO() - ConsistentlyWithOffset(1, ctx, slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // want `ginkgo-linter: use a function call in ConsistentlyWithOffset. This actually checks nothing, because ConsistentlyWithOffset receives the function returned value, instead of function itself, and this value is never changed` + ConsistentlyWithOffset(1, ctx, slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // want `ginkgo-linter: use a function call in ConsistentlyWithOffset\. This actually checks nothing, because ConsistentlyWithOffset receives the function returned value, instead of function itself, and this value is never changed\. Consider using .ConsistentlyWithOffset\(1, ctx, slowInt\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(Equal\(42\)\). instead` ConsistentlyWithOffset(1, ctx, slowInt).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // valid ConsistentlyWithOffset(1, ctx, func(g Gomega) { // make sure the existing rules are still applied within "ConsistentlyWithOffset" - g.Expect(len("a")).Should(Equal(1)) // want `ginkgo-linter: wrong length assertion; consider using .g.Expect\("a"\)\.Should\(HaveLen\(1\)\). instead` + g.Expect(len("a")).Should(Equal(1)) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\("a"\)\.Should\(HaveLen\(1\)\). instead` }).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(Equal(42)) // valid }) }) diff --git a/testdata/src/a/eventually/eventuallyFunc.gomega.go b/testdata/src/a/eventually/eventuallyFunc.gomega.go index cbf5981..80a9fef 100644 --- a/testdata/src/a/eventually/eventuallyFunc.gomega.go +++ b/testdata/src/a/eventually/eventuallyFunc.gomega.go @@ -13,14 +13,14 @@ var _ = Describe("Eventually with function", func() { ch := make(chan int) gomega.Eventually(ch).Should(gomega.BeClosed()) // valid gomega.Eventually(slowInt).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // valid - gomega.Eventually(slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // want `ginkgo-linter: use a function call in Eventually. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed` - gomega.Eventually(context.TODO(), slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // want `ginkgo-linter: use a function call in Eventually. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed` + gomega.Eventually(slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // want `ginkgo-linter: use a function call in Eventually\. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed\. Consider using .gomega\.Eventually\(slowInt\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(gomega\.Equal\(42\)\). instead` + gomega.Eventually(context.TODO(), slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // want `ginkgo-linter: use a function call in Eventually\. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed\. Consider using .gomega\.Eventually\(context\.TODO\(\), slowInt\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(gomega\.Equal\(42\)\). instead` ctx := context.TODO() - gomega.Eventually(ctx, slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // want `ginkgo-linter: use a function call in Eventually. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed` + gomega.Eventually(ctx, slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // want `ginkgo-linter: use a function call in Eventually\. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed\. Consider using .gomega\.Eventually\(ctx, slowInt\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(gomega\.Equal\(42\)\). instead` gomega.Eventually(ctx, slowInt).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // valid gomega.Eventually(ctx, func(g gomega.Gomega) { // valid // make sure the existing rules are still applied within "Eventually" - g.Expect(len("a")).Should(gomega.Equal(1)) // want `ginkgo-linter: wrong length assertion; consider using .g.Expect\("a"\)\.Should\(gomega\.HaveLen\(1\)\). instead` + g.Expect(len("a")).Should(gomega.Equal(1)) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\("a"\)\.Should\(gomega\.HaveLen\(1\)\). instead` }).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // valid }) @@ -28,14 +28,14 @@ var _ = Describe("Eventually with function", func() { ch := make(chan int) gomega.EventuallyWithOffset(1, ch).Should(gomega.BeClosed()) // valid gomega.EventuallyWithOffset(1, slowInt).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // valid - gomega.EventuallyWithOffset(1, slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // want `ginkgo-linter: use a function call in EventuallyWithOffset. This actually checks nothing, because EventuallyWithOffset receives the function returned value, instead of function itself, and this value is never changed` - gomega.EventuallyWithOffset(1, context.TODO(), slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // want `ginkgo-linter: use a function call in EventuallyWithOffset. This actually checks nothing, because EventuallyWithOffset receives the function returned value, instead of function itself, and this value is never changed` + gomega.EventuallyWithOffset(1, slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // want `ginkgo-linter: use a function call in EventuallyWithOffset\. This actually checks nothing, because EventuallyWithOffset receives the function returned value, instead of function itself, and this value is never changed\. Consider using .gomega\.EventuallyWithOffset\(1, slowInt\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(gomega\.Equal\(42\)\). instead` + gomega.EventuallyWithOffset(1, context.TODO(), slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // want `ginkgo-linter: use a function call in EventuallyWithOffset\. This actually checks nothing, because EventuallyWithOffset receives the function returned value, instead of function itself, and this value is never changed\. Consider using .gomega\.EventuallyWithOffset\(1, context\.TODO\(\), slowInt\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(gomega\.Equal\(42\)\). instead` ctx := context.TODO() - gomega.EventuallyWithOffset(1, ctx, slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // want `ginkgo-linter: use a function call in EventuallyWithOffset. This actually checks nothing, because EventuallyWithOffset receives the function returned value, instead of function itself, and this value is never changed` + gomega.EventuallyWithOffset(1, ctx, slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // want `ginkgo-linter: use a function call in EventuallyWithOffset\. This actually checks nothing, because EventuallyWithOffset receives the function returned value, instead of function itself, and this value is never changed\. Consider using .gomega\.EventuallyWithOffset\(1, ctx, slowInt\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(gomega\.Equal\(42\)\). instead` gomega.EventuallyWithOffset(1, ctx, slowInt).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // valid gomega.EventuallyWithOffset(1, ctx, func(g gomega.Gomega) { // valid // make sure the existing rules are still applied within "EventuallyWithOffset" - g.Expect(len("a")).Should(gomega.Equal(1)) // want `ginkgo-linter: wrong length assertion; consider using .g.Expect\("a"\)\.Should\(gomega\.HaveLen\(1\)\). instead` + g.Expect(len("a")).Should(gomega.Equal(1)) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\("a"\)\.Should\(gomega\.HaveLen\(1\)\). instead` }).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // valid }) @@ -43,14 +43,14 @@ var _ = Describe("Eventually with function", func() { ch := make(chan int) gomega.Consistently(ch).Should(gomega.BeClosed()) // valid gomega.Consistently(slowInt).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // valid - gomega.Consistently(slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // want `ginkgo-linter: use a function call in Consistently. This actually checks nothing, because Consistently receives the function returned value, instead of function itself, and this value is never changed` - gomega.Consistently(context.TODO(), slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // want `ginkgo-linter: use a function call in Consistently. This actually checks nothing, because Consistently receives the function returned value, instead of function itself, and this value is never changed` + gomega.Consistently(slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // want `ginkgo-linter: use a function call in Consistently\. This actually checks nothing, because Consistently receives the function returned value, instead of function itself, and this value is never changed\. Consider using .gomega\.Consistently\(slowInt\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(gomega\.Equal\(42\)\). instead` + gomega.Consistently(context.TODO(), slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // want `ginkgo-linter: use a function call in Consistently\. This actually checks nothing, because Consistently receives the function returned value, instead of function itself, and this value is never changed\. Consider using .gomega\.Consistently\(context\.TODO\(\), slowInt\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(gomega\.Equal\(42\)\). instead` ctx := context.TODO() - gomega.Consistently(ctx, slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // want `ginkgo-linter: use a function call in Consistently. This actually checks nothing, because Consistently receives the function returned value, instead of function itself, and this value is never changed` + gomega.Consistently(ctx, slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // want `ginkgo-linter: use a function call in Consistently\. This actually checks nothing, because Consistently receives the function returned value, instead of function itself, and this value is never changed\. Consider using .gomega\.Consistently\(ctx, slowInt\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(gomega\.Equal\(42\)\). instead` gomega.Consistently(ctx, slowInt).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // valid gomega.Consistently(ctx, func(g gomega.Gomega) { // valid // make sure the existing rules are still applied within "Consistently" - g.Expect(len("a")).Should(gomega.Equal(1)) // want `ginkgo-linter: wrong length assertion; consider using .g.Expect\("a"\)\.Should\(gomega\.HaveLen\(1\)\). instead` + g.Expect(len("a")).Should(gomega.Equal(1)) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\("a"\)\.Should\(gomega\.HaveLen\(1\)\). instead` }).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // valid }) @@ -58,14 +58,14 @@ var _ = Describe("Eventually with function", func() { ch := make(chan int) gomega.ConsistentlyWithOffset(1, ch).Should(gomega.BeClosed()) // valid gomega.ConsistentlyWithOffset(1, slowInt).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // valid - gomega.ConsistentlyWithOffset(1, slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // want `ginkgo-linter: use a function call in ConsistentlyWithOffset. This actually checks nothing, because ConsistentlyWithOffset receives the function returned value, instead of function itself, and this value is never changed` - gomega.ConsistentlyWithOffset(1, context.TODO(), slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // want `ginkgo-linter: use a function call in ConsistentlyWithOffset. This actually checks nothing, because ConsistentlyWithOffset receives the function returned value, instead of function itself, and this value is never changed` + gomega.ConsistentlyWithOffset(1, slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // want `ginkgo-linter: use a function call in ConsistentlyWithOffset\. This actually checks nothing, because ConsistentlyWithOffset receives the function returned value, instead of function itself, and this value is never changed\. Consider using .gomega\.ConsistentlyWithOffset\(1, slowInt\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(gomega\.Equal\(42\)\). instead` + gomega.ConsistentlyWithOffset(1, context.TODO(), slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // want `ginkgo-linter: use a function call in ConsistentlyWithOffset\. This actually checks nothing, because ConsistentlyWithOffset receives the function returned value, instead of function itself, and this value is never changed\. Consider using .gomega\.ConsistentlyWithOffset\(1, context\.TODO\(\), slowInt\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(gomega\.Equal\(42\)\). instead` ctx := context.TODO() - gomega.ConsistentlyWithOffset(1, ctx, slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // want `ginkgo-linter: use a function call in ConsistentlyWithOffset. This actually checks nothing, because ConsistentlyWithOffset receives the function returned value, instead of function itself, and this value is never changed` + gomega.ConsistentlyWithOffset(1, ctx, slowInt()).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // want `ginkgo-linter: use a function call in ConsistentlyWithOffset\. This actually checks nothing, because ConsistentlyWithOffset receives the function returned value, instead of function itself, and this value is never changed\. Consider using .gomega\.ConsistentlyWithOffset\(1, ctx, slowInt\)\.WithPolling\(time\.Millisecond \* 100\)\.WithTimeout\(time\.Second \* 2\)\.Should\(gomega\.Equal\(42\)\). instead` gomega.ConsistentlyWithOffset(1, ctx, slowInt).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // valid gomega.ConsistentlyWithOffset(1, ctx, func(g gomega.Gomega) { // valid // make sure the existing rules are still applied within "ConsistentlyWithOffset" - g.Expect(len("a")).Should(gomega.Equal(1)) // want `ginkgo-linter: wrong length assertion; consider using .g.Expect\("a"\)\.Should\(gomega\.HaveLen\(1\)\). instead` + g.Expect(len("a")).Should(gomega.Equal(1)) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\("a"\)\.Should\(gomega\.HaveLen\(1\)\). instead` }).WithPolling(time.Millisecond * 100).WithTimeout(time.Second * 2).Should(gomega.Equal(42)) // valid }) }) diff --git a/testdata/src/a/focus/focus_key_test.go b/testdata/src/a/focus/focus_key_test.go index ed495f6..e14aff9 100644 --- a/testdata/src/a/focus/focus_key_test.go +++ b/testdata/src/a/focus/focus_key_test.go @@ -9,7 +9,7 @@ var _ = Describe("focused Describe", Focus, func() { When("focused when", Focus, func() { Context("focused Context", Focus, func() { It("focused It", Focus, func() { - Expect(len("1234")).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("1234"\)\.Should\(HaveLen\(4\)\). instead` + Expect(len("1234")).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("1234"\)\.Should\(HaveLen\(4\)\). instead` }) }) }) diff --git a/testdata/src/a/focus/focus_name_test.go b/testdata/src/a/focus/focus_name_test.go index 47b8506..e4c8504 100644 --- a/testdata/src/a/focus/focus_name_test.go +++ b/testdata/src/a/focus/focus_name_test.go @@ -8,7 +8,7 @@ import ( var _ = tester.FDescribe("should warn", func() { tester.When("should ignore", func() { tester.It("should ignore", func() { - Expect(len("abcd")).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(HaveLen\(4\)\). instead` + Expect(len("abcd")).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.Should\(HaveLen\(4\)\). instead` }) }) tester.Context("should ignore", func() { diff --git a/testdata/src/a/focus/table_test.go b/testdata/src/a/focus/table_test.go index 9969cb5..77f8a5c 100644 --- a/testdata/src/a/focus/table_test.go +++ b/testdata/src/a/focus/table_test.go @@ -7,7 +7,7 @@ import ( var _ = Describe("test focused tables", func() { FDescribeTable("focused table", func(s []int, l int) { - Expect(len(s)).Should(Equal(l)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(s\)\.Should\(HaveLen\(l\)\). instead` + Expect(len(s)).Should(Equal(l)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(s\)\.Should\(HaveLen\(l\)\). instead` }, Entry([]int{1, 2, 3, 4}, 4), FEntry([]int{1, 2, 3, 4, 5}, 5), diff --git a/testdata/src/a/focusconfig/focus_key_name_test.go b/testdata/src/a/focusconfig/focus_key_name_test.go index adcec31..d58c406 100644 --- a/testdata/src/a/focusconfig/focus_key_name_test.go +++ b/testdata/src/a/focusconfig/focus_key_name_test.go @@ -5,11 +5,11 @@ import ( . "github.com/onsi/gomega" ) -var _ = ginkgo.Describe("focused Describe", ginkgo.Focus, func() { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` - ginkgo.When("focused when", ginkgo.Focus, func() { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` - ginkgo.Context("focused Context", ginkgo.Focus, func() { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` - ginkgo.It("focused It", ginkgo.Focus, func() { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` - Expect(len("1234")).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("1234"\)\.Should\(HaveLen\(4\)\). instead` +var _ = ginkgo.Describe("focused Describe", ginkgo.Focus, func() { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code\. Consider to remove it` + ginkgo.When("focused when", ginkgo.Focus, func() { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code\. Consider to remove it` + ginkgo.Context("focused Context", ginkgo.Focus, func() { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code\. Consider to remove it` + ginkgo.It("focused It", ginkgo.Focus, func() { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code\. Consider to remove it` + Expect(len("1234")).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("1234"\)\.Should\(HaveLen\(4\)\). instead` }) }) }) diff --git a/testdata/src/a/focusconfig/focus_key_test.go b/testdata/src/a/focusconfig/focus_key_test.go index c06b334..0eb4891 100644 --- a/testdata/src/a/focusconfig/focus_key_test.go +++ b/testdata/src/a/focusconfig/focus_key_test.go @@ -5,11 +5,11 @@ import ( . "github.com/onsi/gomega" ) -var _ = Describe("focused Describe", Focus, func() { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` - When("focused when", Focus, func() { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` - Context("focused Context", Focus, func() { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` - It("focused It", Focus, func() { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` - Expect(len("1234")).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("1234"\)\.Should\(HaveLen\(4\)\). instead` +var _ = Describe("focused Describe", Focus, func() { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code\. Consider to remove it` + When("focused when", Focus, func() { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code\. Consider to remove it` + Context("focused Context", Focus, func() { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code\. Consider to remove it` + It("focused It", Focus, func() { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code\. Consider to remove it` + Expect(len("1234")).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("1234"\)\.Should\(HaveLen\(4\)\). instead` }) }) }) diff --git a/testdata/src/a/focusconfig/focus_name_test.go b/testdata/src/a/focusconfig/focus_name_test.go index a622374..96900b4 100644 --- a/testdata/src/a/focusconfig/focus_name_test.go +++ b/testdata/src/a/focusconfig/focus_name_test.go @@ -5,10 +5,10 @@ import ( . "github.com/onsi/gomega" ) -var _ = tester.FDescribe("should warn", func() { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "Describe"` +var _ = tester.FDescribe("should warn", func() { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code\. Consider to replace with "Describe"` tester.When("should ignore", func() { tester.It("should ignore", func() { - Expect(len("abcd")).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(HaveLen\(4\)\). instead` + Expect(len("abcd")).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.Should\(HaveLen\(4\)\). instead` }) }) tester.Context("should ignore", func() { @@ -23,7 +23,7 @@ var _ = tester.FDescribe("should warn", func() { // want `ginkgo-linter: Focus c }) var _ = tester.Describe("should ignore", func() { - tester.FWhen("should warn", func() { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "When"` + tester.FWhen("should warn", func() { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code\. Consider to replace with "When"` tester.Context("should ignore", func() { tester.It("should ignore", func() { Expect("abcd").Should(HaveLen(4)) @@ -35,7 +35,7 @@ var _ = tester.Describe("should ignore", func() { }) }) - tester.FContext("should warn", func() { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "Context"` + tester.FContext("should warn", func() { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code\. Consider to replace with "Context"` tester.Context("should ignore", func() { tester.It("should ignore", func() { Expect("abcd").Should(HaveLen(4)) @@ -48,7 +48,7 @@ var _ = tester.Describe("should ignore", func() { }) tester.Context("ignore", func() { - tester.FIt("should warn", func() { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "It"` + tester.FIt("should warn", func() { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code\. Consider to replace with "It"` Expect("abcd").Should(HaveLen(4)) }) }) diff --git a/testdata/src/a/focusconfig/focus_noname_test.go b/testdata/src/a/focusconfig/focus_noname_test.go index a91fb1e..1334887 100644 --- a/testdata/src/a/focusconfig/focus_noname_test.go +++ b/testdata/src/a/focusconfig/focus_noname_test.go @@ -5,7 +5,7 @@ import ( . "github.com/onsi/gomega" ) -var _ = ginkgo.FDescribe("should warn", func() { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "Describe"` +var _ = ginkgo.FDescribe("should warn", func() { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code\. Consider to replace with "Describe"` ginkgo.When("should ignore", func() { ginkgo.It("should ignore", func() { Expect("abcd").Should(HaveLen(4)) @@ -23,7 +23,7 @@ var _ = ginkgo.FDescribe("should warn", func() { // want `ginkgo-linter: Focus c }) var _ = ginkgo.Describe("should ignore", func() { - ginkgo.FWhen("should warn", func() { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "When"` + ginkgo.FWhen("should warn", func() { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code\. Consider to replace with "When"` ginkgo.Context("should ignore", func() { ginkgo.It("should ignore", func() { Expect("abcd").Should(HaveLen(4)) @@ -35,7 +35,7 @@ var _ = ginkgo.Describe("should ignore", func() { }) }) - ginkgo.FContext("should warn", func() { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "Context"` + ginkgo.FContext("should warn", func() { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code\. Consider to replace with "Context"` ginkgo.Context("should ignore", func() { ginkgo.It("should ignore", func() { Expect("abcd").Should(HaveLen(4)) @@ -48,7 +48,7 @@ var _ = ginkgo.Describe("should ignore", func() { }) ginkgo.Context("ignore", func() { - ginkgo.FIt("should warn", func() { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "It"` + ginkgo.FIt("should warn", func() { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code\. Consider to replace with "It"` Expect("abcd").Should(HaveLen(4)) }) }) diff --git a/testdata/src/a/focusconfig/focus_test.go b/testdata/src/a/focusconfig/focus_test.go index da7fa6d..237d50a 100644 --- a/testdata/src/a/focusconfig/focus_test.go +++ b/testdata/src/a/focusconfig/focus_test.go @@ -5,7 +5,7 @@ import ( . "github.com/onsi/gomega" ) -var _ = FDescribe("should warn", func() { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "Describe"` +var _ = FDescribe("should warn", func() { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code\. Consider to replace with "Describe"` When("should ignore", func() { It("should ignore", func() { Expect("abcd").Should(HaveLen(4)) @@ -23,7 +23,7 @@ var _ = FDescribe("should warn", func() { // want `ginkgo-linter: Focus containe }) var _ = Describe("should ignore", func() { - FWhen("should warn", func() { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "When"` + FWhen("should warn", func() { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code\. Consider to replace with "When"` Context("should ignore", func() { It("should ignore", func() { Expect("abcd").Should(HaveLen(4)) @@ -35,7 +35,7 @@ var _ = Describe("should ignore", func() { }) }) - FContext("should warn", func() { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "Context"` + FContext("should warn", func() { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code\. Consider to replace with "Context"` Context("should ignore", func() { It("should ignore", func() { Expect("abcd").Should(HaveLen(4)) @@ -48,7 +48,7 @@ var _ = Describe("should ignore", func() { }) Context("ignore", func() { - FIt("should warn", func() { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "It"` + FIt("should warn", func() { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code\. Consider to replace with "It"` Expect("abcd").Should(HaveLen(4)) }) }) @@ -61,7 +61,7 @@ var _ = Describe("suppress", func() { FWhen("suppress", func() { // ginkgo-linter:ignore-focus-container-warning FIt("suppress", func() { - Expect(len("abcd")).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(HaveLen\(4\)\). instead` + Expect(len("abcd")).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.Should\(HaveLen\(4\)\). instead` }) }) }) diff --git a/testdata/src/a/focusconfig/table_name_test.go b/testdata/src/a/focusconfig/table_name_test.go index f3c6b0b..01368c8 100644 --- a/testdata/src/a/focusconfig/table_name_test.go +++ b/testdata/src/a/focusconfig/table_name_test.go @@ -6,27 +6,27 @@ import ( ) var _ = gnk.Describe("test focused tables", func() { - gnk.FDescribeTable("focused table", func(s []int, l int) { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "DescribeTable"` - Expect(len(s)).Should(Equal(l)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(s\)\.Should\(HaveLen\(l\)\). instead` + gnk.FDescribeTable("focused table", func(s []int, l int) { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code\. Consider to replace with "DescribeTable"` + Expect(len(s)).Should(Equal(l)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(s\)\.Should\(HaveLen\(l\)\). instead` }, gnk.Entry("check slice not focused", []int{1, 2, 3, 4}, 4), - gnk.Entry("check slice focus spec", gnk.Focus, []int{1, 2, 3, 4}, 4), // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` - gnk.FEntry("check slice focused", []int{1, 2, 3, 4, 5}, 5), // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "Entry"` + gnk.Entry("check slice focus spec", gnk.Focus, []int{1, 2, 3, 4}, 4), // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code\. Consider to remove it` + gnk.FEntry("check slice focused", []int{1, 2, 3, 4, 5}, 5), // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code\. Consider to replace with "Entry"` ) gnk.DescribeTable("non-focused table", func(s []int, l int) { Expect(s).Should(HaveLen(l)) }, gnk.Entry("check slice not focused", []int{1, 2, 3, 4}, 4), - gnk.Entry("check slice focus spec", gnk.Focus, []int{1, 2, 3, 4}, 4), // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` - gnk.FEntry("check slice focused", []int{1, 2, 3, 4, 5}, 5), // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "Entry"` + gnk.Entry("check slice focus spec", gnk.Focus, []int{1, 2, 3, 4}, 4), // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code\. Consider to remove it` + gnk.FEntry("check slice focused", []int{1, 2, 3, 4, 5}, 5), // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code\. Consider to replace with "Entry"` ) - gnk.DescribeTable("spec focused table", gnk.Focus, func(s []int, l int) { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` + gnk.DescribeTable("spec focused table", gnk.Focus, func(s []int, l int) { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code\. Consider to remove it` Expect(s).Should(HaveLen(l)) }, gnk.Entry("check slice not focused", []int{1, 2, 3, 4}, 4), - gnk.Entry("check slice focus spec", gnk.Focus, []int{1, 2, 3, 4}, 4), // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` - gnk.FEntry("check slice focused", []int{1, 2, 3, 4, 5}, 5), // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "Entry"` + gnk.Entry("check slice focus spec", gnk.Focus, []int{1, 2, 3, 4}, 4), // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code\. Consider to remove it` + gnk.FEntry("check slice focused", []int{1, 2, 3, 4, 5}, 5), // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code\. Consider to replace with "Entry"` ) }) diff --git a/testdata/src/a/focusconfig/table_test.go b/testdata/src/a/focusconfig/table_test.go index 5b8f04e..046c908 100644 --- a/testdata/src/a/focusconfig/table_test.go +++ b/testdata/src/a/focusconfig/table_test.go @@ -6,27 +6,27 @@ import ( ) var _ = Describe("test focused tables", func() { - FDescribeTable("focused table", func(s []int, l int) { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "DescribeTable"` - Expect(len(s)).Should(Equal(l)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(s\)\.Should\(HaveLen\(l\)\). instead` + FDescribeTable("focused table", func(s []int, l int) { // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code\. Consider to replace with "DescribeTable"` + Expect(len(s)).Should(Equal(l)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(s\)\.Should\(HaveLen\(l\)\). instead` }, Entry("check slice not focused", []int{1, 2, 3, 4}, 4), - Entry("check slice focus spec", Focus, []int{1, 2, 3, 4}, 4), // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` - FEntry("check slice focused", []int{1, 2, 3, 4, 5}, 5), // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "Entry"` + Entry("check slice focus spec", Focus, []int{1, 2, 3, 4}, 4), // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code\. Consider to remove it` + FEntry("check slice focused", []int{1, 2, 3, 4, 5}, 5), // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code\. Consider to replace with "Entry"` ) DescribeTable("non-focused table", func(s []int, l int) { Expect(s).Should(HaveLen(l)) }, Entry("check slice not focused", []int{1, 2, 3, 4}, 4), - Entry("check slice focus spec", Focus, []int{1, 2, 3, 4}, 4), // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` - FEntry("check slice focused", []int{1, 2, 3, 4, 5}, 5), // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "Entry"` + Entry("check slice focus spec", Focus, []int{1, 2, 3, 4}, 4), // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code\. Consider to remove it` + FEntry("check slice focused", []int{1, 2, 3, 4, 5}, 5), // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code\. Consider to replace with "Entry"` ) - DescribeTable("spec focused table", Focus, func(s []int, l int) { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` + DescribeTable("spec focused table", Focus, func(s []int, l int) { // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code\. Consider to remove it` Expect(s).Should(HaveLen(l)) }, Entry("check slice not focused", []int{1, 2, 3, 4}, 4), - Entry("check slice focus spec", Focus, []int{1, 2, 3, 4}, 4), // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code, consider to remove it` - FEntry("check slice focused", []int{1, 2, 3, 4, 5}, 5), // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code, consider to replace with "Entry"` + Entry("check slice focus spec", Focus, []int{1, 2, 3, 4}, 4), // want `ginkgo-linter: Focus spec found. This is used only for local debug and should not be part of the actual source code\. Consider to remove it` + FEntry("check slice focused", []int{1, 2, 3, 4, 5}, 5), // want `ginkgo-linter: Focus container found. This is used only for local debug and should not be part of the actual source code\. Consider to replace with "Entry"` ) }) diff --git a/testdata/src/a/forceExpectTo/gomegavar.go b/testdata/src/a/forceExpectTo/gomegavar.go index cb3828b..9378d65 100644 --- a/testdata/src/a/forceExpectTo/gomegavar.go +++ b/testdata/src/a/forceExpectTo/gomegavar.go @@ -8,15 +8,15 @@ import ( var _ = Describe("gomega var", func() { It("in a valid Eventually", func() { Eventually(func(g Gomega) { - g.Expect("a").Should(HaveLen(1)) // want `ginkgo-linter: must not use Expect with Should; consider using .g\.Expect\("a"\)\.To\(HaveLen\(1\)\). instead` - g.Expect(len("a")).Should(Equal(1)) // want `ginkgo-linter: wrong length assertion; consider using .g\.Expect\("a"\)\.Should\(HaveLen\(1\)\). instead` `ginkgo-linter: must not use Expect with Should; consider using .g\.Expect\("a"\)\.To\(HaveLen\(1\)\). instead` + g.Expect("a").Should(HaveLen(1)) // want `ginkgo-linter: must not use Expect with Should\. Consider using .g\.Expect\("a"\)\.To\(HaveLen\(1\)\). instead` + g.Expect(len("a")).Should(Equal(1)) // want `ginkgo-linter: multiple issues: must not use Expect with Should; wrong length assertion\. Consider using .g\.Expect\("a"\)\.To\(HaveLen\(1\)\). instead` }).Should(Succeed()) }) It("in an invalid Eventually", func() { Eventually(func(g Gomega) { // want `ginkgo-linter: "Eventually": missing assertion method\. Expected "Should\(\)" or "ShouldNot\(\)"` - g.Expect("a").Should(HaveLen(1)) // want `ginkgo-linter: must not use Expect with Should; consider using .g\.Expect\("a"\)\.To\(HaveLen\(1\)\). instead` - g.Expect(len("a")).Should(Equal(1)) // want `ginkgo-linter: wrong length assertion; consider using .g\.Expect\("a"\)\.Should\(HaveLen\(1\)\). instead` `ginkgo-linter: must not use Expect with Should; consider using .g\.Expect\("a"\)\.To\(HaveLen\(1\)\). instead` + g.Expect("a").Should(HaveLen(1)) // want `ginkgo-linter: must not use Expect with Should\. Consider using .g\.Expect\("a"\)\.To\(HaveLen\(1\)\). instead` + g.Expect(len("a")).Should(Equal(1)) // want `ginkgo-linter: multiple issues: must not use Expect with Should; wrong length assertion\. Consider using .g\.Expect\("a"\)\.To\(HaveLen\(1\)\). instead` }) }) }) diff --git a/testdata/src/a/forceExpectTo/nodotimport.go b/testdata/src/a/forceExpectTo/nodotimport.go index 6914a2b..d9f1ae4 100644 --- a/testdata/src/a/forceExpectTo/nodotimport.go +++ b/testdata/src/a/forceExpectTo/nodotimport.go @@ -7,13 +7,13 @@ import ( var _ = Describe("simple case", func() { It("just replace assertion method", func() { - gomega.Expect("a").Should(gomega.HaveLen(1)) // want `ginkgo-linter: must not use Expect with Should; consider using .gomega\.Expect\("a"\)\.To\(gomega\.HaveLen\(1\)\). instead` - gomega.Expect("a").ShouldNot(gomega.BeEmpty()) // want `ginkgo-linter: must not use Expect with ShouldNot; consider using .gomega\.Expect\("a"\)\.ToNot\(gomega\.BeEmpty\(\)\). instead` - gomega.Expect("a").Should(gomega.Not(gomega.BeEmpty())) // want `ginkgo-linter: must not use Expect with ShouldNot; consider using .gomega\.Expect\("a"\)\.ToNot\(gomega\.BeEmpty\(\)\). instead` + gomega.Expect("a").Should(gomega.HaveLen(1)) // want `ginkgo-linter: must not use Expect with Should\. Consider using .gomega\.Expect\("a"\)\.To\(gomega\.HaveLen\(1\)\). instead` + gomega.Expect("a").ShouldNot(gomega.BeEmpty()) // want `ginkgo-linter: must not use Expect with ShouldNot\. Consider using .gomega\.Expect\("a"\)\.ToNot\(gomega\.BeEmpty\(\)\). instead` + gomega.Expect("a").Should(gomega.Not(gomega.BeEmpty())) // want `ginkgo-linter: must not use Expect with Should\. Consider using .gomega\.Expect\("a"\)\.ToNot\(gomega\.BeEmpty\(\)\). instead` }) It("mix with len assertion", func() { - gomega.Expect(len("a")).Should(gomega.Equal(1)) // want `ginkgo-linter: wrong length assertion; consider using .gomega\.Expect\("a"\)\.Should\(gomega\.HaveLen\(1\)\). instead` `ginkgo-linter: must not use Expect with Should; consider using .gomega\.Expect\("a"\)\.To\(gomega\.HaveLen\(1\)\). instead` - gomega.Expect(len("a")).ShouldNot(gomega.Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .gomega\.Expect\("a"\)\.ShouldNot\(gomega\.BeEmpty\(\)\). instead` `ginkgo-linter: must not use Expect with ShouldNot; consider using .gomega\.Expect\("a"\)\.ToNot\(gomega\.BeEmpty\(\)\). instead` + gomega.Expect(len("a")).Should(gomega.Equal(1)) // want `ginkgo-linter: multiple issues: must not use Expect with Should; wrong length assertion\. Consider using .gomega\.Expect\("a"\)\.To\(gomega\.HaveLen\(1\)\). instead` + gomega.Expect(len("a")).ShouldNot(gomega.Equal(0)) // want `ginkgo-linter: multiple issues: must not use Expect with ShouldNot; wrong length assertion\. Consider using .gomega\.Expect\("a"\)\.ToNot\(gomega\.BeEmpty\(\)\). instead` }) }) diff --git a/testdata/src/a/forceExpectTo/simple.go b/testdata/src/a/forceExpectTo/simple.go index 6140b11..8c1a685 100644 --- a/testdata/src/a/forceExpectTo/simple.go +++ b/testdata/src/a/forceExpectTo/simple.go @@ -7,15 +7,15 @@ import ( var _ = Describe("simple case", func() { It("just replace assertion method", func() { - Expect("a").Should(HaveLen(1)) // want `ginkgo-linter: must not use Expect with Should; consider using .Expect\("a"\)\.To\(HaveLen\(1\)\). instead` - Expect("a").ShouldNot(BeEmpty()) // want `ginkgo-linter: must not use Expect with ShouldNot; consider using .Expect\("a"\)\.ToNot\(BeEmpty\(\)\). instead` - Expect("a").Should(Not(BeEmpty())) // want `ginkgo-linter: must not use Expect with ShouldNot; consider using .Expect\("a"\)\.ToNot\(BeEmpty\(\)\). instead` + Expect("a").Should(HaveLen(1)) // want `ginkgo-linter: must not use Expect with Should\. Consider using .Expect\("a"\)\.To\(HaveLen\(1\)\). instead` + Expect("a").ShouldNot(BeEmpty()) // want `ginkgo-linter: must not use Expect with ShouldNot\. Consider using .Expect\("a"\)\.ToNot\(BeEmpty\(\)\). instead` + Expect("a").Should(Not(BeEmpty())) // want `ginkgo-linter: must not use Expect with Should\. Consider using .Expect\("a"\)\.ToNot\(BeEmpty\(\)\). instead` Ω("a").Should(HaveLen(1)) Ω("a").ShouldNot(BeEmpty()) }) It("mix with len assertion", func() { - Expect(len("a")).Should(Equal(1)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("a"\)\.Should\(HaveLen\(1\)\). instead` `ginkgo-linter: must not use Expect with Should; consider using .Expect\("a"\)\.To\(HaveLen\(1\)\). instead` - Expect(len("a")).ShouldNot(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("a"\)\.ShouldNot\(BeEmpty\(\)\). instead` `ginkgo-linter: must not use Expect with ShouldNot; consider using .Expect\("a"\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("a")).Should(Equal(1)) // want `ginkgo-linter: multiple issues: must not use Expect with Should; wrong length assertion\. Consider using .Expect\("a"\)\.To\(HaveLen\(1\)\). instead` + Expect(len("a")).ShouldNot(Equal(0)) // want `ginkgo-linter: multiple issues: must not use Expect with ShouldNot; wrong length assertion\. Consider using .Expect\("a"\)\.ToNot\(BeEmpty\(\)\). instead` }) }) diff --git a/testdata/src/a/gomegaonly/gomegaonly_test.go b/testdata/src/a/gomegaonly/gomegaonly_test.go index f877b3b..1f032e9 100644 --- a/testdata/src/a/gomegaonly/gomegaonly_test.go +++ b/testdata/src/a/gomegaonly/gomegaonly_test.go @@ -11,31 +11,31 @@ func TestGomegaOnly_NewGomegaWithT(t *testing.T) { g := NewGomegaWithT(t) var err error - g.Expect(err).ToNot(BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .g\.Expect\(err\)\.To\(HaveOccurred\(\)\). instead` + g.Expect(err).ToNot(BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .g\.Expect\(err\)\.To\(HaveOccurred\(\)\). instead` assert(g, err) assertWithT(g, err) assertGomegaWithT(g, err) } func assert(g Gomega, err error) { - g.Expect(err).To(BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .g\.Expect\(err\)\.ToNot\(HaveOccurred\(\)\). instead` - g.Expect(err).WithOffset(1).To(BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .g\.Expect\(err\)\.WithOffset\(1\)\.ToNot\(HaveOccurred\(\)\). instead` + g.Expect(err).To(BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .g\.Expect\(err\)\.ToNot\(HaveOccurred\(\)\). instead` + g.Expect(err).WithOffset(1).To(BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .g\.Expect\(err\)\.WithOffset\(1\)\.ToNot\(HaveOccurred\(\)\). instead` } func assertWithT(g *WithT, err error) { - g.Expect(err).To(BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .g\.Expect\(err\)\.ToNot\(HaveOccurred\(\)\). instead` + g.Expect(err).To(BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .g\.Expect\(err\)\.ToNot\(HaveOccurred\(\)\). instead` } func assertGomegaWithT(g *GomegaWithT, err error) { - g.Expect(err).To(BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .g\.Expect\(err\)\.ToNot\(HaveOccurred\(\)\). instead` + g.Expect(err).To(BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .g\.Expect\(err\)\.ToNot\(HaveOccurred\(\)\). instead` } func TestGomegaOnly_NewWithT(t *testing.T) { g := NewWithT(t) var err error - g.Expect(err).ToNot(BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .g\.Expect\(err\)\.To\(HaveOccurred\(\)\). instead` - g.Expect(err).WithOffset(1).ToNot(BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .g\.Expect\(err\)\.WithOffset\(1\)\.To\(HaveOccurred\(\)\). instead` + g.Expect(err).ToNot(BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .g\.Expect\(err\)\.To\(HaveOccurred\(\)\). instead` + g.Expect(err).WithOffset(1).ToNot(BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .g\.Expect\(err\)\.WithOffset\(1\)\.To\(HaveOccurred\(\)\). instead` assert(g, err) } @@ -43,15 +43,15 @@ func TestGomegaOnly_NewGomega(t *testing.T) { g := NewGomega(Fail) var err error - g.Expect(err).ToNot(BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .g\.Expect\(err\)\.To\(HaveOccurred\(\)\). instead` + g.Expect(err).ToNot(BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .g\.Expect\(err\)\.To\(HaveOccurred\(\)\). instead` assert(g, err) } var _ = Describe("check gomega parameter", func() { Eventually(func(g Gomega) error { arr := []int{1, 2, 3} - g.Expect(len(arr)).Should(Equal(3)) // want `ginkgo-linter: wrong length assertion; consider using .g\.Expect\(arr\)\.Should\(HaveLen\(3\)\). instead` - g.Expect(len(arr) == 3).Should(Equal(true)) // want `ginkgo-linter: wrong length assertion; consider using .g\.Expect\(arr\)\.Should\(HaveLen\(3\)\). instead` + g.Expect(len(arr)).Should(Equal(3)) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\(arr\)\.Should\(HaveLen\(3\)\). instead` + g.Expect(len(arr) == 3).Should(Equal(true)) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\(arr\)\.Should\(HaveLen\(3\)\). instead` return nil }).Should(Succeed()) }) diff --git a/testdata/src/a/gomegaonly/gomegaonly_w_mod_name_test.go b/testdata/src/a/gomegaonly/gomegaonly_w_mod_name_test.go index 7caeeb6..687b257 100644 --- a/testdata/src/a/gomegaonly/gomegaonly_w_mod_name_test.go +++ b/testdata/src/a/gomegaonly/gomegaonly_w_mod_name_test.go @@ -11,7 +11,7 @@ func TestGomegaOnlyWithModName_NewGomegaWithT(t *testing.T) { g := gom.NewGomegaWithT(t) var err error - g.Expect(err).ToNot(gom.BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .g\.Expect\(err\)\.To\(gom.HaveOccurred\(\)\). instead` + g.Expect(err).ToNot(gom.BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .g\.Expect\(err\)\.To\(gom\.HaveOccurred\(\)\). instead` assertWithModName(g, err) assertWithNameModWithT(g, err) @@ -22,32 +22,32 @@ func TestGomegaOnlyWithModName_NewWithT(t *testing.T) { g := gom.NewWithT(t) var err error - g.Expect(err).ToNot(gom.BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .g\.Expect\(err\)\.To\(gom.HaveOccurred\(\)\). instead` + g.Expect(err).ToNot(gom.BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .g\.Expect\(err\)\.To\(gom\.HaveOccurred\(\)\). instead` } func TestGomegaOnlyWithModName_NewGomega(t *testing.T) { g := gom.NewGomega(Fail) var err error - g.Expect(err).ToNot(gom.BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .g\.Expect\(err\)\.To\(gom.HaveOccurred\(\)\). instead` + g.Expect(err).ToNot(gom.BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .g\.Expect\(err\)\.To\(gom\.HaveOccurred\(\)\). instead` } func assertWithModName(g gom.Gomega, err error) { - g.Expect(err).To(gom.BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .g\.Expect\(err\)\.ToNot\(gom\.HaveOccurred\(\)\). instead` + g.Expect(err).To(gom.BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .g\.Expect\(err\)\.ToNot\(gom\.HaveOccurred\(\)\). instead` } func assertWithNameModWithT(g *gom.WithT, err error) { - g.Expect(err).To(gom.BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .g\.Expect\(err\)\.ToNot\(gom\.HaveOccurred\(\)\). instead` + g.Expect(err).To(gom.BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .g\.Expect\(err\)\.ToNot\(gom\.HaveOccurred\(\)\). instead` } func assertWithModNameGomegaWithT(g *gom.WithT, err error) { - g.Expect(err).To(gom.BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .g\.Expect\(err\)\.ToNot\(gom\.HaveOccurred\(\)\). instead` + g.Expect(err).To(gom.BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .g\.Expect\(err\)\.ToNot\(gom\.HaveOccurred\(\)\). instead` } var _ = Describe("check gomega parameter", func() { gom.Eventually(func(g gom.Gomega) error { arr := []int{1, 2, 3} - g.Expect(len(arr)).Should(gom.Equal(3)) // want `ginkgo-linter: wrong length assertion; consider using .g\.Expect\(arr\)\.Should\(gom\.HaveLen\(3\)\). instead` + g.Expect(len(arr)).Should(gom.Equal(3)) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\(arr\)\.Should\(gom\.HaveLen\(3\)\). instead` return nil }).Should(gom.Succeed()) }) diff --git a/testdata/src/a/gomegaonly/gomegaonly_w_name_test.go b/testdata/src/a/gomegaonly/gomegaonly_w_name_test.go index 1f038e1..a569aa2 100644 --- a/testdata/src/a/gomegaonly/gomegaonly_w_name_test.go +++ b/testdata/src/a/gomegaonly/gomegaonly_w_name_test.go @@ -11,7 +11,7 @@ func TestGomegaOnlyWithName_NewGomegaWithT(t *testing.T) { g := gomega.NewGomegaWithT(t) var err error - g.Expect(err).ToNot(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .g\.Expect\(err\)\.To\(gomega.HaveOccurred\(\)\). instead` + g.Expect(err).ToNot(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .g\.Expect\(err\)\.To\(gomega\.HaveOccurred\(\)\). instead` assertWithName(g, err) assertWithNameWithT(g, err) @@ -22,32 +22,32 @@ func TestGomegaOnlyWithName_NewWithT(t *testing.T) { g := gomega.NewWithT(t) var err error - g.Expect(err).ToNot(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .g\.Expect\(err\)\.To\(gomega.HaveOccurred\(\)\). instead` + g.Expect(err).ToNot(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .g\.Expect\(err\)\.To\(gomega\.HaveOccurred\(\)\). instead` } func TestGomegaOnlyWithName_NewGomega(t *testing.T) { g := gomega.NewGomega(Fail) var err error - g.Expect(err).ToNot(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .g\.Expect\(err\)\.To\(gomega.HaveOccurred\(\)\). instead` + g.Expect(err).ToNot(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .g\.Expect\(err\)\.To\(gomega\.HaveOccurred\(\)\). instead` } func assertWithName(g gomega.Gomega, err error) { - g.Expect(err).To(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .g\.Expect\(err\)\.ToNot\(gomega\.HaveOccurred\(\)\). instead` + g.Expect(err).To(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .g\.Expect\(err\)\.ToNot\(gomega\.HaveOccurred\(\)\). instead` } func assertWithNameWithT(g *gomega.WithT, err error) { - g.Expect(err).To(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .g\.Expect\(err\)\.ToNot\(gomega\.HaveOccurred\(\)\). instead` + g.Expect(err).To(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .g\.Expect\(err\)\.ToNot\(gomega\.HaveOccurred\(\)\). instead` } func assertWithNameGomegaWithT(g *gomega.WithT, err error) { - g.Expect(err).To(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion; consider using .g\.Expect\(err\)\.ToNot\(gomega\.HaveOccurred\(\)\). instead` + g.Expect(err).To(gomega.BeNil()) // want `ginkgo-linter: wrong error assertion\. Consider using .g\.Expect\(err\)\.ToNot\(gomega\.HaveOccurred\(\)\). instead` } var _ = Describe("check gomega parameter", func() { gomega.Eventually(func(g gomega.Gomega) error { arr := []int{1, 2, 3} - g.Expect(len(arr)).Should(gomega.Equal(3)) // want `ginkgo-linter: wrong length assertion; consider using .g\.Expect\(arr\)\.Should\(gomega\.HaveLen\(3\)\). instead` + g.Expect(len(arr)).Should(gomega.Equal(3)) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\(arr\)\.Should\(gomega\.HaveLen\(3\)\). instead` return nil }).Should(gomega.Succeed()) }) diff --git a/testdata/src/a/havelen0/gomega.go b/testdata/src/a/havelen0/gomega.go index 67dede0..195722f 100644 --- a/testdata/src/a/havelen0/gomega.go +++ b/testdata/src/a/havelen0/gomega.go @@ -10,9 +10,9 @@ func TestHaveLen0(t *testing.T) { g := NewWithT(t) x := make([]int, 0) - g.Expect(x).Should(HaveLen(0)) // want `ginkgo-linter: wrong length assertion; consider using .g\.Expect\(x\)\.Should\(BeEmpty\(\)\). instead` - g.Expect(x).WithOffset(1).Should(HaveLen(0)) // want `ginkgo-linter: wrong length assertion; consider using .g\.Expect\(x\)\.WithOffset\(1\)\.Should\(BeEmpty\(\)\). instead` + g.Expect(x).Should(HaveLen(0)) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\(x\)\.Should\(BeEmpty\(\)\). instead` + g.Expect(x).WithOffset(1).Should(HaveLen(0)) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\(x\)\.WithOffset\(1\)\.Should\(BeEmpty\(\)\). instead` x = append(x, 1) - g.Expect(x).Should(Not(HaveLen(0))) // want `ginkgo-linter: wrong length assertion; consider using .g\.Expect\(x\)\.ShouldNot\(BeEmpty\(\)\). instead` + g.Expect(x).Should(Not(HaveLen(0))) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\(x\)\.ShouldNot\(BeEmpty\(\)\). instead` } diff --git a/testdata/src/a/havelen0/havelen0.go b/testdata/src/a/havelen0/havelen0.go index e3ef2cf..265a6e6 100644 --- a/testdata/src/a/havelen0/havelen0.go +++ b/testdata/src/a/havelen0/havelen0.go @@ -10,12 +10,12 @@ const EMPTY = 0 var _ = Describe("test HaveLen(0)", func() { It("should replace HaveLen(0) with BeEmpty()", func() { x := make([]int, 0) - Expect(x).To(HaveLen(0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(x\)\.To\(BeEmpty\(\)\). instead` - Expect(x).WithOffset(1).To(HaveLen(0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(x\)\.WithOffset\(1\)\.To\(BeEmpty\(\)\). instead` - Expect(x).To(HaveLen(EMPTY)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(x\)\.To\(BeEmpty\(\)\). instead` + Expect(x).To(HaveLen(0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(x\)\.To\(BeEmpty\(\)\). instead` + Expect(x).WithOffset(1).To(HaveLen(0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(x\)\.WithOffset\(1\)\.To\(BeEmpty\(\)\). instead` + Expect(x).To(HaveLen(EMPTY)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(x\)\.To\(BeEmpty\(\)\). instead` x = append(x, 1) - Expect(x).To(Not(HaveLen(0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(x\)\.ToNot\(BeEmpty\(\)\). instead` - Expect(x).To(Not(HaveLen(EMPTY))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(x\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(x).To(Not(HaveLen(0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(x\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(x).To(Not(HaveLen(EMPTY))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(x\)\.ToNot\(BeEmpty\(\)\). instead` }) }) diff --git a/testdata/src/a/len/a.go b/testdata/src/a/len/a.go index 59c636a..0a92243 100644 --- a/testdata/src/a/len/a.go +++ b/testdata/src/a/len/a.go @@ -9,24 +9,24 @@ var _ = Describe("test data for the ginkgo-linter", func() { Context("test Expect", func() { Context("test Should", func() { It("should suggest HaveLen", func() { - Expect(len("abcd")).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(HaveLen\(4\)\). instead` - Expect(len("abcd")).WithOffset(1).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.WithOffset\(1\)\.Should\(HaveLen\(4\)\). instead` + Expect(len("abcd")).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.Should\(HaveLen\(4\)\). instead` + Expect(len("abcd")).WithOffset(1).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.WithOffset\(1\)\.Should\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).Should(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.Should\(BeEmpty\(\)\). instead` + Expect(len("")).Should(Equal(0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(""\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).Should(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.Should\(BeEmpty\(\)\). instead` + Expect(len("")).Should(BeZero()) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(""\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - Expect(len("abcd")).Should(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).Should(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - Expect(len("abcd")).Should(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).Should(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -38,44 +38,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Expect(len("abcd")).Should(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(HaveLen\(11\)\). instead` + Expect(len("abcd")).Should(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.Should\(HaveLen\(11\)\). instead` }) It("should suggest ShouldNot HaveLen", func() { - Expect(len("abcd")).Should(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` + Expect(len("abcd")).Should(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("abcd")).Should(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Expect(len("abcd")).Should(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - Expect(len("abcd")).Should(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).Should(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Expect(len("abcd")).Should(Equal(len("1234"))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(HaveLen\(len\("1234"\)\)\). instead` + Expect(len("abcd")).Should(Equal(len("1234"))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.Should\(HaveLen\(len\("1234"\)\)\). instead` }) }) Context("test Should(Not", func() { It("should suggest HaveLen", func() { - Expect(len("abcd")).Should(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(4\)\). instead` + Expect(len("abcd")).Should(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).Should(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` + Expect(len("")).Should(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).Should(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` + Expect(len("")).Should(Not(BeZero())) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Expect(len("abcd")).Should(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Expect(len("abcd")).Should(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Expect(len("abcd")).Should(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Expect(len("abcd")).Should(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -87,44 +87,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Expect(len("abcd")).Should(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` + Expect(len("abcd")).Should(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` }) It("should suggest Should HaveLen", func() { - Expect(len("abcd")).Should(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(HaveLen\(11\)\). instead` + Expect(len("abcd")).Should(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.Should\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("abcd")).Should(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).Should(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Expect(len("abcd")).Should(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Expect(len("abcd")).Should(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Expect(len("abcd")).Should(Not(Equal(len("12345")))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(len\("12345"\)\)\). instead` + Expect(len("abcd")).Should(Not(Equal(len("12345")))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test ShouldNot", func() { It("should suggest HaveLen", func() { - Expect(len("abcd")).ShouldNot(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(4\)\). instead` + Expect(len("abcd")).ShouldNot(Equal(4)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).ShouldNot(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` + Expect(len("")).ShouldNot(Equal(0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).ShouldNot(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` + Expect(len("")).ShouldNot(BeZero()) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Expect(len("abcd")).ShouldNot(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ShouldNot(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Expect(len("abcd")).ShouldNot(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ShouldNot(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -136,44 +136,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Expect(len("abcd")).ShouldNot(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` + Expect(len("abcd")).ShouldNot(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` }) It("should suggest Should HaveLen", func() { - Expect(len("abcd")).ShouldNot(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(HaveLen\(11\)\). instead` + Expect(len("abcd")).ShouldNot(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.Should\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("abcd")).ShouldNot(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ShouldNot(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Expect(len("abcd")).ShouldNot(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ShouldNot(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Expect(len("abcd")).ShouldNot(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(len\("12345"\)\)\). instead` + Expect(len("abcd")).ShouldNot(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test ShouldNot(Not", func() { It("should suggest HaveLen", func() { - Expect(len("abcd")).ShouldNot(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(HaveLen\(4\)\). instead` + Expect(len("abcd")).ShouldNot(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.Should\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).ShouldNot(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.Should\(BeEmpty\(\)\). instead` + Expect(len("")).ShouldNot(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(""\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).ShouldNot(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.Should\(BeEmpty\(\)\). instead` + Expect(len("")).ShouldNot(Not(BeZero())) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(""\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - Expect(len("abcd")).ShouldNot(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ShouldNot(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - Expect(len("abcd")).ShouldNot(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ShouldNot(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -185,44 +185,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Expect(len("abcd")).ShouldNot(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(HaveLen\(11\)\). instead` + Expect(len("abcd")).ShouldNot(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.Should\(HaveLen\(11\)\). instead` }) It("should suggest ShouldNot HaveLen", func() { - Expect(len("abcd")).ShouldNot(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` + Expect(len("abcd")).ShouldNot(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("abcd")).ShouldNot(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ShouldNot(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - Expect(len("abcd")).ShouldNot(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ShouldNot(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Expect(len("abcd")).ShouldNot(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.Should\(HaveLen\(len\("1234"\)\)\). instead` + Expect(len("abcd")).ShouldNot(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.Should\(HaveLen\(len\("1234"\)\)\). instead` }) }) Context("test To", func() { It("should suggest HaveLen", func() { - Expect(len("abcd")).To(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(HaveLen\(4\)\). instead` + Expect(len("abcd")).To(Equal(4)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).To(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.To\(BeEmpty\(\)\). instead` + Expect(len("")).To(Equal(0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).To(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.To\(BeEmpty\(\)\). instead` + Expect(len("")).To(BeZero()) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - Expect(len("abcd")).To(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).To(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - Expect(len("abcd")).To(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).To(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -234,44 +234,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Expect(len("abcd")).To(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(HaveLen\(11\)\). instead` + Expect(len("abcd")).To(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest ToNot HaveLen", func() { - Expect(len("abcd")).To(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + Expect(len("abcd")).To(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("abcd")).To(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Expect(len("abcd")).To(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - Expect(len("abcd")).To(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).To(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Expect(len("abcd")).To(Equal(len("1234"))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` + Expect(len("abcd")).To(Equal(len("1234"))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` }) }) Context("test To(Not", func() { It("should suggest HaveLen", func() { - Expect(len("abcd")).To(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(4\)\). instead` + Expect(len("abcd")).To(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).To(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("")).To(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(""\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).To(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("")).To(Not(BeZero())) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(""\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest To BeEmpty", func() { - Expect(len("abcd")).To(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Expect(len("abcd")).To(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest To BeEmpty", func() { - Expect(len("abcd")).To(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Expect(len("abcd")).To(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -283,44 +283,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Expect(len("abcd")).To(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + Expect(len("abcd")).To(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest To HaveLen", func() { - Expect(len("abcd")).To(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(HaveLen\(11\)\). instead` + Expect(len("abcd")).To(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("abcd")).To(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).To(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest To BeEmpty", func() { - Expect(len("abcd")).To(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Expect(len("abcd")).To(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Expect(len("abcd")).To(Not(Equal(len("12345")))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(len\("12345"\)\)\). instead` + Expect(len("abcd")).To(Not(Equal(len("12345")))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test ToNot", func() { It("should suggest HaveLen", func() { - Expect(len("abcd")).ToNot(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(4\)\). instead` + Expect(len("abcd")).ToNot(Equal(4)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).ToNot(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("")).ToNot(Equal(0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(""\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).ToNot(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("")).ToNot(BeZero()) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(""\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Expect(len("abcd")).ToNot(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ToNot(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Expect(len("abcd")).ToNot(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ToNot(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -332,44 +332,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Expect(len("abcd")).ToNot(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + Expect(len("abcd")).ToNot(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest Should HaveLen", func() { - Expect(len("abcd")).ToNot(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(HaveLen\(11\)\). instead` + Expect(len("abcd")).ToNot(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("abcd")).ToNot(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ToNot(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Expect(len("abcd")).ToNot(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ToNot(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Expect(len("abcd")).ToNot(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(len\("12345"\)\)\). instead` + Expect(len("abcd")).ToNot(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test ToNot(Not", func() { It("should suggest HaveLen", func() { - Expect(len("abcd")).ToNot(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(HaveLen\(4\)\). instead` + Expect(len("abcd")).ToNot(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).ToNot(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.To\(BeEmpty\(\)\). instead` + Expect(len("")).ToNot(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).ToNot(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.To\(BeEmpty\(\)\). instead` + Expect(len("")).ToNot(Not(BeZero())) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - Expect(len("abcd")).ToNot(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ToNot(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - Expect(len("abcd")).ToNot(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ToNot(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -381,44 +381,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Expect(len("abcd")).ToNot(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(HaveLen\(11\)\). instead` + Expect(len("abcd")).ToNot(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest ToNot HaveLen", func() { - Expect(len("abcd")).ToNot(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + Expect(len("abcd")).ToNot(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("abcd")).ToNot(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ToNot(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - Expect(len("abcd")).ToNot(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).ToNot(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Expect(len("abcd")).ToNot(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\).To\(HaveLen\(len\("1234"\)\)\). instead` + Expect(len("abcd")).ToNot(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` }) }) Context("test NotTo", func() { It("should suggest HaveLen", func() { - Expect(len("abcd")).NotTo(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.NotTo\(HaveLen\(4\)\). instead` + Expect(len("abcd")).NotTo(Equal(4)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.NotTo\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).NotTo(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.NotTo\(BeEmpty\(\)\). instead` + Expect(len("")).NotTo(Equal(0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(""\)\.NotTo\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).NotTo(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.NotTo\(BeEmpty\(\)\). instead` + Expect(len("")).NotTo(BeZero()) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(""\)\.NotTo\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Expect(len("abcd")).NotTo(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Expect(len("abcd")).NotTo(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Expect(len("abcd")).NotTo(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Expect(len("abcd")).NotTo(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -430,44 +430,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Expect(len("abcd")).NotTo(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.NotTo\(HaveLen\(11\)\). instead` + Expect(len("abcd")).NotTo(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.NotTo\(HaveLen\(11\)\). instead` }) It("should suggest Should HaveLen", func() { - Expect(len("abcd")).NotTo(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(HaveLen\(11\)\). instead` + Expect(len("abcd")).NotTo(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("abcd")).NotTo(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.NotTo\(BeEmpty\(\)\). instead` + Expect(len("abcd")).NotTo(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.NotTo\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Expect(len("abcd")).NotTo(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Expect(len("abcd")).NotTo(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Expect(len("abcd")).NotTo(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.NotTo\(HaveLen\(len\("12345"\)\)\). instead` + Expect(len("abcd")).NotTo(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.NotTo\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test NotTo(Not", func() { It("should suggest HaveLen", func() { - Expect(len("abcd")).NotTo(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(HaveLen\(4\)\). instead` + Expect(len("abcd")).NotTo(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).NotTo(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.To\(BeEmpty\(\)\). instead` + Expect(len("")).NotTo(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("")).NotTo(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(""\)\.To\(BeEmpty\(\)\). instead` + Expect(len("")).NotTo(Not(BeZero())) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest NotTo BeEmpty", func() { - Expect(len("abcd")).NotTo(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).NotTo(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest NotTo BeEmpty", func() { - Expect(len("abcd")).NotTo(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).NotTo(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -479,46 +479,46 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Expect(len("abcd")).NotTo(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(HaveLen\(11\)\). instead` + Expect(len("abcd")).NotTo(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest NotTo HaveLen", func() { - Expect(len("abcd")).NotTo(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + Expect(len("abcd")).NotTo(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Expect(len("abcd")).NotTo(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Expect(len("abcd")).NotTo(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest NotTo BeEmpty", func() { - Expect(len("abcd")).NotTo(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Expect(len("abcd")).NotTo(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Expect(len("abcd")).NotTo(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` + Expect(len("abcd")).NotTo(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` }) }) }) Context("test ExpectWithOffset", func() { Context("test Should", func() { It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(4\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).Should(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.Should\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).Should(Equal(0)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, ""\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).Should(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.Should\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).Should(BeZero()) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, ""\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).Should(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).Should(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -530,44 +530,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).Should(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(11\)\). instead` }) It("should suggest ShouldNot HaveLen", func() { - ExpectWithOffset(12, len("abcd")).Should(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).Should(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).Should(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).Should(Equal(len("1234"))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(len\("1234"\)\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(Equal(len("1234"))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(len\("1234"\)\)\). instead` }) }) Context("test Should(Not", func() { It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).Should(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(4\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).Should(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.ShouldNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).Should(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, ""\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).Should(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.ShouldNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).Should(Not(BeZero())) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, ""\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).Should(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).Should(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -579,44 +579,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).Should(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` }) It("should suggest Should HaveLen", func() { - ExpectWithOffset(12, len("abcd")).Should(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).Should(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).Should(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).Should(Not(Equal(len("12345")))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(len\("12345"\)\)\). instead` + ExpectWithOffset(12, len("abcd")).Should(Not(Equal(len("12345")))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test ShouldNot", func() { It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(4\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(Equal(4)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).ShouldNot(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.ShouldNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).ShouldNot(Equal(0)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, ""\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).ShouldNot(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.ShouldNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).ShouldNot(BeZero()) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, ""\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -628,44 +628,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` }) It("should suggest Should HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(len\("12345"\)\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test ShouldNot(Not", func() { It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(4\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).ShouldNot(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.Should\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).ShouldNot(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, ""\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).ShouldNot(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.Should\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).ShouldNot(Not(BeZero())) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, ""\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -677,44 +677,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(11\)\). instead` }) It("should suggest ShouldNot HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ShouldNot(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(len\("1234"\)\)\). instead` + ExpectWithOffset(12, len("abcd")).ShouldNot(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.Should\(HaveLen\(len\("1234"\)\)\). instead` }) }) Context("test To", func() { It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).To(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(4\)\). instead` + ExpectWithOffset(12, len("abcd")).To(Equal(4)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).To(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).To(Equal(0)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, ""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).To(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).To(BeZero()) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, ""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).To(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).To(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).To(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).To(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -726,44 +726,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).To(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).To(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest ToNot HaveLen", func() { - ExpectWithOffset(12, len("abcd")).To(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).To(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).To(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).To(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).To(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).To(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).To(Equal(len("1234"))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` + ExpectWithOffset(12, len("abcd")).To(Equal(len("1234"))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` }) }) Context("test To(Not", func() { It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).To(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(4\)\). instead` + ExpectWithOffset(12, len("abcd")).To(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).To(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).To(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, ""\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).To(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).To(Not(BeZero())) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, ""\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest To BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).To(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).To(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest To BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).To(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).To(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -775,44 +775,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).To(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).To(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest To HaveLen", func() { - ExpectWithOffset(12, len("abcd")).To(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).To(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).To(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).To(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest To BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).To(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).To(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).To(Not(Equal(len("12345")))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(len\("12345"\)\)\). instead` + ExpectWithOffset(12, len("abcd")).To(Not(Equal(len("12345")))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test ToNot", func() { It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ToNot(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(4\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(Equal(4)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).ToNot(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).ToNot(Equal(0)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, ""\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).ToNot(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).ToNot(BeZero()) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, ""\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ToNot(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ToNot(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -824,44 +824,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ToNot(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest Should HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ToNot(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ToNot(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ToNot(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ToNot(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(len\("12345"\)\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test ToNot(Not", func() { It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ToNot(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(4\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).ToNot(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).ToNot(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, ""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).ToNot(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).ToNot(Not(BeZero())) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, ""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ToNot(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ToNot(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -873,44 +873,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ToNot(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest ToNot HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ToNot(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ToNot(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).ToNot(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).ToNot(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\).To\(HaveLen\(len\("1234"\)\)\). instead` + ExpectWithOffset(12, len("abcd")).ToNot(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` }) }) Context("test NotTo", func() { It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).NotTo(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.NotTo\(HaveLen\(4\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(Equal(4)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.NotTo\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).NotTo(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.NotTo\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).NotTo(Equal(0)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, ""\)\.NotTo\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).NotTo(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.NotTo\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).NotTo(BeZero()) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, ""\)\.NotTo\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).NotTo(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).NotTo(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -922,44 +922,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).NotTo(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.NotTo\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.NotTo\(HaveLen\(11\)\). instead` }) It("should suggest Should HaveLen", func() { - ExpectWithOffset(12, len("abcd")).NotTo(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).NotTo(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.NotTo\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.NotTo\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).NotTo(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).NotTo(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.NotTo\(HaveLen\(len\("12345"\)\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.NotTo\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test NotTo(Not", func() { It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).NotTo(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(4\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).NotTo(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).NotTo(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, ""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("")).NotTo(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, ""\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("")).NotTo(Not(BeZero())) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, ""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest NotTo BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).NotTo(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest NotTo BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).NotTo(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -971,46 +971,46 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).NotTo(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest NotTo HaveLen", func() { - ExpectWithOffset(12, len("abcd")).NotTo(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).NotTo(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest NotTo BeEmpty", func() { - ExpectWithOffset(12, len("abcd")).NotTo(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - ExpectWithOffset(12, len("abcd")).NotTo(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion; consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` + ExpectWithOffset(12, len("abcd")).NotTo(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion\. Consider using .ExpectWithOffset\(12, "abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` }) }) }) Context("test Ω", func() { Context("test Should", func() { It("should suggest HaveLen", func() { - Ω(len("abcd")).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(HaveLen\(4\)\). instead` + Ω(len("abcd")).Should(Equal(4)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.Should\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).Should(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.Should\(BeEmpty\(\)\). instead` + Ω(len("")).Should(Equal(0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\(""\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).Should(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.Should\(BeEmpty\(\)\). instead` + Ω(len("")).Should(BeZero()) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\(""\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - Ω(len("abcd")).Should(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).Should(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - Ω(len("abcd")).Should(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).Should(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -1022,44 +1022,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Ω(len("abcd")).Should(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(HaveLen\(11\)\). instead` + Ω(len("abcd")).Should(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.Should\(HaveLen\(11\)\). instead` }) It("should suggest ShouldNot HaveLen", func() { - Ω(len("abcd")).Should(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` + Ω(len("abcd")).Should(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("abcd")).Should(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Ω(len("abcd")).Should(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - Ω(len("abcd")).Should(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).Should(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Ω(len("abcd")).Should(Equal(len("1234"))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(HaveLen\(len\("1234"\)\)\). instead` + Ω(len("abcd")).Should(Equal(len("1234"))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.Should\(HaveLen\(len\("1234"\)\)\). instead` }) }) Context("test Should(Not", func() { It("should suggest HaveLen", func() { - Ω(len("abcd")).Should(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(4\)\). instead` + Ω(len("abcd")).Should(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).Should(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` + Ω(len("")).Should(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).Should(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` + Ω(len("")).Should(Not(BeZero())) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Ω(len("abcd")).Should(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Ω(len("abcd")).Should(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Ω(len("abcd")).Should(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Ω(len("abcd")).Should(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -1071,44 +1071,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Ω(len("abcd")).Should(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` + Ω(len("abcd")).Should(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` }) It("should suggest Should HaveLen", func() { - Ω(len("abcd")).Should(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(HaveLen\(11\)\). instead` + Ω(len("abcd")).Should(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.Should\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("abcd")).Should(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).Should(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Ω(len("abcd")).Should(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Ω(len("abcd")).Should(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Ω(len("abcd")).Should(Not(Equal(len("12345")))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(len\("12345"\)\)\). instead` + Ω(len("abcd")).Should(Not(Equal(len("12345")))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test ShouldNot", func() { It("should suggest HaveLen", func() { - Ω(len("abcd")).ShouldNot(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(4\)\). instead` + Ω(len("abcd")).ShouldNot(Equal(4)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).ShouldNot(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` + Ω(len("")).ShouldNot(Equal(0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).ShouldNot(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` + Ω(len("")).ShouldNot(BeZero()) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\(""\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Ω(len("abcd")).ShouldNot(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ShouldNot(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Ω(len("abcd")).ShouldNot(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ShouldNot(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -1120,44 +1120,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Ω(len("abcd")).ShouldNot(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` + Ω(len("abcd")).ShouldNot(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` }) It("should suggest Should HaveLen", func() { - Ω(len("abcd")).ShouldNot(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(HaveLen\(11\)\). instead` + Ω(len("abcd")).ShouldNot(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.Should\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("abcd")).ShouldNot(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ShouldNot(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Ω(len("abcd")).ShouldNot(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ShouldNot(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Ω(len("abcd")).ShouldNot(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(len\("12345"\)\)\). instead` + Ω(len("abcd")).ShouldNot(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test ShouldNot(Not", func() { It("should suggest HaveLen", func() { - Ω(len("abcd")).ShouldNot(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(HaveLen\(4\)\). instead` + Ω(len("abcd")).ShouldNot(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.Should\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).ShouldNot(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.Should\(BeEmpty\(\)\). instead` + Ω(len("")).ShouldNot(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\(""\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).ShouldNot(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.Should\(BeEmpty\(\)\). instead` + Ω(len("")).ShouldNot(Not(BeZero())) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\(""\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - Ω(len("abcd")).ShouldNot(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ShouldNot(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - Ω(len("abcd")).ShouldNot(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ShouldNot(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -1169,44 +1169,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Ω(len("abcd")).ShouldNot(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(HaveLen\(11\)\). instead` + Ω(len("abcd")).ShouldNot(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.Should\(HaveLen\(11\)\). instead` }) It("should suggest ShouldNot HaveLen", func() { - Ω(len("abcd")).ShouldNot(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` + Ω(len("abcd")).ShouldNot(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ShouldNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("abcd")).ShouldNot(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ShouldNot(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.Should\(BeEmpty\(\)\). instead` }) It("should suggest ShouldNot BeEmpty", func() { - Ω(len("abcd")).ShouldNot(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ShouldNot(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ShouldNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Ω(len("abcd")).ShouldNot(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.Should\(HaveLen\(len\("1234"\)\)\). instead` + Ω(len("abcd")).ShouldNot(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.Should\(HaveLen\(len\("1234"\)\)\). instead` }) }) Context("test To", func() { It("should suggest HaveLen", func() { - Ω(len("abcd")).To(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(HaveLen\(4\)\). instead` + Ω(len("abcd")).To(Equal(4)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.To\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).To(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.To\(BeEmpty\(\)\). instead` + Ω(len("")).To(Equal(0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\(""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).To(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.To\(BeEmpty\(\)\). instead` + Ω(len("")).To(BeZero()) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\(""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - Ω(len("abcd")).To(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).To(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - Ω(len("abcd")).To(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).To(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -1218,44 +1218,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Ω(len("abcd")).To(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(HaveLen\(11\)\). instead` + Ω(len("abcd")).To(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest ToNot HaveLen", func() { - Ω(len("abcd")).To(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + Ω(len("abcd")).To(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("abcd")).To(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Ω(len("abcd")).To(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - Ω(len("abcd")).To(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).To(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Ω(len("abcd")).To(Equal(len("1234"))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` + Ω(len("abcd")).To(Equal(len("1234"))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` }) }) Context("test To(Not", func() { It("should suggest HaveLen", func() { - Ω(len("abcd")).To(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(4\)\). instead` + Ω(len("abcd")).To(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).To(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("")).To(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\(""\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).To(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("")).To(Not(BeZero())) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\(""\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest To BeEmpty", func() { - Ω(len("abcd")).To(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Ω(len("abcd")).To(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest To BeEmpty", func() { - Ω(len("abcd")).To(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Ω(len("abcd")).To(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -1267,44 +1267,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Ω(len("abcd")).To(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + Ω(len("abcd")).To(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest To HaveLen", func() { - Ω(len("abcd")).To(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(HaveLen\(11\)\). instead` + Ω(len("abcd")).To(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("abcd")).To(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).To(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest To BeEmpty", func() { - Ω(len("abcd")).To(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Ω(len("abcd")).To(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Ω(len("abcd")).To(Not(Equal(len("12345")))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(len\("12345"\)\)\). instead` + Ω(len("abcd")).To(Not(Equal(len("12345")))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test ToNot", func() { It("should suggest HaveLen", func() { - Ω(len("abcd")).ToNot(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(4\)\). instead` + Ω(len("abcd")).ToNot(Equal(4)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).ToNot(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("")).ToNot(Equal(0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\(""\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).ToNot(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("")).ToNot(BeZero()) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\(""\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Ω(len("abcd")).ToNot(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ToNot(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Ω(len("abcd")).ToNot(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ToNot(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -1316,44 +1316,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Ω(len("abcd")).ToNot(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + Ω(len("abcd")).ToNot(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest Should HaveLen", func() { - Ω(len("abcd")).ToNot(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(HaveLen\(11\)\). instead` + Ω(len("abcd")).ToNot(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("abcd")).ToNot(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ToNot(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Ω(len("abcd")).ToNot(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ToNot(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Ω(len("abcd")).ToNot(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(len\("12345"\)\)\). instead` + Ω(len("abcd")).ToNot(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test ToNot(Not", func() { It("should suggest HaveLen", func() { - Ω(len("abcd")).ToNot(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(HaveLen\(4\)\). instead` + Ω(len("abcd")).ToNot(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.To\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).ToNot(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.To\(BeEmpty\(\)\). instead` + Ω(len("")).ToNot(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\(""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).ToNot(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.To\(BeEmpty\(\)\). instead` + Ω(len("")).ToNot(Not(BeZero())) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\(""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - Ω(len("abcd")).ToNot(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ToNot(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - Ω(len("abcd")).ToNot(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ToNot(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -1365,44 +1365,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Ω(len("abcd")).ToNot(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(HaveLen\(11\)\). instead` + Ω(len("abcd")).ToNot(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest ToNot HaveLen", func() { - Ω(len("abcd")).ToNot(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + Ω(len("abcd")).ToNot(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("abcd")).ToNot(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ToNot(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest ToNot BeEmpty", func() { - Ω(len("abcd")).ToNot(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).ToNot(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Ω(len("abcd")).ToNot(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\).To\(HaveLen\(len\("1234"\)\)\). instead` + Ω(len("abcd")).ToNot(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` }) }) Context("test NotTo", func() { It("should suggest HaveLen", func() { - Ω(len("abcd")).NotTo(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.NotTo\(HaveLen\(4\)\). instead` + Ω(len("abcd")).NotTo(Equal(4)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.NotTo\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).NotTo(Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.NotTo\(BeEmpty\(\)\). instead` + Ω(len("")).NotTo(Equal(0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\(""\)\.NotTo\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).NotTo(BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.NotTo\(BeEmpty\(\)\). instead` + Ω(len("")).NotTo(BeZero()) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\(""\)\.NotTo\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Ω(len("abcd")).NotTo(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Ω(len("abcd")).NotTo(BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Ω(len("abcd")).NotTo(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Ω(len("abcd")).NotTo(BeNumerically(">=", 1)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -1414,44 +1414,44 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Ω(len("abcd")).NotTo(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.NotTo\(HaveLen\(11\)\). instead` + Ω(len("abcd")).NotTo(BeNumerically("==", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.NotTo\(HaveLen\(11\)\). instead` }) It("should suggest Should HaveLen", func() { - Ω(len("abcd")).NotTo(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(HaveLen\(11\)\). instead` + Ω(len("abcd")).NotTo(BeNumerically("!=", 11)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("abcd")).NotTo(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.NotTo\(BeEmpty\(\)\). instead` + Ω(len("abcd")).NotTo(BeNumerically("==", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.NotTo\(BeEmpty\(\)\). instead` }) It("should suggest Should BeEmpty", func() { - Ω(len("abcd")).NotTo(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Ω(len("abcd")).NotTo(BeNumerically("!=", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Ω(len("abcd")).NotTo(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.NotTo\(HaveLen\(len\("12345"\)\)\). instead` + Ω(len("abcd")).NotTo(Equal(len("12345"))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.NotTo\(HaveLen\(len\("12345"\)\)\). instead` }) }) Context("test NotTo(Not", func() { It("should suggest HaveLen", func() { - Ω(len("abcd")).NotTo(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(HaveLen\(4\)\). instead` + Ω(len("abcd")).NotTo(Not(Equal(4))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.To\(HaveLen\(4\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).NotTo(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.To\(BeEmpty\(\)\). instead` + Ω(len("")).NotTo(Not(Equal(0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\(""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("")).NotTo(Not(BeZero())) // want `ginkgo-linter: wrong length assertion; consider using .Ω\(""\)\.To\(BeEmpty\(\)\). instead` + Ω(len("")).NotTo(Not(BeZero())) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\(""\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest NotTo BeEmpty", func() { - Ω(len("abcd")).NotTo(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).NotTo(Not(BeNumerically(">", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest NotTo BeEmpty", func() { - Ω(len("abcd")).NotTo(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).NotTo(Not(BeNumerically(">=", 1))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should ignore other lengths", func() { @@ -1463,23 +1463,23 @@ var _ = Describe("test data for the ginkgo-linter", func() { }) It("should suggest HaveLen", func() { - Ω(len("abcd")).NotTo(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(HaveLen\(11\)\). instead` + Ω(len("abcd")).NotTo(Not(BeNumerically("==", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.To\(HaveLen\(11\)\). instead` }) It("should suggest NotTo HaveLen", func() { - Ω(len("abcd")).NotTo(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` + Ω(len("abcd")).NotTo(Not(BeNumerically("!=", 11))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ToNot\(HaveLen\(11\)\). instead` }) It("should suggest BeEmpty", func() { - Ω(len("abcd")).NotTo(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` + Ω(len("abcd")).NotTo(Not(BeNumerically("==", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.To\(BeEmpty\(\)\). instead` }) It("should suggest NotTo BeEmpty", func() { - Ω(len("abcd")).NotTo(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` + Ω(len("abcd")).NotTo(Not(BeNumerically("!=", 0))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.ToNot\(BeEmpty\(\)\). instead` }) It("should suggest HaveLen", func() { - Ω(len("abcd")).NotTo(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion; consider using .Ω\("abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` + Ω(len("abcd")).NotTo(Not(Equal(len("1234")))) // want `ginkgo-linter: wrong length assertion\. Consider using .Ω\("abcd"\)\.To\(HaveLen\(len\("1234"\)\)\). instead` }) }) }) diff --git a/testdata/src/a/len/b.go b/testdata/src/a/len/b.go index 16e7839..bbe4b69 100644 --- a/testdata/src/a/len/b.go +++ b/testdata/src/a/len/b.go @@ -8,13 +8,13 @@ import ( var _ = Describe("", func() { It("", func() { s := []int{1, 2, 3, 4} - Expect(len(s) == 4).Should(Equal(true)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(s\)\.Should\(HaveLen\(4\)\). instead` - Expect(4 == len(s)).Should(Equal(true)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(s\)\.Should\(HaveLen\(4\)\). instead` - Expect(len(s) == 4).WithOffset(1).Should(Equal(true)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(s\)\.WithOffset\(1\)\.Should\(HaveLen\(4\)\). instead` - Expect(4 == len(s)).WithOffset(1).Should(Equal(true)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(s\)\.WithOffset\(1\)\.Should\(HaveLen\(4\)\). instead` + Expect(len(s) == 4).Should(Equal(true)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(s\)\.Should\(HaveLen\(4\)\). instead` + Expect(4 == len(s)).Should(Equal(true)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(s\)\.Should\(HaveLen\(4\)\). instead` + Expect(len(s) == 4).WithOffset(1).Should(Equal(true)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(s\)\.WithOffset\(1\)\.Should\(HaveLen\(4\)\). instead` + Expect(4 == len(s)).WithOffset(1).Should(Equal(true)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(s\)\.WithOffset\(1\)\.Should\(HaveLen\(4\)\). instead` s2 := make([]int, 4) copy(s2, s) - Expect(len(s2) == len(s)).Should(Equal(true)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(s2\)\.Should\(HaveLen\(len\(s\)\)\). instead` - Expect(len(s) == 4).Should(Not(BeFalse())) // want `ginkgo-linter: wrong length assertion; consider using .Expect\(s\)\.Should\(HaveLen\(4\)\). instead` + Expect(len(s2) == len(s)).Should(Equal(true)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(s2\)\.Should\(HaveLen\(len\(s\)\)\). instead` + Expect(len(s) == 4).Should(Not(BeFalse())) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\(s\)\.Should\(HaveLen\(4\)\). instead` }) }) diff --git a/testdata/src/a/len/c.go b/testdata/src/a/len/c.go index 6a5a1ad..336df77 100644 --- a/testdata/src/a/len/c.go +++ b/testdata/src/a/len/c.go @@ -8,19 +8,19 @@ import ( var _ = Describe("", func() { It("", func() { s := []int{1, 2, 3, 4} - g.Expect(len(s) == 4).Should(g.Equal(true)) // want `ginkgo-linter: wrong length assertion; consider using .g\.Expect\(s\).Should\(g\.HaveLen\(4\)\). instead` - g.Expect(4 == len(s)).Should(g.Equal(true)) // want `ginkgo-linter: wrong length assertion; consider using .g\.Expect\(s\).Should\(g\.HaveLen\(4\)\). instead` - g.Expect(4 == len(s)).Should(g.BeTrue()) // want `ginkgo-linter: wrong length assertion; consider using .g\.Expect\(s\).Should\(g\.HaveLen\(4\)\). instead` - g.Expect(len(s) == 4).WithOffset(1).Should(g.Equal(true)) // want `ginkgo-linter: wrong length assertion; consider using .g\.Expect\(s\)\.WithOffset\(1\)\.Should\(g\.HaveLen\(4\)\). instead` - g.Expect(4 == len(s)).WithOffset(1).Should(g.Equal(true)) // want `ginkgo-linter: wrong length assertion; consider using .g\.Expect\(s\)\.WithOffset\(1\)\.Should\(g\.HaveLen\(4\)\). instead` + g.Expect(len(s) == 4).Should(g.Equal(true)) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\(s\)\.Should\(g\.HaveLen\(4\)\). instead` + g.Expect(4 == len(s)).Should(g.Equal(true)) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\(s\)\.Should\(g\.HaveLen\(4\)\). instead` + g.Expect(4 == len(s)).Should(g.BeTrue()) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\(s\)\.Should\(g\.HaveLen\(4\)\). instead` + g.Expect(len(s) == 4).WithOffset(1).Should(g.Equal(true)) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\(s\)\.WithOffset\(1\)\.Should\(g\.HaveLen\(4\)\). instead` + g.Expect(4 == len(s)).WithOffset(1).Should(g.Equal(true)) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\(s\)\.WithOffset\(1\)\.Should\(g\.HaveLen\(4\)\). instead` }) It("", func() { s := []int{1, 2, 3, 4} - g.Expect(len(s) != 4).Should(g.Equal(false)) // want `ginkgo-linter: wrong length assertion; consider using .g\.Expect\(s\)\.Should\(g\.HaveLen\(4\)\). instead` - g.Expect(4 != len(s)).ShouldNot(g.Equal(true)) // want `ginkgo-linter: wrong length assertion; consider using .g\.Expect\(s\)\.Should\(g\.HaveLen\(4\)\). instead` - g.Expect(4 != len(s)).Should(g.BeFalse()) // want `ginkgo-linter: wrong length assertion; consider using .g\.Expect\(s\)\.Should\(g\.HaveLen\(4\)\). instead` - g.Expect(len(s) != 4).WithOffset(1).Should(g.Equal(false)) // want `ginkgo-linter: wrong length assertion; consider using .g\.Expect\(s\).WithOffset\(1\)\.Should\(g\.HaveLen\(4\)\). instead` - g.Expect(4 != len(s)).WithOffset(1).ShouldNot(g.Equal(true)) // want `ginkgo-linter: wrong length assertion; consider using .g\.Expect\(s\).WithOffset\(1\)\.Should\(g\.HaveLen\(4\)\). instead` - g.Expect(len(s) == 5).WithOffset(1).Should(g.Equal(false)) // want `ginkgo-linter: wrong length assertion; consider using .g\.Expect\(s\).WithOffset\(1\)\.ShouldNot\(g\.HaveLen\(5\)\). instead` + g.Expect(len(s) != 4).Should(g.Equal(false)) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\(s\)\.Should\(g\.HaveLen\(4\)\). instead` + g.Expect(4 != len(s)).ShouldNot(g.Equal(true)) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\(s\)\.Should\(g\.HaveLen\(4\)\). instead` + g.Expect(4 != len(s)).Should(g.BeFalse()) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\(s\)\.Should\(g\.HaveLen\(4\)\). instead` + g.Expect(len(s) != 4).WithOffset(1).Should(g.Equal(false)) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\(s\)\.WithOffset\(1\)\.Should\(g\.HaveLen\(4\)\). instead` + g.Expect(4 != len(s)).WithOffset(1).ShouldNot(g.Equal(true)) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\(s\)\.WithOffset\(1\)\.Should\(g\.HaveLen\(4\)\). instead` + g.Expect(len(s) == 5).WithOffset(1).Should(g.Equal(false)) // want `ginkgo-linter: wrong length assertion\. Consider using .g\.Expect\(s\)\.WithOffset\(1\)\.ShouldNot\(g\.HaveLen\(5\)\). instead` }) }) diff --git a/testdata/src/a/matcherror/matcherror.go b/testdata/src/a/matcherror/matcherror.go index 88c88dd..2c68ec2 100644 --- a/testdata/src/a/matcherror/matcherror.go +++ b/testdata/src/a/matcherror/matcherror.go @@ -79,7 +79,7 @@ var _ = Describe("Check MatchError", func() { one := 1 Expect(one).To(MatchError("example")) // want `ginkgo-linter: the MatchError matcher used to assert a non error type \(one\)` Expect(e1).To(MatchError(isExample)) // want `ginkgo-linter: missing function description as second parameter of MatchError` - Expect(e1).To(MatchError(f1)) // want `ginkgo-linter: MatchError first parameter \(f1\) must be error, string, GomegaMatcher or func\(error\)bool are allowed` + Expect(e1).To(MatchError(f1)) // want `ginkgo-linter: multiple issues: MatchError first parameter \(f1\) must be error, string, GomegaMatcher or func\(error\)bool are allowed; redundant MatchError arguments; consider removing them` }) It("two arguments - valid", func() { @@ -102,14 +102,14 @@ var _ = Describe("Check MatchError", func() { }) It("two arguments - wrong usage", func() { - Expect(e1).To(MatchError(e2, "not used"), "this text is ok") // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .MatchError\(e2\). instead` - Expect(e1).To(MatchError("example", "not used"), "this text is ok") // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .MatchError\("example"\). instead` - Expect(e1).To(MatchError(ContainSubstring("amp"), "not used"), "this text is ok") // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .MatchError\(ContainSubstring\("amp"\)\). instead` + Expect(e1).To(MatchError(e2, "not used"), "this text is ok") // want `ginkgo-linter: redundant MatchError arguments; consider removing them` + Expect(e1).To(MatchError("example", "not used"), "this text is ok") // want `ginkgo-linter: redundant MatchError arguments; consider removing them` + Expect(e1).To(MatchError(ContainSubstring("amp"), "not used"), "this text is ok") // want `ginkgo-linter: redundant MatchError arguments; consider removing them` }) It("two arguments - invalid", func() { - Expect(e1).To(MatchError(1, "not used"), "wrong type - int") // want `ginkgo-linter: MatchError first parameter \(1\) must be error, string, GomegaMatcher or func\(error\)bool are allowed` - Expect(e1).To(MatchError(compareString, "wrong function signature")) // want `ginkgo-linter: MatchError first parameter \(compareString\) must be error, string, GomegaMatcher or func\(error\)bool are allowed` + Expect(e1).To(MatchError(1, "not used"), "wrong type - int") // want `ginkgo-linter: multiple issues: MatchError first parameter \(1\) must be error, string, GomegaMatcher or func\(error\)bool are allowed; redundant MatchError arguments; consider removing them` + Expect(e1).To(MatchError(compareString, "wrong function signature")) // want `ginkgo-linter: multiple issues: MatchError first parameter \(compareString\) must be error, string, GomegaMatcher or func\(error\)bool are allowed; redundant MatchError arguments; consider removing them` }) It("two arguments. Second is not a string", func() { @@ -119,11 +119,11 @@ var _ = Describe("Check MatchError", func() { }) It("multiple arguments", func() { - Expect(e1).To(MatchError(isExample, "is it the example error", "not used")) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .MatchError\(isExample, "is it the example error"\). instead` - Expect(e1).To(MatchError(isExample, "is it the example error", "not used", "not used")) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .MatchError\(isExample, "is it the example error"\). instead` - Expect(e1).To(MatchError(e2, "not used", "not used")) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .MatchError\(e2\). instead` - Expect(e1).To(MatchError("example", "not used", "not used")) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .MatchError\("example"\). instead` - Expect(e1).To(MatchError(ContainSubstring("amp"), "not used", "not used")) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .MatchError\(ContainSubstring\("amp"\)\). instead` + Expect(e1).To(MatchError(isExample, "is it the example error", "not used")) // want `ginkgo-linter: redundant MatchError arguments; consider removing them` + Expect(e1).To(MatchError(isExample, "is it the example error", "not used", "not used")) // want `ginkgo-linter: redundant MatchError arguments; consider removing them` + Expect(e1).To(MatchError(e2, "not used", "not used")) // want `ginkgo-linter: redundant MatchError arguments; consider removing them` + Expect(e1).To(MatchError("example", "not used", "not used")) // want `ginkgo-linter: redundant MatchError arguments; consider removing them` + Expect(e1).To(MatchError(ContainSubstring("amp"), "not used", "not used")) // want `ginkgo-linter: redundant MatchError arguments; consider removing them` }) It("funcs - valid", func() { @@ -143,19 +143,19 @@ var _ = Describe("Check MatchError", func() { It("and - invalid", func() { var err error = e1 - Expect(err).To(And(Not(BeNil()), MatchError("expect", "not used"))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .MatchError\("expect"\). instead` + Expect(err).To(And(Not(BeNil()), MatchError("expect", "not used"))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them` Expect(err).To(And(MatchError("expect"), MatchError(e2))) // valid - Expect(err).To(And(MatchError("expect", "not used"), MatchError(e2, "not used"))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .MatchError\("expect"\). instead` `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .MatchError\(e2\). instead` - Expect(err).To(And(MatchError("expect", "not used"), MatchError(e2))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .MatchError\("expect"\). instead` - Expect(err).To(And(MatchError("expect"), MatchError(e2, "not used"))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .MatchError\(e2\). instead` + Expect(err).To(And(MatchError("expect", "not used"), MatchError(e2, "not used"))) // want `ginkgo-linter: multiple issues: redundant MatchError arguments; consider removing them; redundant MatchError arguments; consider removing them` + Expect(err).To(And(MatchError("expect", "not used"), MatchError(e2))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them` + Expect(err).To(And(MatchError("expect"), MatchError(e2, "not used"))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them` }) It("or - invalid", func() { var err error = e1 - Expect(err).To(Or(Not(BeNil()), MatchError("expect", "not used"))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .MatchError\("expect"\). instead` + Expect(err).To(Or(Not(BeNil()), MatchError("expect", "not used"))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them` Expect(err).To(Or(MatchError("expect"), MatchError(e2))) // valid - Expect(err).To(Or(MatchError("expect", "not used"), MatchError(e2, "not used"))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .MatchError\("expect"\). instead` `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .MatchError\(e2\). instead` - Expect(err).To(Or(MatchError("expect", "not used"), MatchError(e2))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .MatchError\("expect"\). instead` - Expect(err).To(Or(MatchError("expect"), MatchError(e2, "not used"))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .MatchError\(e2\). instead` + Expect(err).To(Or(MatchError("expect", "not used"), MatchError(e2, "not used"))) // want `ginkgo-linter: multiple issues: redundant MatchError arguments; consider removing them; redundant MatchError arguments; consider removing them` + Expect(err).To(Or(MatchError("expect", "not used"), MatchError(e2))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them` + Expect(err).To(Or(MatchError("expect"), MatchError(e2, "not used"))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them` }) }) diff --git a/testdata/src/a/matcherror/matcherror.gomega.go b/testdata/src/a/matcherror/matcherror.gomega.go index 7b659d4..43f5041 100644 --- a/testdata/src/a/matcherror/matcherror.gomega.go +++ b/testdata/src/a/matcherror/matcherror.gomega.go @@ -33,7 +33,7 @@ var _ = Describe("Check MatchError", func() { one := 1 gomega.Expect(one).To(gomega.MatchError("example")) // want `ginkgo-linter: the MatchError matcher used to assert a non error type \(one\)` gomega.Expect(e1).To(gomega.MatchError(isExample)) // want `ginkgo-linter: missing function description as second parameter of MatchError` - gomega.Expect(e1).To(gomega.MatchError(f1)) // want `ginkgo-linter: MatchError first parameter \(f1\) must be error, string, GomegaMatcher or func\(error\)bool are allowed` + gomega.Expect(e1).To(gomega.MatchError(f1)) // want `ginkgo-linter: multiple issues: MatchError first parameter \(f1\) must be error, string, GomegaMatcher or func\(error\)bool are allowed; redundant MatchError arguments; consider removing them` }) It("two arguments - valid", func() { @@ -56,14 +56,14 @@ var _ = Describe("Check MatchError", func() { }) It("two arguments - wrong usage", func() { - gomega.Expect(e1).To(gomega.MatchError(e2, "not used"), "this text is ok") // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .gomega\.MatchError\(e2\). instead` - gomega.Expect(e1).To(gomega.MatchError("example", "not used"), "this text is ok") // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .gomega\.MatchError\("example"\). instead` - gomega.Expect(e1).To(gomega.MatchError(gomega.ContainSubstring("amp"), "not used"), "this text is ok") // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .gomega\.MatchError\(gomega\.ContainSubstring\("amp"\)\). instead` + gomega.Expect(e1).To(gomega.MatchError(e2, "not used"), "this text is ok") // want `ginkgo-linter: redundant MatchError arguments; consider removing them` + gomega.Expect(e1).To(gomega.MatchError("example", "not used"), "this text is ok") // want `ginkgo-linter: redundant MatchError arguments; consider removing them` + gomega.Expect(e1).To(gomega.MatchError(gomega.ContainSubstring("amp"), "not used"), "this text is ok") // want `ginkgo-linter: redundant MatchError arguments; consider removing them` }) It("two arguments - invalid", func() { - gomega.Expect(e1).To(gomega.MatchError(1, "not used"), "wrong type - int") // want `ginkgo-linter: MatchError first parameter \(1\) must be error, string, GomegaMatcher or func\(error\)bool are allowed` - gomega.Expect(e1).To(gomega.MatchError(compareString, "wrong function signature")) // want `ginkgo-linter: MatchError first parameter \(compareString\) must be error, string, GomegaMatcher or func\(error\)bool are allowed` + gomega.Expect(e1).To(gomega.MatchError(1, "not used"), "wrong type - int") // want `ginkgo-linter: multiple issues: MatchError first parameter \(1\) must be error, string, GomegaMatcher or func\(error\)bool are allowed; redundant MatchError arguments; consider removing them` + gomega.Expect(e1).To(gomega.MatchError(compareString, "wrong function signature")) // want `ginkgo-linter: multiple issues: MatchError first parameter \(compareString\) must be error, string, GomegaMatcher or func\(error\)bool are allowed; redundant MatchError arguments; consider removing them` }) It("two arguments. Second is not a string", func() { @@ -73,11 +73,11 @@ var _ = Describe("Check MatchError", func() { }) It("multiple arguments", func() { - gomega.Expect(e1).To(gomega.MatchError(isExample, "is it the example error", "not used")) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .gomega\.MatchError\(isExample, "is it the example error"\). instead` - gomega.Expect(e1).To(gomega.MatchError(isExample, "is it the example error", "not used", "not used")) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .gomega\.MatchError\(isExample, "is it the example error"\). instead` - gomega.Expect(e1).To(gomega.MatchError(e2, "not used", "not used")) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .gomega\.MatchError\(e2\). instead` - gomega.Expect(e1).To(gomega.MatchError("example", "not used", "not used")) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .gomega\.MatchError\("example"\). instead` - gomega.Expect(e1).To(gomega.MatchError(gomega.ContainSubstring("amp"), "not used", "not used")) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .gomega\.MatchError\(gomega\.ContainSubstring\("amp"\)\). instead` + gomega.Expect(e1).To(gomega.MatchError(isExample, "is it the example error", "not used")) // want `ginkgo-linter: redundant MatchError arguments; consider removing them` + gomega.Expect(e1).To(gomega.MatchError(isExample, "is it the example error", "not used", "not used")) // want `ginkgo-linter: redundant MatchError arguments; consider removing them` + gomega.Expect(e1).To(gomega.MatchError(e2, "not used", "not used")) // want `ginkgo-linter: redundant MatchError arguments; consider removing them` + gomega.Expect(e1).To(gomega.MatchError("example", "not used", "not used")) // want `ginkgo-linter: redundant MatchError arguments; consider removing them` + gomega.Expect(e1).To(gomega.MatchError(gomega.ContainSubstring("amp"), "not used", "not used")) // want `ginkgo-linter: redundant MatchError arguments; consider removing them` }) It("funcs - valid", func() { @@ -97,20 +97,20 @@ var _ = Describe("Check MatchError", func() { It("and - invalid", func() { var err error = e1 - gomega.Expect(err).To(gomega.And(gomega.Not(gomega.BeNil()), gomega.MatchError("expect", "not used"))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .gomega\.MatchError\("expect"\). instead` + gomega.Expect(err).To(gomega.And(gomega.Not(gomega.BeNil()), gomega.MatchError("expect", "not used"))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them` gomega.Expect(err).To(gomega.And(gomega.MatchError("expect"), gomega.MatchError(e2))) // valid - gomega.Expect(err).To(gomega.And(gomega.MatchError("expect", "not used"), gomega.MatchError(e2, "not used"))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .gomega\.MatchError\("expect"\). instead` `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .gomega\.MatchError\(e2\). instead` - gomega.Expect(err).To(gomega.And(gomega.MatchError("expect", "not used"), gomega.MatchError(e2))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .gomega\.MatchError\("expect"\). instead` - gomega.Expect(err).To(gomega.And(gomega.MatchError("expect"), gomega.MatchError(e2, "not used"))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .gomega\.MatchError\(e2\). instead` + gomega.Expect(err).To(gomega.And(gomega.MatchError("expect", "not used"), gomega.MatchError(e2, "not used"))) // want `ginkgo-linter: multiple issues: redundant MatchError arguments; consider removing them; redundant MatchError arguments; consider removing them` + gomega.Expect(err).To(gomega.And(gomega.MatchError("expect", "not used"), gomega.MatchError(e2))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them` + gomega.Expect(err).To(gomega.And(gomega.MatchError("expect"), gomega.MatchError(e2, "not used"))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them` }) It("or - invalid", func() { var err error = e1 - gomega.Expect(err).To(gomega.Or(gomega.Not(gomega.BeNil()), gomega.MatchError("expect", "not used"))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .gomega\.MatchError\("expect"\). instead` + gomega.Expect(err).To(gomega.Or(gomega.Not(gomega.BeNil()), gomega.MatchError("expect", "not used"))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them` gomega.Expect(err).To(gomega.Or(gomega.MatchError("expect"), gomega.MatchError(e2))) // valid - gomega.Expect(err).To(gomega.Or(gomega.MatchError("expect", "not used"), gomega.MatchError(e2, "not used"))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .gomega\.MatchError\("expect"\). instead` `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .gomega\.MatchError\(e2\). instead` - gomega.Expect(err).To(gomega.Or(gomega.MatchError("expect", "not used"), gomega.MatchError(e2))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .gomega\.MatchError\("expect"\). instead` - gomega.Expect(err).To(gomega.Or(gomega.MatchError("expect"), gomega.MatchError(e2, "not used"))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them; consider using .gomega\.MatchError\(e2\). instead` + gomega.Expect(err).To(gomega.Or(gomega.MatchError("expect", "not used"), gomega.MatchError(e2, "not used"))) // want `ginkgo-linter: multiple issues: redundant MatchError arguments; consider removing them; redundant MatchError arguments; consider removing them` + gomega.Expect(err).To(gomega.Or(gomega.MatchError("expect", "not used"), gomega.MatchError(e2))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them` + gomega.Expect(err).To(gomega.Or(gomega.MatchError("expect"), gomega.MatchError(e2, "not used"))) // want `ginkgo-linter: redundant MatchError arguments; consider removing them` }) }) diff --git a/testdata/src/a/nil/a.go b/testdata/src/a/nil/a.go index fcb5bb4..52d67f0 100644 --- a/testdata/src/a/nil/a.go +++ b/testdata/src/a/nil/a.go @@ -24,149 +24,149 @@ var _ = Describe("", func() { Context("test Should", func() { Context("test BeTrue", func() { It("test nil value", func() { - Expect(x == nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` - Expect(x == nil).WithOffset(1).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.WithOffset\(1\)\.Should\(BeNil\(\)\). instead` - Expect(nil == x).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` + Expect(x == nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` + Expect(x == nil).WithOffset(1).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.WithOffset\(1\)\.Should\(BeNil\(\)\). instead` + Expect(nil == x).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y != nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` - Expect(nil != y).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(y != nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(nil != y).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() == nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` - Expect(nil == fNil()).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Expect(fNil() == nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Expect(nil == fNil()).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() != nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - Expect(nil != fNotNil()).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(fNotNil() != nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(nil != fNotNil()).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test BeFalse", func() { It("test nil value", func() { - Expect(x != nil).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` - Expect(nil != x).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` + Expect(x != nil).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` + Expect(nil != x).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y == nil).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` - Expect(nil == y).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(y == nil).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(nil == y).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() != nil).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` - Expect(nil != fNil()).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Expect(fNil() != nil).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Expect(nil != fNil()).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() == nil).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - Expect(nil == fNotNil()).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(fNotNil() == nil).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(nil == fNotNil()).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test Equal(true)", func() { It("test nil value", func() { - Expect(x == nil).WithOffset(1).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.WithOffset\(1\)\.Should\(BeNil\(\)\). instead` - Expect(nil == x).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` + Expect(x == nil).WithOffset(1).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.WithOffset\(1\)\.Should\(BeNil\(\)\). instead` + Expect(nil == x).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y != nil).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` - Expect(nil != y).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(y != nil).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(nil != y).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() == nil).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` - Expect(nil == fNil()).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Expect(fNil() == nil).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Expect(nil == fNil()).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() != nil).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - Expect(nil != fNotNil()).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(fNotNil() != nil).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(nil != fNotNil()).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test Equal(false)", func() { It("test nil value", func() { - Expect(x != nil).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` - Expect(nil != x).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` + Expect(x != nil).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` + Expect(nil != x).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y == nil).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` - Expect(nil == y).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(y == nil).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(nil == y).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() != nil).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` - Expect(nil != fNil()).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Expect(fNil() != nil).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Expect(nil != fNil()).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() == nil).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - Expect(nil == fNotNil()).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(fNotNil() == nil).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(nil == fNotNil()).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) }) Context("test Should(Not())", func() { Context("test BeTrue", func() { It("test nil value", func() { - Expect(x == nil).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` - Expect(nil == x).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` + Expect(x == nil).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` + Expect(nil == x).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y != nil).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` - Expect(nil != y).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(y != nil).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(nil != y).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() == nil).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` - Expect(nil == fNil()).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Expect(fNil() == nil).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Expect(nil == fNil()).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() != nil).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - Expect(nil != fNotNil()).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(fNotNil() != nil).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(nil != fNotNil()).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test BeFalse", func() { It("test nil value", func() { - Expect(x != nil).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` - Expect(nil != x).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` + Expect(x != nil).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` + Expect(nil != x).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y == nil).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` - Expect(nil == y).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(y == nil).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(nil == y).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() != nil).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` - Expect(nil != fNil()).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Expect(fNil() != nil).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Expect(nil != fNil()).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() == nil).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - Expect(nil == fNotNil()).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(fNotNil() == nil).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(nil == fNotNil()).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test Equal(false)", func() { It("test nil value", func() { - Expect(x == nil).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` - Expect(nil == x).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` + Expect(x == nil).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` + Expect(nil == x).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y != nil).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` - Expect(nil != y).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(y != nil).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(nil != y).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() == nil).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` - Expect(nil == fNil()).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Expect(fNil() == nil).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Expect(nil == fNil()).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() != nil).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - Expect(nil != fNotNil()).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(fNotNil() != nil).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(nil != fNotNil()).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test Equal(true)", func() { It("test nil value", func() { - Expect(x != nil).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` - Expect(nil != x).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` + Expect(x != nil).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` + Expect(nil != x).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y == nil).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` - Expect(nil == y).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(y == nil).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(nil == y).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() != nil).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` - Expect(nil != fNil()).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Expect(fNil() != nil).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Expect(nil != fNil()).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() == nil).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - Expect(nil == fNotNil()).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(fNotNil() == nil).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(nil == fNotNil()).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) }) @@ -174,148 +174,148 @@ var _ = Describe("", func() { Context("test To", func() { Context("test BeTrue", func() { It("test nil value", func() { - Expect(x == nil).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` - Expect(nil == x).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(x == nil).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(nil == x).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y != nil).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil != y).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(y != nil).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil != y).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() == nil).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Expect(nil == fNil()).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(fNil() == nil).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(nil == fNil()).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() != nil).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil != fNotNil()).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(fNotNil() != nil).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil != fNotNil()).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test BeFalse", func() { It("test nil value", func() { - Expect(x != nil).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` - Expect(nil != x).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(x != nil).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(nil != x).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y == nil).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil == y).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(y == nil).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil == y).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() != nil).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Expect(nil != fNil()).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(fNil() != nil).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(nil != fNil()).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() == nil).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil == fNotNil()).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(fNotNil() == nil).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil == fNotNil()).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test Equal(true)", func() { It("test nil value", func() { - Expect(x == nil).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` - Expect(nil == x).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(x == nil).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(nil == x).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y != nil).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil != y).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(y != nil).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil != y).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() == nil).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Expect(nil == fNil()).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(fNil() == nil).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(nil == fNil()).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() != nil).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil != fNotNil()).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(fNotNil() != nil).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil != fNotNil()).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test Equal(false)", func() { It("test nil value", func() { - Expect(x != nil).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` - Expect(nil != x).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(x != nil).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(nil != x).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y == nil).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil == y).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(y == nil).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil == y).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() != nil).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Expect(nil != fNil()).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(fNil() != nil).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(nil != fNil()).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() == nil).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil == fNotNil()).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(fNotNil() == nil).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil == fNotNil()).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) }) Context("test To(Not())", func() { Context("test BeTrue", func() { It("test nil value", func() { - Expect(x == nil).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` - Expect(nil == x).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(x == nil).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(nil == x).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y != nil).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil != y).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(y != nil).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil != y).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() == nil).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Expect(nil == fNil()).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(fNil() == nil).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(nil == fNil()).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() != nil).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil != fNotNil()).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(fNotNil() != nil).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil != fNotNil()).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test BeFalse", func() { It("test nil value", func() { - Expect(x != nil).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` - Expect(nil != x).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(x != nil).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(nil != x).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y == nil).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil == y).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(y == nil).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil == y).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() != nil).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Expect(nil != fNil()).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(fNil() != nil).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(nil != fNil()).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() == nil).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil == fNotNil()).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(fNotNil() == nil).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil == fNotNil()).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test Equal(false)", func() { It("test nil value", func() { - Expect(x == nil).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` - Expect(nil == x).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(x == nil).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(nil == x).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y != nil).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil != y).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(y != nil).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil != y).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() == nil).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Expect(nil == fNil()).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(fNil() == nil).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(nil == fNil()).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() != nil).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil != fNotNil()).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(fNotNil() != nil).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil != fNotNil()).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test Equal(true)", func() { It("test nil value", func() { - Expect(x != nil).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` - Expect(nil != x).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(x != nil).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(nil != x).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y == nil).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil == y).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(y == nil).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil == y).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() != nil).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Expect(nil != fNil()).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(fNil() != nil).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(nil != fNil()).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() == nil).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil == fNotNil()).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(fNotNil() == nil).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil == fNotNil()).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) }) @@ -323,74 +323,74 @@ var _ = Describe("", func() { Context("test ShouldNot", func() { Context("test BeFalse", func() { It("test nil value", func() { - Expect(x == nil).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` - Expect(nil == x).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` + Expect(x == nil).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` + Expect(nil == x).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y != nil).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` - Expect(nil != y).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(y != nil).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(nil != y).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() == nil).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` - Expect(nil == fNil()).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Expect(fNil() == nil).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Expect(nil == fNil()).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() != nil).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - Expect(nil != fNotNil()).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(fNotNil() != nil).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(nil != fNotNil()).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test BeTrue", func() { It("test nil value", func() { - Expect(x != nil).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` - Expect(nil != x).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` + Expect(x != nil).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` + Expect(nil != x).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y == nil).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` - Expect(nil == y).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(y == nil).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(nil == y).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() != nil).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` - Expect(nil != fNil()).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Expect(fNil() != nil).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Expect(nil != fNil()).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() == nil).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - Expect(nil == fNotNil()).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(fNotNil() == nil).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(nil == fNotNil()).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test Equal(true)", func() { It("test nil value", func() { - Expect(x != nil).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` - Expect(nil != x).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` + Expect(x != nil).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` + Expect(nil != x).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y == nil).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` - Expect(nil == y).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(y == nil).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(nil == y).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() != nil).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` - Expect(nil != fNil()).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Expect(fNil() != nil).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Expect(nil != fNil()).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() == nil).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - Expect(nil == fNotNil()).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(fNotNil() == nil).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(nil == fNotNil()).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test Equal(false)", func() { It("test nil value", func() { - Expect(x == nil).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` - Expect(nil == x).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` + Expect(x == nil).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` + Expect(nil == x).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y != nil).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` - Expect(nil != y).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(y != nil).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(nil != y).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() == nil).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` - Expect(nil == fNil()).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Expect(fNil() == nil).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Expect(nil == fNil()).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() != nil).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - Expect(nil != fNotNil()).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(fNotNil() != nil).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(nil != fNotNil()).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) }) @@ -398,148 +398,148 @@ var _ = Describe("", func() { Context("test NotTo", func() { Context("test BeFalse", func() { It("test nil value", func() { - Expect(x == nil).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` - Expect(nil == x).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(x == nil).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(nil == x).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y != nil).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil != y).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(y != nil).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil != y).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() == nil).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Expect(nil == fNil()).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(fNil() == nil).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(nil == fNil()).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() != nil).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil != fNotNil()).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(fNotNil() != nil).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil != fNotNil()).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test BeTrue", func() { It("test nil value", func() { - Expect(x != nil).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` - Expect(nil != x).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(x != nil).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(nil != x).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y == nil).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.NotTo\(BeNil\(\)\). instead` - Expect(nil == y).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.NotTo\(BeNil\(\)\). instead` + Expect(y == nil).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.NotTo\(BeNil\(\)\). instead` + Expect(nil == y).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.NotTo\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() != nil).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Expect(nil != fNil()).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(fNil() != nil).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(nil != fNil()).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() == nil).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.NotTo\(BeNil\(\)\). instead` - Expect(nil == fNotNil()).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.NotTo\(BeNil\(\)\). instead` + Expect(fNotNil() == nil).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.NotTo\(BeNil\(\)\). instead` + Expect(nil == fNotNil()).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.NotTo\(BeNil\(\)\). instead` }) }) Context("test Equal(true)", func() { It("test nil value", func() { - Expect(x != nil).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` - Expect(nil != x).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(x != nil).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(nil != x).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y == nil).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.NotTo\(BeNil\(\)\). instead` - Expect(nil == y).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.NotTo\(BeNil\(\)\). instead` + Expect(y == nil).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.NotTo\(BeNil\(\)\). instead` + Expect(nil == y).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.NotTo\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() != nil).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Expect(nil != fNil()).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(fNil() != nil).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(nil != fNil()).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() == nil).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.NotTo\(BeNil\(\)\). instead` - Expect(nil == fNotNil()).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.NotTo\(BeNil\(\)\). instead` + Expect(fNotNil() == nil).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.NotTo\(BeNil\(\)\). instead` + Expect(nil == fNotNil()).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.NotTo\(BeNil\(\)\). instead` }) }) Context("test Equal(false)", func() { It("test nil value", func() { - Expect(x == nil).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` - Expect(nil == x).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(x == nil).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(nil == x).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y != nil).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil != y).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(y != nil).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil != y).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() == nil).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Expect(nil == fNil()).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(fNil() == nil).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(nil == fNil()).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() != nil).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil != fNotNil()).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(fNotNil() != nil).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil != fNotNil()).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) }) Context("test ToNot", func() { Context("test BeFalse", func() { It("test nil value", func() { - Expect(x == nil).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` - Expect(nil == x).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(x == nil).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(nil == x).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y != nil).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil != y).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(y != nil).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil != y).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() == nil).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Expect(nil == fNil()).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(fNil() == nil).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(nil == fNil()).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() != nil).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil != fNotNil()).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(fNotNil() != nil).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil != fNotNil()).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test BeTrue", func() { It("test nil value", func() { - Expect(x != nil).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` - Expect(nil != x).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(x != nil).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(nil != x).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y == nil).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil == y).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(y == nil).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil == y).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() != nil).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Expect(nil != fNil()).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(fNil() != nil).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(nil != fNil()).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() == nil).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil == fNotNil()).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(fNotNil() == nil).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil == fNotNil()).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test Equal(true)", func() { It("test nil value", func() { - Expect(x != nil).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` - Expect(nil != x).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(x != nil).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(nil != x).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y == nil).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil == y).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(y == nil).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil == y).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() != nil).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Expect(nil != fNil()).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(fNil() != nil).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(nil != fNil()).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() == nil).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil == fNotNil()).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(fNotNil() == nil).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil == fNotNil()).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test Equal(false)", func() { It("test nil value", func() { - Expect(x == nil).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` - Expect(nil == x).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(x == nil).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` + Expect(nil == x).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Expect(y != nil).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil != y).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(y != nil).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil != y).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Expect(fNil() == nil).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Expect(nil == fNil()).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(fNil() == nil).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Expect(nil == fNil()).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Expect(fNotNil() != nil).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Expect(nil != fNotNil()).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(fNotNil() != nil).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Expect(nil != fNotNil()).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) }) @@ -549,148 +549,148 @@ var _ = Describe("", func() { Context("test Should", func() { Context("test BeTrue", func() { It("test nil value", func() { - ExpectWithOffset(1, x == nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == x).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, x == nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == x).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y != nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != y).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y != nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != y).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() == nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNil()).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() == nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNil()).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() != nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNotNil()).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() != nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNotNil()).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test BeFalse", func() { It("test nil value", func() { - ExpectWithOffset(1, x != nil).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != x).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, x != nil).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != x).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y == nil).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == y).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y == nil).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == y).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() != nil).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNil()).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() != nil).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNil()).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() == nil).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNotNil()).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() == nil).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNotNil()).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test Equal(true)", func() { It("test nil value", func() { - ExpectWithOffset(1, x == nil).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == x).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, x == nil).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == x).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y != nil).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != y).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y != nil).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != y).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() == nil).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNil()).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() == nil).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNil()).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() != nil).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNotNil()).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() != nil).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNotNil()).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test Equal(false)", func() { It("test nil value", func() { - ExpectWithOffset(1, x != nil).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != x).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, x != nil).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != x).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y == nil).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == y).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y == nil).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == y).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() != nil).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNil()).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() != nil).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNil()).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() == nil).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNotNil()).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() == nil).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNotNil()).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) }) Context("test Should(Not())", func() { Context("test BeTrue", func() { It("test nil value", func() { - ExpectWithOffset(1, x == nil).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == x).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, x == nil).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == x).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y != nil).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != y).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y != nil).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != y).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() == nil).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNil()).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() == nil).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNil()).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() != nil).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNotNil()).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() != nil).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNotNil()).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test BeFalse", func() { It("test nil value", func() { - ExpectWithOffset(1, x != nil).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != x).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, x != nil).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != x).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y == nil).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == y).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y == nil).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == y).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() != nil).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNil()).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() != nil).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNil()).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() == nil).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNotNil()).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() == nil).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNotNil()).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test Equal(false)", func() { It("test nil value", func() { - ExpectWithOffset(1, x == nil).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == x).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, x == nil).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == x).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y != nil).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != y).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y != nil).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != y).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() == nil).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNil()).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() == nil).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNil()).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() != nil).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNotNil()).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() != nil).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNotNil()).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test Equal(true)", func() { It("test nil value", func() { - ExpectWithOffset(1, x != nil).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != x).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, x != nil).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != x).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y == nil).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == y).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y == nil).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == y).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() != nil).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNil()).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() != nil).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNil()).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() == nil).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNotNil()).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() == nil).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNotNil()).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) }) @@ -698,148 +698,148 @@ var _ = Describe("", func() { Context("test To", func() { Context("test BeTrue", func() { It("test nil value", func() { - ExpectWithOffset(1, x == nil).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == x).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, x == nil).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == x).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y != nil).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != y).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y != nil).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != y).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() == nil).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNil()).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() == nil).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNil()).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() != nil).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNotNil()).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() != nil).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNotNil()).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test BeFalse", func() { It("test nil value", func() { - ExpectWithOffset(1, x != nil).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != x).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, x != nil).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != x).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y == nil).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == y).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y == nil).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == y).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() != nil).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNil()).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() != nil).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNil()).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() == nil).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNotNil()).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() == nil).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNotNil()).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test Equal(true)", func() { It("test nil value", func() { - ExpectWithOffset(1, x == nil).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == x).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, x == nil).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == x).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y != nil).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != y).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y != nil).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != y).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() == nil).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNil()).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() == nil).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNil()).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() != nil).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNotNil()).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() != nil).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNotNil()).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test Equal(false)", func() { It("test nil value", func() { - ExpectWithOffset(1, x != nil).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != x).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, x != nil).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != x).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y == nil).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == y).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y == nil).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == y).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() != nil).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNil()).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() != nil).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNil()).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() == nil).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNotNil()).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() == nil).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNotNil()).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) }) Context("test To(Not())", func() { Context("test BeTrue", func() { It("test nil value", func() { - ExpectWithOffset(1, x == nil).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == x).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, x == nil).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == x).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y != nil).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != y).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y != nil).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != y).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() == nil).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNil()).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() == nil).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNil()).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() != nil).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNotNil()).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() != nil).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNotNil()).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test BeFalse", func() { It("test nil value", func() { - ExpectWithOffset(1, x != nil).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != x).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, x != nil).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != x).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y == nil).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == y).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y == nil).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == y).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() != nil).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNil()).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() != nil).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNil()).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() == nil).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNotNil()).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() == nil).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNotNil()).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test Equal(false)", func() { It("test nil value", func() { - ExpectWithOffset(1, x == nil).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == x).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, x == nil).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == x).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y != nil).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != y).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y != nil).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != y).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() == nil).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNil()).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() == nil).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNil()).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() != nil).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNotNil()).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() != nil).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNotNil()).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test Equal(true)", func() { It("test nil value", func() { - ExpectWithOffset(1, x != nil).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != x).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, x != nil).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != x).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y == nil).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == y).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y == nil).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == y).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() != nil).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNil()).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() != nil).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNil()).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() == nil).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNotNil()).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() == nil).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNotNil()).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) }) @@ -847,74 +847,74 @@ var _ = Describe("", func() { Context("test ShouldNot", func() { Context("test BeFalse", func() { It("test nil value", func() { - ExpectWithOffset(1, x == nil).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == x).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, x == nil).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == x).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y != nil).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != y).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y != nil).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != y).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() == nil).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNil()).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() == nil).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNil()).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() != nil).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNotNil()).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() != nil).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNotNil()).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test BeTrue", func() { It("test nil value", func() { - ExpectWithOffset(1, x != nil).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != x).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, x != nil).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != x).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y == nil).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == y).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y == nil).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == y).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() != nil).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNil()).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() != nil).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNil()).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() == nil).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNotNil()).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() == nil).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNotNil()).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test Equal(true)", func() { It("test nil value", func() { - ExpectWithOffset(1, x != nil).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != x).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, x != nil).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != x).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y == nil).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == y).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y == nil).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == y).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() != nil).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNil()).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() != nil).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNil()).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() == nil).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNotNil()).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() == nil).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNotNil()).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test Equal(false)", func() { It("test nil value", func() { - ExpectWithOffset(1, x == nil).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == x).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, x == nil).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == x).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y != nil).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != y).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y != nil).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != y).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() == nil).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNil()).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() == nil).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNil()).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() != nil).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNotNil()).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() != nil).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNotNil()).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) }) @@ -922,148 +922,148 @@ var _ = Describe("", func() { Context("test NotTo", func() { Context("test BeFalse", func() { It("test nil value", func() { - ExpectWithOffset(1, x == nil).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == x).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, x == nil).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == x).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y != nil).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != y).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y != nil).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != y).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() == nil).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNil()).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() == nil).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNil()).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() != nil).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNotNil()).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() != nil).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNotNil()).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test BeTrue", func() { It("test nil value", func() { - ExpectWithOffset(1, x != nil).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != x).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, x != nil).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != x).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y == nil).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.NotTo\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == y).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.NotTo\(BeNil\(\)\). instead` + ExpectWithOffset(1, y == nil).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.NotTo\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == y).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.NotTo\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() != nil).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNil()).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() != nil).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNil()).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() == nil).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.NotTo\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNotNil()).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.NotTo\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() == nil).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.NotTo\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNotNil()).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.NotTo\(BeNil\(\)\). instead` }) }) Context("test Equal(true)", func() { It("test nil value", func() { - ExpectWithOffset(1, x != nil).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != x).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, x != nil).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != x).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y == nil).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.NotTo\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == y).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.NotTo\(BeNil\(\)\). instead` + ExpectWithOffset(1, y == nil).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.NotTo\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == y).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.NotTo\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() != nil).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNil()).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() != nil).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNil()).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() == nil).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.NotTo\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNotNil()).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.NotTo\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() == nil).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.NotTo\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNotNil()).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.NotTo\(BeNil\(\)\). instead` }) }) Context("test Equal(false)", func() { It("test nil value", func() { - ExpectWithOffset(1, x == nil).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == x).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, x == nil).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == x).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y != nil).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != y).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y != nil).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != y).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() == nil).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNil()).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() == nil).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNil()).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() != nil).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNotNil()).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() != nil).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNotNil()).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) }) Context("test ToNot", func() { Context("test BeFalse", func() { It("test nil value", func() { - ExpectWithOffset(1, x == nil).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == x).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, x == nil).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == x).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y != nil).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != y).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y != nil).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != y).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() == nil).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNil()).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() == nil).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNil()).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() != nil).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNotNil()).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() != nil).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNotNil()).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test BeTrue", func() { It("test nil value", func() { - ExpectWithOffset(1, x != nil).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != x).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, x != nil).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != x).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y == nil).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == y).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y == nil).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == y).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() != nil).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNil()).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() != nil).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNil()).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() == nil).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNotNil()).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() == nil).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNotNil()).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test Equal(true)", func() { It("test nil value", func() { - ExpectWithOffset(1, x != nil).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != x).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, x != nil).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != x).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y == nil).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == y).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y == nil).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == y).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() != nil).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNil()).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() != nil).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNil()).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() == nil).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNotNil()).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() == nil).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNotNil()).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test Equal(false)", func() { It("test nil value", func() { - ExpectWithOffset(1, x == nil).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == x).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, x == nil).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == x).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - ExpectWithOffset(1, y != nil).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != y).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, y != nil).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != y).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - ExpectWithOffset(1, fNil() == nil).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil == fNil()).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNil() == nil).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil == fNil()).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - ExpectWithOffset(1, fNotNil() != nil).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - ExpectWithOffset(1, nil != fNotNil()).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, fNotNil() != nil).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + ExpectWithOffset(1, nil != fNotNil()).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .ExpectWithOffset\(1, fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) }) @@ -1073,148 +1073,148 @@ var _ = Describe("", func() { Context("test Should", func() { Context("test BeTrue", func() { It("test nil value", func() { - Ω(x == nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` - Ω(nil == x).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` + Ω(x == nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` + Ω(nil == x).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y != nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` - Ω(nil != y).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(y != nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(nil != y).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() == nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` - Ω(nil == fNil()).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Ω(fNil() == nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Ω(nil == fNil()).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() != nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - Ω(nil != fNotNil()).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(fNotNil() != nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(nil != fNotNil()).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test BeFalse", func() { It("test nil value", func() { - Ω(x != nil).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` - Ω(nil != x).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` + Ω(x != nil).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` + Ω(nil != x).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y == nil).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` - Ω(nil == y).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(y == nil).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(nil == y).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() != nil).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` - Ω(nil != fNil()).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Ω(fNil() != nil).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Ω(nil != fNil()).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() == nil).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - Ω(nil == fNotNil()).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(fNotNil() == nil).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(nil == fNotNil()).Should(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test Equal(true)", func() { It("test nil value", func() { - Ω(x == nil).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` - Ω(nil == x).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` + Ω(x == nil).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` + Ω(nil == x).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y != nil).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` - Ω(nil != y).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(y != nil).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(nil != y).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() == nil).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` - Ω(nil == fNil()).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Ω(fNil() == nil).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Ω(nil == fNil()).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() != nil).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - Ω(nil != fNotNil()).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(fNotNil() != nil).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(nil != fNotNil()).Should(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test Equal(false)", func() { It("test nil value", func() { - Ω(x != nil).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` - Ω(nil != x).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` + Ω(x != nil).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` + Ω(nil != x).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y == nil).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` - Ω(nil == y).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(y == nil).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(nil == y).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() != nil).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` - Ω(nil != fNil()).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Ω(fNil() != nil).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Ω(nil != fNil()).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() == nil).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - Ω(nil == fNotNil()).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(fNotNil() == nil).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(nil == fNotNil()).Should(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) }) Context("test Should(Not())", func() { Context("test BeTrue", func() { It("test nil value", func() { - Ω(x == nil).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` - Ω(nil == x).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` + Ω(x == nil).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` + Ω(nil == x).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y != nil).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` - Ω(nil != y).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(y != nil).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(nil != y).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() == nil).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` - Ω(nil == fNil()).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Ω(fNil() == nil).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Ω(nil == fNil()).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() != nil).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - Ω(nil != fNotNil()).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(fNotNil() != nil).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(nil != fNotNil()).Should(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test BeFalse", func() { It("test nil value", func() { - Ω(x != nil).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` - Ω(nil != x).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` + Ω(x != nil).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` + Ω(nil != x).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y == nil).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` - Ω(nil == y).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(y == nil).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(nil == y).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() != nil).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` - Ω(nil != fNil()).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Ω(fNil() != nil).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Ω(nil != fNil()).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() == nil).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - Ω(nil == fNotNil()).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(fNotNil() == nil).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(nil == fNotNil()).Should(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test Equal(false)", func() { It("test nil value", func() { - Ω(x == nil).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` - Ω(nil == x).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` + Ω(x == nil).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` + Ω(nil == x).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y != nil).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` - Ω(nil != y).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(y != nil).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(nil != y).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() == nil).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` - Ω(nil == fNil()).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Ω(fNil() == nil).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Ω(nil == fNil()).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() != nil).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - Ω(nil != fNotNil()).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(fNotNil() != nil).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(nil != fNotNil()).Should(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test Equal(true)", func() { It("test nil value", func() { - Ω(x != nil).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` - Ω(nil != x).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` + Ω(x != nil).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` + Ω(nil != x).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y == nil).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` - Ω(nil == y).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(y == nil).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(nil == y).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() != nil).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` - Ω(nil != fNil()).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Ω(fNil() != nil).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Ω(nil != fNil()).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() == nil).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - Ω(nil == fNotNil()).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(fNotNil() == nil).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(nil == fNotNil()).Should(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) }) @@ -1222,148 +1222,148 @@ var _ = Describe("", func() { Context("test To", func() { Context("test BeTrue", func() { It("test nil value", func() { - Ω(x == nil).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` - Ω(nil == x).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(x == nil).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(nil == x).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y != nil).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil != y).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(y != nil).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil != y).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() == nil).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Ω(nil == fNil()).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(fNil() == nil).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(nil == fNil()).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() != nil).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil != fNotNil()).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(fNotNil() != nil).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil != fNotNil()).To(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test BeFalse", func() { It("test nil value", func() { - Ω(x != nil).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` - Ω(nil != x).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(x != nil).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(nil != x).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y == nil).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil == y).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(y == nil).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil == y).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() != nil).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Ω(nil != fNil()).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(fNil() != nil).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(nil != fNil()).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() == nil).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil == fNotNil()).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(fNotNil() == nil).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil == fNotNil()).To(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test Equal(true)", func() { It("test nil value", func() { - Ω(x == nil).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` - Ω(nil == x).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(x == nil).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(nil == x).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y != nil).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil != y).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(y != nil).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil != y).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() == nil).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Ω(nil == fNil()).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(fNil() == nil).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(nil == fNil()).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() != nil).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil != fNotNil()).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(fNotNil() != nil).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil != fNotNil()).To(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test Equal(false)", func() { It("test nil value", func() { - Ω(x != nil).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` - Ω(nil != x).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(x != nil).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(nil != x).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y == nil).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil == y).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(y == nil).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil == y).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() != nil).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Ω(nil != fNil()).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(fNil() != nil).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(nil != fNil()).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() == nil).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil == fNotNil()).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(fNotNil() == nil).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil == fNotNil()).To(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) }) Context("test To(Not())", func() { Context("test BeTrue", func() { It("test nil value", func() { - Ω(x == nil).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` - Ω(nil == x).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(x == nil).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(nil == x).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y != nil).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil != y).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(y != nil).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil != y).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() == nil).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Ω(nil == fNil()).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(fNil() == nil).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(nil == fNil()).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() != nil).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil != fNotNil()).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(fNotNil() != nil).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil != fNotNil()).To(Not(BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test BeFalse", func() { It("test nil value", func() { - Ω(x != nil).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` - Ω(nil != x).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(x != nil).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(nil != x).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y == nil).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil == y).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(y == nil).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil == y).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() != nil).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Ω(nil != fNil()).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(fNil() != nil).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(nil != fNil()).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() == nil).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil == fNotNil()).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(fNotNil() == nil).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil == fNotNil()).To(Not(BeTrue())) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test Equal(false)", func() { It("test nil value", func() { - Ω(x == nil).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` - Ω(nil == x).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(x == nil).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(nil == x).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y != nil).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil != y).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(y != nil).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil != y).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() == nil).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Ω(nil == fNil()).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(fNil() == nil).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(nil == fNil()).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() != nil).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil != fNotNil()).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(fNotNil() != nil).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil != fNotNil()).To(Not(Equal(false))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test Equal(true)", func() { It("test nil value", func() { - Ω(x != nil).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` - Ω(nil != x).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(x != nil).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(nil != x).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y == nil).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil == y).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(y == nil).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil == y).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() != nil).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Ω(nil != fNil()).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(fNil() != nil).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(nil != fNil()).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() == nil).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil == fNotNil()).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(fNotNil() == nil).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil == fNotNil()).To(Not(Equal(true))) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) }) @@ -1371,74 +1371,74 @@ var _ = Describe("", func() { Context("test ShouldNot", func() { Context("test BeFalse", func() { It("test nil value", func() { - Ω(x == nil).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` - Ω(nil == x).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` + Ω(x == nil).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` + Ω(nil == x).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y != nil).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` - Ω(nil != y).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(y != nil).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(nil != y).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() == nil).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` - Ω(nil == fNil()).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Ω(fNil() == nil).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Ω(nil == fNil()).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() != nil).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - Ω(nil != fNotNil()).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(fNotNil() != nil).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(nil != fNotNil()).ShouldNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test BeTrue", func() { It("test nil value", func() { - Ω(x != nil).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` - Ω(nil != x).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` + Ω(x != nil).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` + Ω(nil != x).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y == nil).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` - Ω(nil == y).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(y == nil).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(nil == y).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() != nil).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` - Ω(nil != fNil()).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Ω(fNil() != nil).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Ω(nil != fNil()).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() == nil).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - Ω(nil == fNotNil()).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(fNotNil() == nil).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(nil == fNotNil()).ShouldNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test Equal(true)", func() { It("test nil value", func() { - Ω(x != nil).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` - Ω(nil != x).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` + Ω(x != nil).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` + Ω(nil != x).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y == nil).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` - Ω(nil == y).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(y == nil).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(nil == y).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() != nil).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` - Ω(nil != fNil()).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Ω(fNil() != nil).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Ω(nil != fNil()).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() == nil).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - Ω(nil == fNotNil()).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(fNotNil() == nil).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(nil == fNotNil()).ShouldNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) Context("test Equal(false)", func() { It("test nil value", func() { - Ω(x == nil).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` - Ω(nil == x).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` + Ω(x == nil).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` + Ω(nil == x).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y != nil).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` - Ω(nil != y).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(y != nil).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(nil != y).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ShouldNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() == nil).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` - Ω(nil == fNil()).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Ω(fNil() == nil).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` + Ω(nil == fNil()).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.Should\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() != nil).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` - Ω(nil != fNotNil()).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(fNotNil() != nil).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` + Ω(nil != fNotNil()).ShouldNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ShouldNot\(BeNil\(\)\). instead` }) }) }) @@ -1446,148 +1446,148 @@ var _ = Describe("", func() { Context("test NotTo", func() { Context("test BeFalse", func() { It("test nil value", func() { - Ω(x == nil).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` - Ω(nil == x).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(x == nil).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(nil == x).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y != nil).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil != y).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(y != nil).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil != y).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() == nil).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Ω(nil == fNil()).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(fNil() == nil).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(nil == fNil()).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() != nil).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil != fNotNil()).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(fNotNil() != nil).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil != fNotNil()).NotTo(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test BeTrue", func() { It("test nil value", func() { - Ω(x != nil).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` - Ω(nil != x).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(x != nil).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(nil != x).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y == nil).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.NotTo\(BeNil\(\)\). instead` - Ω(nil == y).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.NotTo\(BeNil\(\)\). instead` + Ω(y == nil).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.NotTo\(BeNil\(\)\). instead` + Ω(nil == y).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.NotTo\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() != nil).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Ω(nil != fNil()).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(fNil() != nil).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(nil != fNil()).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() == nil).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.NotTo\(BeNil\(\)\). instead` - Ω(nil == fNotNil()).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.NotTo\(BeNil\(\)\). instead` + Ω(fNotNil() == nil).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.NotTo\(BeNil\(\)\). instead` + Ω(nil == fNotNil()).NotTo(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.NotTo\(BeNil\(\)\). instead` }) }) Context("test Equal(true)", func() { It("test nil value", func() { - Ω(x != nil).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` - Ω(nil != x).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(x != nil).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(nil != x).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y == nil).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.NotTo\(BeNil\(\)\). instead` - Ω(nil == y).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.NotTo\(BeNil\(\)\). instead` + Ω(y == nil).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.NotTo\(BeNil\(\)\). instead` + Ω(nil == y).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.NotTo\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() != nil).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Ω(nil != fNil()).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(fNil() != nil).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(nil != fNil()).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() == nil).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.NotTo\(BeNil\(\)\). instead` - Ω(nil == fNotNil()).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.NotTo\(BeNil\(\)\). instead` + Ω(fNotNil() == nil).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.NotTo\(BeNil\(\)\). instead` + Ω(nil == fNotNil()).NotTo(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.NotTo\(BeNil\(\)\). instead` }) }) Context("test Equal(false)", func() { It("test nil value", func() { - Ω(x == nil).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` - Ω(nil == x).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(x == nil).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(nil == x).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y != nil).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil != y).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(y != nil).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil != y).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() == nil).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Ω(nil == fNil()).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(fNil() == nil).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(nil == fNil()).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() != nil).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil != fNotNil()).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(fNotNil() != nil).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil != fNotNil()).NotTo(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) }) Context("test ToNot", func() { Context("test BeFalse", func() { It("test nil value", func() { - Ω(x == nil).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` - Ω(nil == x).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(x == nil).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(nil == x).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y != nil).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil != y).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(y != nil).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil != y).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() == nil).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Ω(nil == fNil()).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(fNil() == nil).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(nil == fNil()).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() != nil).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil != fNotNil()).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(fNotNil() != nil).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil != fNotNil()).ToNot(BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test BeTrue", func() { It("test nil value", func() { - Ω(x != nil).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` - Ω(nil != x).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(x != nil).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(nil != x).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y == nil).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil == y).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(y == nil).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil == y).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() != nil).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Ω(nil != fNil()).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(fNil() != nil).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(nil != fNil()).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() == nil).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil == fNotNil()).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(fNotNil() == nil).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil == fNotNil()).ToNot(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test Equal(true)", func() { It("test nil value", func() { - Ω(x != nil).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` - Ω(nil != x).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(x != nil).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(nil != x).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y == nil).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil == y).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(y == nil).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil == y).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() != nil).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Ω(nil != fNil()).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(fNil() != nil).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(nil != fNil()).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() == nil).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil == fNotNil()).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(fNotNil() == nil).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil == fNotNil()).ToNot(Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) Context("test Equal(false)", func() { It("test nil value", func() { - Ω(x == nil).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` - Ω(nil == x).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(x == nil).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` + Ω(nil == x).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(x\)\.To\(BeNil\(\)\). instead` }) It("test non-nil value", func() { - Ω(y != nil).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil != y).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(y != nil).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil != y).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(y\)\.ToNot\(BeNil\(\)\). instead` }) It("test nil func", func() { - Ω(fNil() == nil).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` - Ω(nil == fNil()).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(fNil() == nil).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` + Ω(nil == fNil()).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNil\(\)\)\.To\(BeNil\(\)\). instead` }) It("test non-nil func", func() { - Ω(fNotNil() != nil).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` - Ω(nil != fNotNil()).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(fNotNil() != nil).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` + Ω(nil != fNotNil()).ToNot(Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Ω\(fNotNil\(\)\)\.ToNot\(BeNil\(\)\). instead` }) }) }) diff --git a/testdata/src/a/noassersion/ginkgo.go b/testdata/src/a/noassersion/ginkgo.go index 9899f00..af46f63 100644 --- a/testdata/src/a/noassersion/ginkgo.go +++ b/testdata/src/a/noassersion/ginkgo.go @@ -1,19 +1,19 @@ package noassersion import ( - "time" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "time" ) var _ = Describe("", func() { It("should not allow expecting without assertion", func() { - Expect("aaa") // want `ginkgo-linter: "Expect": missing assertion method. Expected "Should\(\)", "To\(\)", "ShouldNot\(\)", "ToNot\(\)" or "NotTo\(\)"` - Eventually(func() {}, 100*time.Millisecond, 10*time.Millisecond) //want `ginkgo-linter: "Eventually": missing assertion method. Expected "Should\(\)" or "ShouldNot\(\)"` - Eventually(func() {}).Within(100 * time.Millisecond).WithPolling(10 * time.Millisecond) // want `ginkgo-linter: "Eventually": missing assertion method. Expected "Should\(\)" or "ShouldNot\(\)"` - Consistently(func() bool { return true }) // want `ginkgo-linter: "Consistently": missing assertion method. Expected "Should\(\)" or "ShouldNot\(\)"` - EventuallyWithOffset(1, func(g Gomega) { g.Expect(true) }).WithTimeout(2 * time.Second) // want `ginkgo-linter: "EventuallyWithOffset": missing assertion method. Expected "Should\(\)" or "ShouldNot\(\)"` `ginkgo-linter: "Expect": missing assertion method. Expected "Should\(\)", "To\(\)", "ShouldNot\(\)", "ToNot\(\)" or "NotTo\(\)"` - ConsistentlyWithOffset(2, func() bool { return true }) // want `ginkgo-linter: "ConsistentlyWithOffset": missing assertion method. Expected "Should\(\)" or "ShouldNot\(\)"` + Expect("aaa") // want `ginkgo-linter: "Expect": missing assertion method\. Expected "To\(\)", "ToNot\(\)" or "NotTo\(\)"` + Eventually(func() {}, 100*time.Millisecond, 10*time.Millisecond) // want `ginkgo-linter: "Eventually": missing assertion method\. Expected "Should\(\)" or "ShouldNot\(\)"` + Eventually(func() {}).Within(100 * time.Millisecond).WithPolling(10 * time.Millisecond) // want `ginkgo-linter: "Eventually": missing assertion method\. Expected "Should\(\)" or "ShouldNot\(\)"` + Consistently(func() bool { return true }) // want `ginkgo-linter: "Consistently": missing assertion method\. Expected "Should\(\)" or "ShouldNot\(\)"` + EventuallyWithOffset(1, func(g Gomega) { g.Expect(true) }).WithTimeout(2 * time.Second) // want `ginkgo-linter: "EventuallyWithOffset": missing assertion method. Expected "Should\(\)" or "ShouldNot\(\)"` `ginkgo-linter: "Expect": missing assertion method. Expected "To\(\)", "ToNot\(\)" or "NotTo\(\)"` + ConsistentlyWithOffset(2, func() bool { return true }) // want `ginkgo-linter: "ConsistentlyWithOffset": missing assertion method\. Expected "Should\(\)" or "ShouldNot\(\)"` + Ω("omega") // want `ginkgo-linter: "Ω": missing assertion method\. Expected "Should\(\)", "To\(\)", "ShouldNot\(\)", "ToNot\(\)" or "NotTo\(\)"` }) }) diff --git a/testdata/src/a/noassersion/gomagaimport.go b/testdata/src/a/noassersion/gomagaimport.go index d99cd22..f2b69c8 100644 --- a/testdata/src/a/noassersion/gomagaimport.go +++ b/testdata/src/a/noassersion/gomagaimport.go @@ -10,19 +10,19 @@ import ( var _ = Describe("", func() { It("should not allow expecting without assertion", func() { - g.Expect("bbbb") // want `ginkgo-linter: "Expect": missing assertion method. Expected "Should\(\)", "To\(\)", "ShouldNot\(\)", "ToNot\(\)" or "NotTo\(\)"` + g.Expect("bbbb") // want `ginkgo-linter: "Expect": missing assertion method\. Expected "To\(\)", "ToNot\(\)" or "NotTo\(\)"` - g.Eventually( // want `ginkgo-linter: "Eventually": missing assertion method. Expected "Should\(\)" or "ShouldNot\(\)"` + g.Eventually( // want `ginkgo-linter: "Eventually": missing assertion method\. Expected "Should\(\)" or "ShouldNot\(\)"` func(gg g.Gomega) { - gg.Expect(nil) // want `ginkgo-linter: "Expect": missing assertion method. Expected "Should\(\)", "To\(\)", "ShouldNot\(\)", "ToNot\(\)" or "NotTo\(\)"` + gg.Expect(nil) // want `ginkgo-linter: "Expect": missing assertion method\. Expected "To\(\)", "ToNot\(\)" or "NotTo\(\)"` }, ).Within(time.Second). WithPolling(time.Millisecond * 100). WithArguments(1). WithContext(context.Background()) - g.Consistently(func(gg g.Gomega) { gg.Expect(nil) }).Within(time.Second).WithPolling(time.Millisecond * 100).WithArguments(1).WithContext(context.Background()) // want `ginkgo-linter: "Consistently": missing assertion method. Expected "Should\(\)" or "ShouldNot\(\)"` `ginkgo-linter: "Expect": missing assertion method. Expected "Should\(\)", "To\(\)", "ShouldNot\(\)", "ToNot\(\)" or "NotTo\(\)"` - g.EventuallyWithOffset(1, func(gg g.Gomega) { gg.Expect(nil) }).Within(time.Second).WithPolling(time.Millisecond * 100).WithArguments(1).WithContext(context.Background()) // want `ginkgo-linter: "EventuallyWithOffset": missing assertion method. Expected "Should\(\)" or "ShouldNot\(\)"` `ginkgo-linter: "Expect": missing assertion method. Expected "Should\(\)", "To\(\)", "ShouldNot\(\)", "ToNot\(\)" or "NotTo\(\)"` - g.ConsistentlyWithOffset(1, func(gg g.Gomega) { gg.Expect(nil) }).Within(time.Second).WithPolling(time.Millisecond * 100).WithArguments(1).WithContext(context.Background()) // want `ginkgo-linter: "ConsistentlyWithOffset": missing assertion method. Expected "Should\(\)" or "ShouldNot\(\)"` `ginkgo-linter: "Expect": missing assertion method. Expected "Should\(\)", "To\(\)", "ShouldNot\(\)", "ToNot\(\)" or "NotTo\(\)"` + g.Consistently(func(gg g.Gomega) { gg.Expect(nil) }).Within(time.Second).WithPolling(time.Millisecond * 100).WithArguments(1).WithContext(context.Background()) // want `ginkgo-linter: "Consistently": missing assertion method. Expected "Should\(\)" or "ShouldNot\(\)"` `ginkgo-linter: "Expect": missing assertion method\. Expected "To\(\)", "ToNot\(\)" or "NotTo\(\)"` + g.EventuallyWithOffset(1, func(gg g.Gomega) { gg.Expect(nil) }).Within(time.Second).WithPolling(time.Millisecond * 100).WithArguments(1).WithContext(context.Background()) // want `ginkgo-linter: "EventuallyWithOffset": missing assertion method. Expected "Should\(\)" or "ShouldNot\(\)"` `ginkgo-linter: "Expect": missing assertion method\. Expected "To\(\)", "ToNot\(\)" or "NotTo\(\)"` + g.ConsistentlyWithOffset(1, func(gg g.Gomega) { gg.Expect(nil) }).Within(time.Second).WithPolling(time.Millisecond * 100).WithArguments(1).WithContext(context.Background()) // want `ginkgo-linter: "ConsistentlyWithOffset": missing assertion method. Expected "Should\(\)" or "ShouldNot\(\)"` `ginkgo-linter: "Expect": missing assertion method. Expected "To\(\)", "ToNot\(\)" or "NotTo\(\)"` }) }) diff --git a/testdata/src/a/noassersion/gomega_test.go b/testdata/src/a/noassersion/gomega_test.go index 6ce1a5b..a55b7e6 100644 --- a/testdata/src/a/noassersion/gomega_test.go +++ b/testdata/src/a/noassersion/gomega_test.go @@ -9,9 +9,9 @@ import ( func TestGomega(t *testing.T) { g := NewWithT(t) - g.Expect("aaa") // want `ginkgo-linter: "Expect": missing assertion method. Expected "Should\(\)", "To\(\)", "ShouldNot\(\)", "ToNot\(\)" or "NotTo\(\)"` - g.Expect("aaa").WithOffset(1) // want `ginkgo-linter: "Expect": missing assertion method. Expected "Should\(\)", "To\(\)", "ShouldNot\(\)", "ToNot\(\)" or "NotTo\(\)"` - g.Expect("aaa").WithOffset(1).Error() // want `ginkgo-linter: "Expect": missing assertion method. Expected "Should\(\)", "To\(\)", "ShouldNot\(\)", "ToNot\(\)" or "NotTo\(\)"` + g.Expect("aaa") // want `ginkgo-linter: "Expect": missing assertion method\. Expected "To\(\)", "ToNot\(\)" or "NotTo\(\)"` + g.Expect("aaa").WithOffset(1) // want `ginkgo-linter: "Expect": missing assertion method\. Expected "To\(\)", "ToNot\(\)" or "NotTo\(\)"` + g.Expect("aaa").WithOffset(1).Error() // want `ginkgo-linter: "Expect": missing assertion method\. Expected "To\(\)", "ToNot\(\)" or "NotTo\(\)"` - g.Eventually(func(gg Gomega) { gg.Expect(true) }) // want `ginkgo-linter: "Eventually": missing assertion method. Expected "Should\(\)" or "ShouldNot\(\)"` `ginkgo-linter: "Expect": missing assertion method. Expected "Should\(\)", "To\(\)", "ShouldNot\(\)", "ToNot\(\)" or "NotTo\(\)"` + g.Eventually(func(gg Gomega) { gg.Expect(true) }) // want `ginkgo-linter: "Eventually": missing assertion method\. Expected "Should\(\)" or "ShouldNot\(\)"` `ginkgo-linter: "Expect": missing assertion method\. Expected "To\(\)", "ToNot\(\)" or "NotTo\(\)"` } diff --git a/testdata/src/a/nodotimport/a.go b/testdata/src/a/nodotimport/a.go index 6b86dd4..83cbf6e 100644 --- a/testdata/src/a/nodotimport/a.go +++ b/testdata/src/a/nodotimport/a.go @@ -8,28 +8,28 @@ import ( var _ = ginkgo.Describe("no dot import", func() { ginkgo.It("should trigger length warning", func() { const length = 3 - gomega.Expect(len("abc")).Should(gomega.Equal(3)) // want `ginkgo-linter: wrong length assertion; consider using .gomega\.Expect\("abc"\)\.Should\(gomega\.HaveLen\(3\)\). instead` - gomega.Expect(len("abc")).Should(gomega.Not(gomega.Equal(4))) // want `ginkgo-linter: wrong length assertion; consider using .gomega\.Expect\("abc"\)\.ShouldNot\(gomega\.HaveLen\(4\)\). instead` - gomega.Expect(len("abc")).Should(gomega.Equal(length)) // want `ginkgo-linter: wrong length assertion; consider using .gomega\.Expect\("abc"\)\.Should\(gomega\.HaveLen\(length\)\). instead` - gomega.Expect(len("")).Should(gomega.Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .gomega\.Expect\(""\)\.Should\(gomega\.BeEmpty\(\)\). instead` - gomega.Expect(len("abc")).ShouldNot(gomega.BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .gomega\.Expect\("abc"\)\.ShouldNot\(gomega\.BeEmpty\(\)\). instead` - gomega.Expect(len("abc")).Should(gomega.BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .gomega\.Expect\("abc"\)\.ShouldNot\(gomega\.BeEmpty\(\)\). instead` - gomega.Expect(len("abc")).Should(gomega.BeNumerically("==", 3)) // want `ginkgo-linter: wrong length assertion; consider using .gomega\.Expect\("abc"\)\.Should\(gomega\.HaveLen\(3\)\). instead` - gomega.Expect(len("abc")).WithOffset(1).Should(gomega.BeNumerically("==", 3)) // want `ginkgo-linter: wrong length assertion; consider using .gomega\.Expect\("abc"\)\.WithOffset\(1\)\.Should\(gomega\.HaveLen\(3\)\). instead` + gomega.Expect(len("abc")).Should(gomega.Equal(3)) // want `ginkgo-linter: wrong length assertion\. Consider using .gomega\.Expect\("abc"\)\.Should\(gomega\.HaveLen\(3\)\). instead` + gomega.Expect(len("abc")).Should(gomega.Not(gomega.Equal(4))) // want `ginkgo-linter: wrong length assertion\. Consider using .gomega\.Expect\("abc"\)\.ShouldNot\(gomega\.HaveLen\(4\)\). instead` + gomega.Expect(len("abc")).Should(gomega.Equal(length)) // want `ginkgo-linter: wrong length assertion\. Consider using .gomega\.Expect\("abc"\)\.Should\(gomega\.HaveLen\(length\)\). instead` + gomega.Expect(len("")).Should(gomega.Equal(0)) // want `ginkgo-linter: wrong length assertion\. Consider using .gomega\.Expect\(""\)\.Should\(gomega\.BeEmpty\(\)\). instead` + gomega.Expect(len("abc")).ShouldNot(gomega.BeZero()) // want `ginkgo-linter: wrong length assertion\. Consider using .gomega\.Expect\("abc"\)\.ShouldNot\(gomega\.BeEmpty\(\)\). instead` + gomega.Expect(len("abc")).Should(gomega.BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .gomega\.Expect\("abc"\)\.ShouldNot\(gomega\.BeEmpty\(\)\). instead` + gomega.Expect(len("abc")).Should(gomega.BeNumerically("==", 3)) // want `ginkgo-linter: wrong length assertion\. Consider using .gomega\.Expect\("abc"\)\.Should\(gomega\.HaveLen\(3\)\). instead` + gomega.Expect(len("abc")).WithOffset(1).Should(gomega.BeNumerically("==", 3)) // want `ginkgo-linter: wrong length assertion\. Consider using .gomega\.Expect\("abc"\)\.WithOffset\(1\)\.Should\(gomega\.HaveLen\(3\)\). instead` }) ginkgo.It("should trigger nil warning", func() { var x *int - gomega.Expect(x == nil).Should(gomega.Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .gomega\.Expect\(x\)\.Should\(gomega\.BeNil\(\)\). instead` - gomega.Expect(x == nil).ShouldNot(gomega.Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .gomega\.Expect\(x\)\.Should\(gomega\.BeNil\(\)\). instead` - gomega.Expect(nil == x).Should(gomega.BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .gomega\.Expect\(x\)\.Should\(gomega\.BeNil\(\)\). instead` - gomega.Expect(x == nil).ShouldNot(gomega.BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .gomega\.Expect\(x\)\.Should\(gomega\.BeNil\(\)\). instead` - gomega.Expect(x == nil).Should(gomega.Not(gomega.BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .gomega\.Expect\(x\)\.Should\(gomega\.BeNil\(\)\). instead` + gomega.Expect(x == nil).Should(gomega.Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .gomega\.Expect\(x\)\.Should\(gomega\.BeNil\(\)\). instead` + gomega.Expect(x == nil).ShouldNot(gomega.Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .gomega\.Expect\(x\)\.Should\(gomega\.BeNil\(\)\). instead` + gomega.Expect(nil == x).Should(gomega.BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .gomega\.Expect\(x\)\.Should\(gomega\.BeNil\(\)\). instead` + gomega.Expect(x == nil).ShouldNot(gomega.BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .gomega\.Expect\(x\)\.Should\(gomega\.BeNil\(\)\). instead` + gomega.Expect(x == nil).Should(gomega.Not(gomega.BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .gomega\.Expect\(x\)\.Should\(gomega\.BeNil\(\)\). instead` }) ginkgo.It("should trigger equal nil warning", func() { var x *int var y = 5 var py = &y - gomega.Expect(x).Should(gomega.Equal(nil)) // want `ginkgo-linter: wrong nil assertion; consider using .gomega\.Expect\(x\)\.Should\(gomega\.BeNil\(\)\). instead` - gomega.Expect(py).Should(gomega.Not(gomega.Equal(nil))) // want `ginkgo-linter: wrong nil assertion; consider using .gomega\.Expect\(py\)\.ShouldNot\(gomega\.BeNil\(\)\). instead` + gomega.Expect(x).Should(gomega.Equal(nil)) // want `ginkgo-linter: wrong nil assertion\. Consider using .gomega\.Expect\(x\)\.Should\(gomega\.BeNil\(\)\). instead` + gomega.Expect(py).Should(gomega.Not(gomega.Equal(nil))) // want `ginkgo-linter: wrong nil assertion\. Consider using .gomega\.Expect\(py\)\.ShouldNot\(gomega\.BeNil\(\)\). instead` }) }) diff --git a/testdata/src/a/nodotimport/b.go b/testdata/src/a/nodotimport/b.go index 3f5e79c..8e2e68d 100644 --- a/testdata/src/a/nodotimport/b.go +++ b/testdata/src/a/nodotimport/b.go @@ -8,20 +8,20 @@ import ( var _ = g1.Describe("no dot import", func() { g1.It("should ignore length warning", func() { const length = 3 - g2.Expect(len("abc")).Should(g2.Equal(3)) // want `ginkgo-linter: wrong length assertion; consider using .g2\.Expect\("abc"\)\.Should\(g2\.HaveLen\(3\)\). instead` - g2.Expect(len("abc")).Should(g2.Equal(length)) // want `ginkgo-linter: wrong length assertion; consider using .g2\.Expect\("abc"\)\.Should\(g2\.HaveLen\(length\)\). instead` - g2.Expect(len("")).Should(g2.Equal(0)) // want `ginkgo-linter: wrong length assertion; consider using .g2\.Expect\(""\)\.Should\(g2\.BeEmpty\(\)\). instead` - g2.Expect(len("abc")).ShouldNot(g2.BeZero()) // want `ginkgo-linter: wrong length assertion; consider using .g2\.Expect\("abc"\)\.ShouldNot\(g2\.BeEmpty\(\)\). instead` - g2.Expect(len("abc")).Should(g2.BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion; consider using .g2\.Expect\("abc"\)\.ShouldNot\(g2\.BeEmpty\(\)\). instead` - g2.Expect(len("abc")).Should(g2.BeNumerically("==", 3)) // want `ginkgo-linter: wrong length assertion; consider using .g2\.Expect\("abc"\)\.Should\(g2\.HaveLen\(3\)\). instead` - g2.Expect(len("abc")).WithOffset(1).Should(g2.BeNumerically("==", 3)) // want `ginkgo-linter: wrong length assertion; consider using .g2\.Expect\("abc"\)\.WithOffset\(1\)\.Should\(g2\.HaveLen\(3\)\). instead` + g2.Expect(len("abc")).Should(g2.Equal(3)) // want `ginkgo-linter: wrong length assertion\. Consider using .g2\.Expect\("abc"\)\.Should\(g2\.HaveLen\(3\)\). instead` + g2.Expect(len("abc")).Should(g2.Equal(length)) // want `ginkgo-linter: wrong length assertion\. Consider using .g2\.Expect\("abc"\)\.Should\(g2\.HaveLen\(length\)\). instead` + g2.Expect(len("")).Should(g2.Equal(0)) // want `ginkgo-linter: wrong length assertion\. Consider using .g2\.Expect\(""\)\.Should\(g2\.BeEmpty\(\)\). instead` + g2.Expect(len("abc")).ShouldNot(g2.BeZero()) // want `ginkgo-linter: wrong length assertion\. Consider using .g2\.Expect\("abc"\)\.ShouldNot\(g2\.BeEmpty\(\)\). instead` + g2.Expect(len("abc")).Should(g2.BeNumerically(">", 0)) // want `ginkgo-linter: wrong length assertion\. Consider using .g2\.Expect\("abc"\)\.ShouldNot\(g2\.BeEmpty\(\)\). instead` + g2.Expect(len("abc")).Should(g2.BeNumerically("==", 3)) // want `ginkgo-linter: wrong length assertion\. Consider using .g2\.Expect\("abc"\)\.Should\(g2\.HaveLen\(3\)\). instead` + g2.Expect(len("abc")).WithOffset(1).Should(g2.BeNumerically("==", 3)) // want `ginkgo-linter: wrong length assertion\. Consider using .g2\.Expect\("abc"\)\.WithOffset\(1\)\.Should\(g2\.HaveLen\(3\)\). instead` }) g1.It("should trigger nil warning", func() { var x *int - g2.Expect(x == nil).Should(g2.Equal(true)) // want `ginkgo-linter: wrong nil assertion; consider using .g2\.Expect\(x\)\.Should\(g2\.BeNil\(\)\). instead` - g2.Expect(x == nil).ShouldNot(g2.Equal(false)) // want `ginkgo-linter: wrong nil assertion; consider using .g2\.Expect\(x\)\.Should\(g2\.BeNil\(\)\). instead` - g2.Expect(nil == x).Should(g2.BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .g2\.Expect\(x\)\.Should\(g2\.BeNil\(\)\). instead` - g2.Expect(x == nil).ShouldNot(g2.BeFalse()) // want `ginkgo-linter: wrong nil assertion; consider using .g2\.Expect\(x\)\.Should\(g2\.BeNil\(\)\). instead` - g2.Expect(x == nil).Should(g2.Not(g2.BeFalse())) // want `ginkgo-linter: wrong nil assertion; consider using .g2\.Expect\(x\)\.Should\(g2\.BeNil\(\)\). instead` + g2.Expect(x == nil).Should(g2.Equal(true)) // want `ginkgo-linter: wrong nil assertion\. Consider using .g2\.Expect\(x\)\.Should\(g2\.BeNil\(\)\). instead` + g2.Expect(x == nil).ShouldNot(g2.Equal(false)) // want `ginkgo-linter: wrong nil assertion\. Consider using .g2\.Expect\(x\)\.Should\(g2\.BeNil\(\)\). instead` + g2.Expect(nil == x).Should(g2.BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .g2\.Expect\(x\)\.Should\(g2\.BeNil\(\)\). instead` + g2.Expect(x == nil).ShouldNot(g2.BeFalse()) // want `ginkgo-linter: wrong nil assertion\. Consider using .g2\.Expect\(x\)\.Should\(g2\.BeNil\(\)\). instead` + g2.Expect(x == nil).Should(g2.Not(g2.BeFalse())) // want `ginkgo-linter: wrong nil assertion\. Consider using .g2\.Expect\(x\)\.Should\(g2\.BeNil\(\)\). instead` }) }) diff --git a/testdata/src/a/pointers/pointers.go b/testdata/src/a/pointers/pointers.go index 792feec..6692a09 100644 --- a/testdata/src/a/pointers/pointers.go +++ b/testdata/src/a/pointers/pointers.go @@ -28,9 +28,9 @@ var _ = Describe("", func() { It("", func() { val1, val2 := 8, 8 p1, p2, p3 := &val1, &val1, &val2 - Expect(p1 == p2).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(p1\)\.To\(BeIdenticalTo\(p2\)\). instead` - Expect(p1 == p3).To(BeFalse()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(p1\)\.ToNot\(BeIdenticalTo\(p3\)\). instead` - Expect(p1 == p3).WithOffset(1).To(BeFalse()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(p1\)\.WithOffset\(1\)\.ToNot\(BeIdenticalTo\(p3\)\). instead` + Expect(p1 == p2).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(p1\)\.To\(BeIdenticalTo\(p2\)\). instead` + Expect(p1 == p3).To(BeFalse()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(p1\)\.ToNot\(BeIdenticalTo\(p3\)\). instead` + Expect(p1 == p3).WithOffset(1).To(BeFalse()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(p1\)\.WithOffset\(1\)\.ToNot\(BeIdenticalTo\(p3\)\). instead` }) It("", func() { @@ -42,12 +42,12 @@ var _ = Describe("", func() { t2 := &ttt{in: &inner{i: &v1}} t3 := &ttt{in: &inner{i: &v2}} - Expect(t1 != t2).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(t1\)\.ToNot\(BeIdenticalTo\(t2\)\). instead` - Expect(t1.in.i == t2.in.i).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(t1.in.i\)\.To\(BeIdenticalTo\(t2.in.i\)\). instead` - Expect(t1.in.i != t3.in.i).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(t1.in.i\)\.ToNot\(BeIdenticalTo\(t3.in.i\)\). instead` + Expect(t1 != t2).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(t1\)\.ToNot\(BeIdenticalTo\(t2\)\). instead` + Expect(t1.in.i == t2.in.i).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(t1\.in\.i\)\.To\(BeIdenticalTo\(t2\.in\.i\)\). instead` + Expect(t1.in.i != t3.in.i).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(t1\.in\.i\)\.ToNot\(BeIdenticalTo\(t3\.in\.i\)\). instead` t4 := GetBBB() - Expect(t4 == t1).To(BeFalse()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(t4\)\.ToNot\(BeIdenticalTo\(t1\)\). instead` - Expect(t4 == t1).WithOffset(1).To(BeFalse()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(t4\)\.WithOffset\(1\)\.ToNot\(BeIdenticalTo\(t1\)\). instead` + Expect(t4 == t1).To(BeFalse()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(t4\)\.ToNot\(BeIdenticalTo\(t1\)\). instead` + Expect(t4 == t1).WithOffset(1).To(BeFalse()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(t4\)\.WithOffset\(1\)\.ToNot\(BeIdenticalTo\(t1\)\). instead` }) }) diff --git a/testdata/src/a/pointers/pointers.gomega.go b/testdata/src/a/pointers/pointers.gomega.go index 6c61b21..ed6c8bd 100644 --- a/testdata/src/a/pointers/pointers.gomega.go +++ b/testdata/src/a/pointers/pointers.gomega.go @@ -9,8 +9,8 @@ var _ = Describe("", func() { It("", func() { val1, val2 := 8, 8 p1, p2, p3 := &val1, &val1, &val2 - g.Expect(p1 == p2).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(p1\)\.To\(g\.BeIdenticalTo\(p2\)\). instead` - g.Expect(p1 == p3).To(g.BeFalse()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(p1\)\.ToNot\(g\.BeIdenticalTo\(p3\)\). instead` + g.Expect(p1 == p2).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(p1\)\.To\(g\.BeIdenticalTo\(p2\)\). instead` + g.Expect(p1 == p3).To(g.BeFalse()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(p1\)\.ToNot\(g\.BeIdenticalTo\(p3\)\). instead` }) It("", func() { @@ -22,12 +22,12 @@ var _ = Describe("", func() { t2 := &ttt{in: &inner{i: &v1}} t3 := &ttt{in: &inner{i: &v2}} - g.Expect(t1 != t2).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(t1\)\.ToNot\(g\.BeIdenticalTo\(t2\)\). instead` - g.Expect(t1.in.i == t2.in.i).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(t1\.in\.i\)\.To\(g\.BeIdenticalTo\(t2\.in\.i\)\). instead` - g.Expect(t1.in.i != t3.in.i).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(t1\.in\.i\)\.ToNot\(g\.BeIdenticalTo\(t3\.in\.i\)\). instead` + g.Expect(t1 != t2).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(t1\)\.ToNot\(g\.BeIdenticalTo\(t2\)\). instead` + g.Expect(t1.in.i == t2.in.i).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(t1\.in\.i\)\.To\(g\.BeIdenticalTo\(t2\.in\.i\)\). instead` + g.Expect(t1.in.i != t3.in.i).To(g.BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(t1\.in\.i\)\.ToNot\(g\.BeIdenticalTo\(t3\.in\.i\)\). instead` t4 := GetBBB() - g.Expect(t4 == t1).To(g.BeFalse()) // want `ginkgo-linter: wrong comparison assertion; consider using .g\.Expect\(t4\)\.ToNot\(g\.BeIdenticalTo\(t1\)\). instead` + g.Expect(t4 == t1).To(g.BeFalse()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .g\.Expect\(t4\)\.ToNot\(g\.BeIdenticalTo\(t1\)\). instead` }) }) diff --git a/testdata/src/a/pointerval/pointerval.go b/testdata/src/a/pointerval/pointerval.go index 6985623..1dff9ac 100644 --- a/testdata/src/a/pointerval/pointerval.go +++ b/testdata/src/a/pointerval/pointerval.go @@ -48,25 +48,25 @@ var _ = Describe("", Label("pointers1"), func() { It("pointer to var", func() { Expect(*p).Should(Equal(v)) Expect(p).Should(HaveValue(Equal(v))) - Expect(&v).Should(Equal(c)) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .Expect\(&v\)\.Should\(HaveValue\(Equal\(c\)\)\). instead` + Expect(&v).Should(Equal(c)) // want `ginkgo-linter: comparing a pointer to a value will always fail\. Consider using .Expect\(&v\)\.Should\(HaveValue\(Equal\(c\)\)\). instead` Expect(p).Should(Equal(&v)) - Expect(p).Should(Equal(v)) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .Expect\(p\)\.Should\(HaveValue\(Equal\(v\)\)\). instead` + Expect(p).Should(Equal(v)) // want `ginkgo-linter: comparing a pointer to a value will always fail\. Consider using .Expect\(p\)\.Should\(HaveValue\(Equal\(v\)\)\). instead` }) It("with description", func() { - Expect(p).Should(Equal(v), "%d", 3) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .Expect\(p\)\.Should\(HaveValue\(Equal\(v\)\), "%d", 3\). instead` + Expect(p).Should(Equal(v), "%d", 3) // want `ginkgo-linter: comparing a pointer to a value will always fail\. Consider using .Expect\(p\)\.Should\(HaveValue\(Equal\(v\)\), "%d", 3\). instead` }) It("pointer to const", func() { Expect(*p).Should(Equal(c)) Expect(p).Should(HaveValue(Equal(c))) - Expect(p).Should(Equal(c)) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .Expect\(p\)\.Should\(HaveValue\(Equal\(c\)\)\). instead` + Expect(p).Should(Equal(c)) // want `ginkgo-linter: comparing a pointer to a value will always fail\. Consider using .Expect\(p\)\.Should\(HaveValue\(Equal\(c\)\)\). instead` }) It("function", func() { Expect(retPointer()).Should(HaveValue(Equal(c))) // valid Expect(*retPointer()).Should(Equal(c)) // valid - Expect(retPointer()).Should(Equal(c)) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .Expect\(retPointer\(\)\)\.Should\(HaveValue\(Equal\(c\)\)\). instead` + Expect(retPointer()).Should(Equal(c)) // want `ginkgo-linter: comparing a pointer to a value will always fail\. Consider using .Expect\(retPointer\(\)\)\.Should\(HaveValue\(Equal\(c\)\)\). instead` }) Context("struct", func() { @@ -84,14 +84,14 @@ var _ = Describe("", Label("pointers1"), func() { It("struct with pointer field", func() { Expect(*s3.field).Should(Equal(c)) // valid Expect(s3.field).Should(HaveValue(Equal(c))) // valid - Expect(s3.field).Should(Equal(c)) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .Expect\(s3\.field\)\.Should\(HaveValue\(Equal\(c\)\)\). instead` + Expect(s3.field).Should(Equal(c)) // want `ginkgo-linter: comparing a pointer to a value will always fail\. Consider using .Expect\(s3\.field\)\.Should\(HaveValue\(Equal\(c\)\)\). instead` Expect(s3.field).Should(BeIdenticalTo(p)) - Expect(s3.field).ShouldNot(BeIdenticalTo(retStringer())) // want `ginkgo-linter: use BeIdenticalTo with different types: Comparing \*string with fmt.Stringer; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of BeIdenticalTo\(\)` + Expect(s3.field).ShouldNot(BeIdenticalTo(retStringer())) // want `ginkgo-linter: use BeIdenticalTo with different types: Comparing \*string with fmt\.Stringer; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of BeIdenticalTo\(\)` }) It("pointer struct with pointer field", func() { Expect(*s4.field).Should(Equal(c)) // valid Expect(s4.field).Should(HaveValue(Equal(c))) // valid - Expect(s4.field).Should(Equal(c)) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .Expect\(s4\.field\)\.Should\(HaveValue\(Equal\(c\)\)\). instead` + Expect(s4.field).Should(Equal(c)) // want `ginkgo-linter: comparing a pointer to a value will always fail\. Consider using .Expect\(s4\.field\)\.Should\(HaveValue\(Equal\(c\)\)\). instead` }) }) @@ -101,13 +101,13 @@ var _ = Describe("", Label("pointers1"), func() { s2 := &strIfs{field: &sv} It("struct with pointer field", func() { - Expect(s1.field).Should(HaveValue(Equal(c))) // want `ginkgo-linter: use Equal with different types: Comparing fmt.Stringer with string; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` - Expect(s1.field).Should(Equal(c)) // want `ginkgo-linter: use Equal with different types: Comparing fmt.Stringer with string; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` - Expect(s1.field).Should(BeIdenticalTo(sv)) // want `ginkgo-linter: use BeIdenticalTo with different types: Comparing fmt.Stringer with a/pointerval.str; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of BeIdenticalTo\(\)` + Expect(s1.field).Should(HaveValue(Equal(c))) // want `ginkgo-linter: use Equal with different types: Comparing fmt\.Stringer with string; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` + Expect(s1.field).Should(Equal(c)) // want `ginkgo-linter: use Equal with different types: Comparing fmt\.Stringer with string; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` + Expect(s1.field).Should(BeIdenticalTo(sv)) // want `ginkgo-linter: use BeIdenticalTo with different types: Comparing fmt\.Stringer with a/pointerval\.str; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of BeIdenticalTo\(\)` }) It("pointer struct with pointer field", func() { - Expect(s2.field).Should(HaveValue(Equal(c))) // want `ginkgo-linter: use Equal with different types: Comparing fmt.Stringer with string; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` - Expect(s2.field).Should(Equal(c)) // want `ginkgo-linter: use Equal with different types: Comparing fmt.Stringer with string; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` + Expect(s2.field).Should(HaveValue(Equal(c))) // want `ginkgo-linter: use Equal with different types: Comparing fmt\.Stringer with string; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` + Expect(s2.field).Should(Equal(c)) // want `ginkgo-linter: use Equal with different types: Comparing fmt\.Stringer with string; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of Equal\(\)` }) It("compare to interface", func() { Expect(&sv).Should(Equal(retStringer())) @@ -116,12 +116,12 @@ var _ = Describe("", Label("pointers1"), func() { Context("negative", func() { var n *string - Expect(n).ShouldNot(Equal(c)) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .Expect\(n\)\.ShouldNot\(HaveValue\(Equal\(c\)\)\). instead` - Expect(n).To(Not(Equal(c))) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .Expect\(n\)\.ToNot\(HaveValue\(Equal\(c\)\)\). instead` + Expect(n).ShouldNot(Equal(c)) // want `ginkgo-linter: comparing a pointer to a value will always fail\. Consider using .Expect\(n\)\.ShouldNot\(HaveValue\(Equal\(c\)\)\). instead` + Expect(n).To(Not(Equal(c))) // want `ginkgo-linter: comparing a pointer to a value will always fail\. Consider using .Expect\(n\)\.ToNot\(HaveValue\(Equal\(c\)\)\). instead` }) It("do not add HaveValue for nil", func() { - Expect(p).ShouldNot(Equal(nil)) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(p\)\.ShouldNot\(BeNil\(\)\). instead` + Expect(p).ShouldNot(Equal(nil)) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(p\)\.ShouldNot\(BeNil\(\)\). instead` Expect(p).ShouldNot(BeNil()) // valid }) Context("boolean", func() { @@ -131,23 +131,23 @@ var _ = Describe("", Label("pointers1"), func() { pf := &f It("true", func() { - Expect(pt).Should(Equal(true)) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .Expect\(pt\)\.Should\(HaveValue\(BeTrue\(\)\)\). instead` - Expect(pt).ShouldNot(Equal(false)) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .Expect\(pt\)\.Should\(HaveValue\(BeTrue\(\)\)\). instead` + Expect(pt).Should(Equal(true)) // want `ginkgo-linter: multiple issues: wrong boolean assertion; comparing a pointer to a value will always fail\. Consider using .Expect\(pt\)\.Should\(HaveValue\(BeTrue\(\)\)\). instead` + Expect(pt).ShouldNot(Equal(false)) // want `ginkgo-linter: multiple issues: wrong boolean assertion; comparing a pointer to a value will always fail\. Consider using .Expect\(pt\)\.Should\(HaveValue\(BeTrue\(\)\)\). instead` }) It("BeTrue", func() { - Expect(pt).Should(BeTrue()) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .Expect\(pt\)\.Should\(HaveValue\(BeTrue\(\)\)\). instead` - Expect(pt).ShouldNot(BeFalse()) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .Expect\(pt\)\.Should\(HaveValue\(BeTrue\(\)\)\). instead` + Expect(pt).Should(BeTrue()) // want `ginkgo-linter: comparing a pointer to a value will always fail\. Consider using .Expect\(pt\)\.Should\(HaveValue\(BeTrue\(\)\)\). instead` + Expect(pt).ShouldNot(BeFalse()) // want `ginkgo-linter: multiple issues: avoid double negative assertion; comparing a pointer to a value will always fail\. Consider using .Expect\(pt\)\.Should\(HaveValue\(BeTrue\(\)\)\). instead` }) It("false", func() { - Expect(pf).Should(Equal(false)) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .Expect\(pf\)\.Should\(HaveValue\(BeFalse\(\)\)\). instead` - Expect(pf).ShouldNot(Equal(true)) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .Expect\(pf\)\.ShouldNot\(HaveValue\(BeTrue\(\)\)\). instead` + Expect(pf).Should(Equal(false)) // want `ginkgo-linter: multiple issues: wrong boolean assertion; comparing a pointer to a value will always fail\. Consider using .Expect\(pf\)\.Should\(HaveValue\(BeFalse\(\)\)\). instead` + Expect(pf).ShouldNot(Equal(true)) // want `ginkgo-linter: multiple issues: wrong boolean assertion; comparing a pointer to a value will always fail\. Consider using .Expect\(pf\)\.ShouldNot\(HaveValue\(BeTrue\(\)\)\). instead` }) It("Not with boolean", func() { - Expect(pf).Should(Not(Equal(true))) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .Expect\(pf\)\.ShouldNot\(HaveValue\(BeTrue\(\)\)\). instead` - Expect(pt).Should(Not(Equal(false))) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .Expect\(pt\)\.Should\(HaveValue\(BeTrue\(\)\)\). instead` + Expect(pf).Should(Not(Equal(true))) // want `ginkgo-linter: multiple issues: wrong boolean assertion; comparing a pointer to a value will always fail\. Consider using .Expect\(pf\)\.ShouldNot\(HaveValue\(BeTrue\(\)\)\). instead` + Expect(pt).Should(Not(Equal(false))) // want `ginkgo-linter: multiple issues: wrong boolean assertion; comparing a pointer to a value will always fail\. Consider using .Expect\(pt\)\.Should\(HaveValue\(BeTrue\(\)\)\). instead` }) }) @@ -157,21 +157,21 @@ var _ = Describe("", Label("pointers1"), func() { px1 := &x px2 := &x It("BeEquivalentTo", func() { - Expect(px1).Should(BeEquivalentTo(5)) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .Expect\(px1\)\.Should\(HaveValue\(BeEquivalentTo\(5\)\)\). instead` - Expect(px1).Should(BeEquivalentTo(y)) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .Expect\(px1\)\.Should\(HaveValue\(BeEquivalentTo\(y\)\)\). instead` + Expect(px1).Should(BeEquivalentTo(5)) // want `ginkgo-linter: comparing a pointer to a value will always fail\. Consider using .Expect\(px1\)\.Should\(HaveValue\(BeEquivalentTo\(5\)\)\). instead` + Expect(px1).Should(BeEquivalentTo(y)) // want `ginkgo-linter: comparing a pointer to a value will always fail\. Consider using .Expect\(px1\)\.Should\(HaveValue\(BeEquivalentTo\(y\)\)\). instead` Expect(px1).Should(BeEquivalentTo(&x)) // valid - compare two pointers Expect(px1).Should(BeEquivalentTo(px2)) // valid - compare two pointers Expect(px1).ShouldNot(BeEquivalentTo(nil)) // valid }) It("BeIdenticalTo", func() { - Expect(px1).ShouldNot(BeIdenticalTo(5)) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .Expect\(px1\)\.ShouldNot\(HaveValue\(BeIdenticalTo\(5\)\)\). instead` + Expect(px1).ShouldNot(BeIdenticalTo(5)) // want `ginkgo-linter: comparing a pointer to a value will always fail\. Consider using .Expect\(px1\)\.ShouldNot\(HaveValue\(BeIdenticalTo\(5\)\)\). instead` Expect(px1).ShouldNot(BeIdenticalTo(px2)) // valid Expect(px1).ShouldNot(BeIdenticalTo(nil)) // want `ginkgo-linter: use BeIdenticalTo with different types: Comparing \*float64 with untyped nil; either change the expected value type if possible, or use the BeEquivalentTo\(\) matcher, instead of BeIdenticalTo\(\)` - Expect(px1).Should(BeIdenticalTo(float64(5))) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .Expect\(px1\)\.Should\(HaveValue\(BeIdenticalTo\(float64\(5\)\)\)\). instead` + Expect(px1).Should(BeIdenticalTo(float64(5))) // want `ginkgo-linter: comparing a pointer to a value will always fail\. Consider using .Expect\(px1\)\.Should\(HaveValue\(BeIdenticalTo\(float64\(5\)\)\)\). instead` }) It("", func() { - Expect(px1).Should(BeNumerically(">", 4)) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .Expect\(px1\)\.Should\(HaveValue\(BeNumerically\(">", 4\)\)\). instead` - Expect(px1).ShouldNot(BeNumerically(">", 6)) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .Expect\(px1\)\.ShouldNot\(HaveValue\(BeNumerically\(">", 6\)\)\). instead` + Expect(px1).Should(BeNumerically(">", 4)) // want `ginkgo-linter: comparing a pointer to a value will always fail\. Consider using .Expect\(px1\)\.Should\(HaveValue\(BeNumerically\(">", 4\)\)\). instead` + Expect(px1).ShouldNot(BeNumerically(">", 6)) // want `ginkgo-linter: comparing a pointer to a value will always fail\. Consider using .Expect\(px1\)\.ShouldNot\(HaveValue\(BeNumerically\(">", 6\)\)\). instead` }) }) }) diff --git a/testdata/src/a/pointerval/pointerval.gomega.go b/testdata/src/a/pointerval/pointerval.gomega.go index fdd5052..ae3b6ed 100644 --- a/testdata/src/a/pointerval/pointerval.gomega.go +++ b/testdata/src/a/pointerval/pointerval.gomega.go @@ -10,19 +10,19 @@ var _ = Describe("", Label("pointers1"), func() { It("pointer to var", func() { g.Expect(*p).Should(g.Equal(v)) g.Expect(p).Should(g.HaveValue(g.Equal(v))) - g.Expect(p).Should(g.Equal(v)) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .g\.Expect\(p\)\.Should\(g\.HaveValue\(g\.Equal\(v\)\)\). instead` + g.Expect(p).Should(g.Equal(v)) // want `ginkgo-linter: comparing a pointer to a value will always fail\. Consider using .g\.Expect\(p\)\.Should\(g\.HaveValue\(g\.Equal\(v\)\)\). instead` }) It("pointer to const", func() { g.Expect(*p).Should(g.Equal(c)) g.Expect(p).Should(g.HaveValue(g.Equal(c))) - g.Expect(p).Should(g.Equal(c)) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .g\.Expect\(p\)\.Should\(g\.HaveValue\(g\.Equal\(c\)\)\). instead` + g.Expect(p).Should(g.Equal(c)) // want `ginkgo-linter: comparing a pointer to a value will always fail\. Consider using .g\.Expect\(p\)\.Should\(g\.HaveValue\(g\.Equal\(c\)\)\). instead` }) It("function", func() { g.Expect(retPointer()).Should(g.HaveValue(g.Equal(c))) // valid g.Expect(*retPointer()).Should(g.Equal(c)) // valid - g.Expect(retPointer()).Should(g.Equal(c)) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .g\.Expect\(retPointer\(\)\)\.Should\(g\.HaveValue\(g\.Equal\(c\)\)\). instead` + g.Expect(retPointer()).Should(g.Equal(c)) // want `ginkgo-linter: comparing a pointer to a value will always fail\. Consider using .g\.Expect\(retPointer\(\)\)\.Should\(g\.HaveValue\(g\.Equal\(c\)\)\). instead` }) Context("struct", func() { @@ -40,17 +40,17 @@ var _ = Describe("", Label("pointers1"), func() { It("struct with pointer field", func() { g.Expect(*s3.field).Should(g.Equal(c)) // valid g.Expect(s3.field).Should(g.HaveValue(g.Equal(c))) // valid - g.Expect(s3.field).Should(g.Equal(c)) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .g\.Expect\(s3\.field\)\.Should\(g\.HaveValue\(g\.Equal\(c\)\)\). instead` + g.Expect(s3.field).Should(g.Equal(c)) // want `ginkgo-linter: comparing a pointer to a value will always fail\. Consider using .g\.Expect\(s3\.field\)\.Should\(g\.HaveValue\(g\.Equal\(c\)\)\). instead` }) It("pointer struct with pointer field", func() { g.Expect(*s4.field).Should(g.Equal(c)) // valid g.Expect(s4.field).Should(g.HaveValue(g.Equal(c))) // valid - g.Expect(s4.field).Should(g.Equal(c)) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .g\.Expect\(s4\.field\)\.Should\(g\.HaveValue\(g\.Equal\(c\)\)\). instead` + g.Expect(s4.field).Should(g.Equal(c)) // want `ginkgo-linter: comparing a pointer to a value will always fail\. Consider using .g\.Expect\(s4\.field\)\.Should\(g\.HaveValue\(g\.Equal\(c\)\)\). instead` }) }) It("do not add HaveValue for nil", func() { - g.Expect(p).ShouldNot(g.Equal(nil)) // want `ginkgo-linter: wrong nil assertion; consider using .g\.Expect\(p\)\.ShouldNot\(g\.BeNil\(\)\). instead` + g.Expect(p).ShouldNot(g.Equal(nil)) // want `ginkgo-linter: wrong nil assertion\. Consider using .g\.Expect\(p\)\.ShouldNot\(g\.BeNil\(\)\). instead` g.Expect(p).ShouldNot(g.BeNil()) // valid }) @@ -61,18 +61,18 @@ var _ = Describe("", Label("pointers1"), func() { pf := &f It("true", func() { - g.Expect(pt).Should(g.Equal(true)) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .g\.Expect\(pt\)\.Should\(g\.HaveValue\(g\.BeTrue\(\)\)\). instead` - g.Expect(pt).ShouldNot(g.Equal(false)) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .g\.Expect\(pt\)\.Should\(g\.HaveValue\(g\.BeTrue\(\)\)\). instead` + g.Expect(pt).Should(g.Equal(true)) // want `ginkgo-linter: multiple issues: wrong boolean assertion; comparing a pointer to a value will always fail\. Consider using .g\.Expect\(pt\)\.Should\(g\.HaveValue\(g\.BeTrue\(\)\)\). instead` + g.Expect(pt).ShouldNot(g.Equal(false)) // want `ginkgo-linter: multiple issues: wrong boolean assertion; comparing a pointer to a value will always fail\. Consider using .g\.Expect\(pt\)\.Should\(g\.HaveValue\(g\.BeTrue\(\)\)\). instead` }) It("BeTrue", func() { - g.Expect(pt).Should(g.BeTrue()) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .g\.Expect\(pt\)\.Should\(g\.HaveValue\(g\.BeTrue\(\)\)\). instead` - g.Expect(pt).ShouldNot(g.BeFalse()) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .g\.Expect\(pt\)\.Should\(g\.HaveValue\(g\.BeTrue\(\)\)\). instead` + g.Expect(pt).Should(g.BeTrue()) // want `ginkgo-linter: comparing a pointer to a value will always fail\. Consider using .g\.Expect\(pt\)\.Should\(g\.HaveValue\(g\.BeTrue\(\)\)\). instead` + g.Expect(pt).ShouldNot(g.BeFalse()) // want `ginkgo-linter: multiple issues: avoid double negative assertion; comparing a pointer to a value will always fail\. Consider using .g\.Expect\(pt\)\.Should\(g\.HaveValue\(g\.BeTrue\(\)\)\). instead` }) It("false", func() { - g.Expect(pf).Should(g.Equal(false)) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .g\.Expect\(pf\)\.Should\(g\.HaveValue\(g\.BeFalse\(\)\)\). instead` - g.Expect(pf).ShouldNot(g.Equal(true)) // want `ginkgo-linter: comparing a pointer to a value will always fail. consider using .g\.Expect\(pf\)\.ShouldNot\(g\.HaveValue\(g\.BeTrue\(\)\)\). instead` + g.Expect(pf).Should(g.Equal(false)) // want `ginkgo-linter: multiple issues: wrong boolean assertion; comparing a pointer to a value will always fail\. Consider using .g\.Expect\(pf\)\.Should\(g\.HaveValue\(g\.BeFalse\(\)\)\). instead` + g.Expect(pf).ShouldNot(g.Equal(true)) // want `ginkgo-linter: multiple issues: wrong boolean assertion; comparing a pointer to a value will always fail\. Consider using .g\.Expect\(pf\)\.ShouldNot\(g\.HaveValue\(g\.BeTrue\(\)\)\). instead` }) }) }) diff --git a/testdata/src/a/suppress/a.go b/testdata/src/a/suppress/a.go index 3099c40..ee7d2ce 100644 --- a/testdata/src/a/suppress/a.go +++ b/testdata/src/a/suppress/a.go @@ -10,7 +10,7 @@ var _ = Describe("Supress wrong length check", func() { It("should ignore length warning", func() { // ginkgo-linter:ignore-len-assert-warning Expect(len("abc")).Should(Equal(3)) - Expect(len("abc")).Should(Equal(3)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abc"\)\.Should\(HaveLen\(3\)\). instead` + Expect(len("abc")).Should(Equal(3)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abc"\)\.Should\(HaveLen\(3\)\). instead` Expect("123").To(HaveLen(3)) /* @@ -35,7 +35,7 @@ var _ = Describe("Supress wrong length check", func() { It("should ignore length warning", func() { // ginkgo-linter:ignore-nil-assert-warning Expect(x == nil).Should(BeTrue()) - Expect(x == nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion; consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` + Expect(x == nil).Should(BeTrue()) // want `ginkgo-linter: wrong nil assertion\. Consider using .Expect\(x\)\.Should\(BeNil\(\)\). instead` Expect(x).To(BeNil()) /* @@ -60,7 +60,7 @@ var _ = Describe("Supress wrong length check", func() { It("should ignore error warning", func() { // ginkgo-linter:ignore-err-assert-warning Expect(x).To(BeNil()) - Expect(x == nil).Should(BeTrue()) // want `ginkgo-linter: wrong error assertion; consider using .Expect\(x\)\.ShouldNot\(HaveOccurred\(\)\). instead` + Expect(x == nil).Should(BeTrue()) // want `ginkgo-linter: wrong error assertion\. Consider using .Expect\(x\)\.ShouldNot\(HaveOccurred\(\)\). instead` // ginkgo-linter:ignore-err-assert-warning Expect(x == nil).Should(BeTrue()) /* diff --git a/testdata/src/a/suppress/coparison.comment.go b/testdata/src/a/suppress/coparison.comment.go index 6272390..e403890 100644 --- a/testdata/src/a/suppress/coparison.comment.go +++ b/testdata/src/a/suppress/coparison.comment.go @@ -7,10 +7,10 @@ import ( var _ = Describe("should suppress comparison assertions", func() { It("should suppress comparison assertions", func() { - Expect(len("abcd")).To(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(HaveLen\(4\)\). instead` + Expect(len("abcd")).To(Equal(4)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(HaveLen\(4\)\). instead` str := "abcd" // ginkgo-linter:ignore-compare-assert-warning Expect("abcd" == str).To(BeTrue()) // no warning triggered - Expect("abcd" == str).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion; consider using .Expect\(str\)\.To\(Equal\("abcd"\)\). instead` + Expect("abcd" == str).To(BeTrue()) // want `ginkgo-linter: wrong comparison assertion\. Consider using .Expect\(str\)\.To\(Equal\("abcd"\)\). instead` }) }) diff --git a/testdata/src/a/suppress/coparison.file.go b/testdata/src/a/suppress/coparison.file.go index 7072216..eb43ee1 100644 --- a/testdata/src/a/suppress/coparison.file.go +++ b/testdata/src/a/suppress/coparison.file.go @@ -9,7 +9,7 @@ import ( var _ = Describe("should suppress comparison assertions", func() { It("should suppress comparison assertions", func() { - Expect(len("abcd")).To(Equal(4)) // want `ginkgo-linter: wrong length assertion; consider using .Expect\("abcd"\)\.To\(HaveLen\(4\)\). instead` + Expect(len("abcd")).To(Equal(4)) // want `ginkgo-linter: wrong length assertion\. Consider using .Expect\("abcd"\)\.To\(HaveLen\(4\)\). instead` str := "abcd" Expect("abcd" == str).To(BeTrue()) // no warning triggered }) diff --git a/testdata/src/a/suppress/eventually.comment.go b/testdata/src/a/suppress/eventually.comment.go index 2163f57..327752b 100644 --- a/testdata/src/a/suppress/eventually.comment.go +++ b/testdata/src/a/suppress/eventually.comment.go @@ -19,16 +19,16 @@ func slowBool() bool { var _ = Describe("should suppress async assertions", func() { It("should suppress async assertions", func() { - Eventually(slowInt()).Should(Equal(42)) // want `ginkgo-linter: use a function call in Eventually. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed; consider using .Eventually\(slowInt\)\.Should\(Equal\(42\)\). instead` + Eventually(slowInt()).Should(Equal(42)) // want `ginkgo-linter: use a function call in Eventually\. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed\. Consider using .Eventually\(slowInt\)\.Should\(Equal\(42\)\). instead` // ginkgo-linter:ignore-async-assert-warning Eventually(slowInt()).Should(Equal(42)) }) It("should suppress async assertions, but not Eqaul(true)", func() { - Eventually(slowBool()).Should(Equal(true)) // want `ginkgo-linter: use a function call in Eventually. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed; consider using .Eventually\(slowBool\)\.Should\(BeTrue\(\)\). instead` `ginkgo-linter: wrong boolean assertion; consider using .Eventually\(slowBool\)\.Should\(BeTrue\(\)\). instead` + Eventually(slowBool()).Should(Equal(true)) // want `ginkgo-linter: multiple issues: wrong boolean assertion; use a function call in Eventually\. This actually checks nothing, because Eventually receives the function returned value, instead of function itself, and this value is never changed\. Consider using .Eventually\(slowBool\)\.Should\(BeTrue\(\)\). instead` // ginkgo-linter:ignore-async-assert-warning - Eventually(slowBool()).Should(Equal(true)) // want `ginkgo-linter: wrong boolean assertion; consider using .Eventually\(slowBool\(\)\)\.Should\(BeTrue\(\)\). instead` + Eventually(slowBool()).Should(Equal(true)) // want `ginkgo-linter: wrong boolean assertion\. Consider using .Eventually\(slowBool\(\)\)\.Should\(BeTrue\(\)\). instead` }) }) diff --git a/testdata/src/a/suppress/eventually.file.go b/testdata/src/a/suppress/eventually.file.go index 35e8c7a..c6a17cb 100644 --- a/testdata/src/a/suppress/eventually.file.go +++ b/testdata/src/a/suppress/eventually.file.go @@ -13,6 +13,6 @@ var _ = Describe("should suppress async assertions", func() { }) It("should suppress async assertions, but not Eqaul(true)", func() { - Eventually(slowBool()).Should(Equal(true)) // want `ginkgo-linter: wrong boolean assertion; consider using .Eventually\(slowBool\(\)\)\.Should\(BeTrue\(\)\). instead` + Eventually(slowBool()).Should(Equal(true)) // want `ginkgo-linter: wrong boolean assertion\. Consider using .Eventually\(slowBool\(\)\)\.Should\(BeTrue\(\)\). instead` }) }) diff --git a/tests/e2e.sh b/tests/e2e.sh index 1a9182b..94c99bf 100755 --- a/tests/e2e.sh +++ b/tests/e2e.sh @@ -6,26 +6,26 @@ cp ginkgolinter testdata/src/a cd testdata/src/a # no suppress -[[ $(./ginkgolinter a/... 2>&1 | wc -l) == 2547 ]] +[[ $(./ginkgolinter a/... 2>&1 | wc -l) == 2526 ]] # suppress all but nil -[[ $(./ginkgolinter --suppress-len-assertion=true --suppress-err-assertion=true --suppress-compare-assertion=true --suppress-async-assertion=true --suppress-type-compare-assertion=true a/... 2>&1 | wc -l) == 1519 ]] +[[ $(./ginkgolinter --suppress-len-assertion=true --suppress-err-assertion=true --suppress-compare-assertion=true --suppress-async-assertion=true --suppress-type-compare-assertion=true a/... 2>&1 | wc -l) == 1516 ]] # suppress all but len -[[ $(./ginkgolinter --suppress-nil-assertion=true --suppress-err-assertion=true --suppress-compare-assertion=true --suppress-async-assertion=true --suppress-type-compare-assertion=true a/... 2>&1 | wc -l) == 823 ]] +[[ $(./ginkgolinter --suppress-nil-assertion=true --suppress-err-assertion=true --suppress-compare-assertion=true --suppress-async-assertion=true --suppress-type-compare-assertion=true a/... 2>&1 | wc -l) == 820 ]] # suppress all but err -[[ $(./ginkgolinter --suppress-nil-assertion=true --suppress-len-assertion=true --suppress-compare-assertion=true --suppress-async-assertion=true --suppress-type-compare-assertion=true a/... 2>&1 | wc -l) == 279 ]] +[[ $(./ginkgolinter --suppress-nil-assertion=true --suppress-len-assertion=true --suppress-compare-assertion=true --suppress-async-assertion=true --suppress-type-compare-assertion=true a/... 2>&1 | wc -l) == 276 ]] # suppress all but compare -[[ $(./ginkgolinter --suppress-nil-assertion=true --suppress-err-assertion=true --suppress-len-assertion=true --suppress-async-assertion=true --suppress-type-compare-assertion=true a/... 2>&1 | wc -l) == 289 ]] +[[ $(./ginkgolinter --suppress-nil-assertion=true --suppress-err-assertion=true --suppress-len-assertion=true --suppress-async-assertion=true --suppress-type-compare-assertion=true a/... 2>&1 | wc -l) == 286 ]] # suppress all but async -[[ $(./ginkgolinter --suppress-nil-assertion=true --suppress-err-assertion=true --suppress-len-assertion=true --suppress-compare-assertion=true --suppress-type-compare-assertion=true a/... 2>&1 | wc -l) == 192 ]] +[[ $(./ginkgolinter --suppress-nil-assertion=true --suppress-err-assertion=true --suppress-len-assertion=true --suppress-compare-assertion=true --suppress-type-compare-assertion=true a/... 2>&1 | wc -l) == 183 ]] # suppress all but focus -[[ $(./ginkgolinter --suppress-nil-assertion=true --suppress-err-assertion=true --suppress-len-assertion=true --suppress-compare-assertion=true --suppress-async-assertion=true --forbid-focus-container=true --suppress-type-compare-assertion=true a/... 2>&1 | wc -l) == 210 ]] +[[ $(./ginkgolinter --suppress-nil-assertion=true --suppress-err-assertion=true --suppress-len-assertion=true --suppress-compare-assertion=true --suppress-async-assertion=true --forbid-focus-container=true --suppress-type-compare-assertion=true a/... 2>&1 | wc -l) == 207 ]] # suppress all but compare different types -[[ $(./ginkgolinter --suppress-nil-assertion=true --suppress-err-assertion=true --suppress-len-assertion=true --suppress-compare-assertion=true --suppress-compare-assertion=true a/... 2>&1 | wc -l) == 288 ]] +[[ $(./ginkgolinter --suppress-nil-assertion=true --suppress-err-assertion=true --suppress-len-assertion=true --suppress-compare-assertion=true --suppress-compare-assertion=true a/... 2>&1 | wc -l) == 267 ]] # allow HaveLen(0) -[[ $(./ginkgolinter --allow-havelen-0=true a/... 2>&1 | wc -l) == 2533 ]] +[[ $(./ginkgolinter --allow-havelen-0=true a/... 2>&1 | wc -l) == 2513 ]] # force Expect with To -[[ $(./ginkgolinter --force-expect-to=true a/... 2>&1 | wc -l) == 3209 ]] +[[ $(./ginkgolinter --force-expect-to=true a/... 2>&1 | wc -l) == 2708 ]] # suppress all - should only return the few non-suppressble -[[ $(./ginkgolinter --suppress-nil-assertion=true --suppress-len-assertion=true --suppress-err-assertion=true --suppress-compare-assertion=true --suppress-async-assertion=true --forbid-focus-container=false --suppress-type-compare-assertion=true a/... 2>&1 | wc -l) == 155 ]] +[[ $(./ginkgolinter --suppress-nil-assertion=true --suppress-len-assertion=true --suppress-err-assertion=true --suppress-compare-assertion=true --suppress-async-assertion=true --forbid-focus-container=false --suppress-type-compare-assertion=true a/... 2>&1 | wc -l) == 152 ]] # suppress all, force Expect with To -[[ $(./ginkgolinter --force-expect-to=true --suppress-nil-assertion=true --suppress-len-assertion=true --suppress-err-assertion=true --suppress-compare-assertion=true --suppress-async-assertion=true --forbid-focus-container=false --suppress-type-compare-assertion=true a/... 2>&1 | wc -l) == 817 ]] +[[ $(./ginkgolinter --force-expect-to=true --suppress-nil-assertion=true --suppress-len-assertion=true --suppress-err-assertion=true --suppress-compare-assertion=true --suppress-async-assertion=true --forbid-focus-container=false --suppress-type-compare-assertion=true a/... 2>&1 | wc -l) == 775 ]] diff --git a/utils/setwanted/go.mod b/utils/setwanted/go.mod new file mode 100644 index 0000000..f5b23db --- /dev/null +++ b/utils/setwanted/go.mod @@ -0,0 +1,5 @@ +module setwanted + +go 1.21.6 + +require golang.org/x/sync v0.6.0 // indirect diff --git a/utils/setwanted/setWanted.go b/utils/setwanted/setWanted.go new file mode 100644 index 0000000..21e405c --- /dev/null +++ b/utils/setwanted/setWanted.go @@ -0,0 +1,112 @@ +package main + +import ( + "bufio" + "fmt" + "golang.org/x/sync/errgroup" + "log" + "os" + "strconv" + "strings" +) + +func main() { + + s := bufio.NewScanner(os.Stdin) + // str := `/home/nunnatsa/GIT/ginkgolinter/testdata/src/a/len/c.go:21:3: ginkgo-linter: found issues: (1) wrong length assertion; consider using ` + "`g.Expect(s).Should(g.HaveLen(4))`" + ` instead + ///home/nunnatsa/GIT/ginkgolinter/testdata/src/a/len/c.go:22:3: ginkgo-linter: found issues: (1) wrong length assertion; consider using ` + "`g.Expect(s).WithOffset(1).Should(g.HaveLen(4))`" + ` instead + ///home/nunnatsa/GIT/ginkgolinter/testdata/src/a/len/c.go:23:3: ginkgo-linter: found issues: (1) wrong length assertion; consider using ` + "`g.Expect(s).WithOffset(1).Should(g.HaveLen(4))`" + ` instead + ///home/nunnatsa/GIT/ginkgolinter/testdata/src/a/len/c.go:24:3: ginkgo-linter: found issues: (1) wrong length assertion; consider using ` + "`g.Expect(s).WithOffset(1).ShouldNot(g.HaveLen(5))`" + ` instead + //` + // s := bufio.NewScanner(bytes.NewBuffer([]byte(str))) + m := parse(s) + + errgrp := errgroup.Group{} + + for f, mp := range m { + func(file string, msgs map[int][]string) { + errgrp.Go(func() error { + return fixFile(file, msgs) + }) + }(f, mp) + } + + if err := errgrp.Wait(); err != nil { + panic(err) + } +} + +func parse(scanner *bufio.Scanner) map[string]map[int][]string { + m := make(map[string]map[int][]string) + for scanner.Scan() { + fileName, lineNum, msg, err := parseLine(scanner.Text()) + if err == nil { + if _, exists := m[fileName]; !exists { + m[fileName] = make(map[int][]string) + } + m[fileName][lineNum] = append(m[fileName][lineNum], msg) + } + } + + if err := scanner.Err(); err != nil { + log.Fatal(err) + } + return m +} + +func parseLine(line string) (string, int, string, error) { + idx := strings.Index(line, ":") + fileName := line[:idx] + line = line[idx+1:] + idx = strings.Index(line, ":") + lineNum, err := strconv.Atoi(line[:idx]) + if err != nil { + return "", 0, "", err + } + + idx = strings.Index(line, " ") + msg := line[idx+1:] + + msg = strings.ReplaceAll(msg, "(", "\\(") + msg = strings.ReplaceAll(msg, ")", "\\)") + msg = strings.ReplaceAll(msg, "[", "\\[") + msg = strings.ReplaceAll(msg, "]", "\\]") + msg = strings.ReplaceAll(msg, "*", "\\*") + msg = strings.ReplaceAll(msg, ".", "\\.") + msg = strings.ReplaceAll(msg, "`", ".") + + return fileName, lineNum, msg, nil +} + +func fixFile(fileName string, msgs map[int][]string) error { + fmt.Println("fixing file", fileName) + input, err := os.ReadFile(fileName) + if err != nil { + return err + } + + lines := strings.Split(string(input), "\n") + + for n, msgList := range msgs { + if n > len(lines) { + return fmt.Errorf("wrong line numbe %d for file %s; msgs = %v", n, fileName, msgList) + } + line := lines[n-1] + idx := strings.Index(line, "//") + + msg := strings.Join(msgList, "` `") + if idx == -1 { + line = line + " // want `" + msg + "`" + } else { + line = line[:idx] + "// want `" + msg + "`" + } + lines[n-1] = line + } + output := strings.Join(lines, "\n") + err = os.WriteFile(fileName, []byte(output), 0644) + if err != nil { + return err + } + + return nil +}