mirror of
https://github.com/mgechev/revive.git
synced 2025-12-03 22:39:22 +02:00
Add test case for function-result-limit rule, and updated README
This commit is contained in:
@@ -269,7 +269,7 @@ List of all available rules. The rules ported from `golint` are left unchanged a
|
|||||||
| `constant-logical-expr` | n/a | Warns on constant logical expressions | no | no |
|
| `constant-logical-expr` | n/a | Warns on constant logical expressions | no | no |
|
||||||
| `bool-literal-in-expr`| n/a | Suggests removing Boolean literals from logic expressions | no | no |
|
| `bool-literal-in-expr`| n/a | Suggests removing Boolean literals from logic expressions | no | no |
|
||||||
| `redefines-builtin-id`| n/a | Warns on redefinitions of builtin identifiers | no | no |
|
| `redefines-builtin-id`| n/a | Warns on redefinitions of builtin identifiers | no | no |
|
||||||
| `function-result-limit` | int | Specifies the maximum number of arguments a function can return | no | no |
|
| `function-result-limit` | int | Specifies the maximum number of results a function can return | no | no |
|
||||||
|
|
||||||
## Available Formatters
|
## Available Formatters
|
||||||
|
|
||||||
|
|||||||
14
test/function-result-limit_test.go
Normal file
14
test/function-result-limit_test.go
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/mgechev/revive/lint"
|
||||||
|
"github.com/mgechev/revive/rule"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestFunctionResultsLimit(t *testing.T) {
|
||||||
|
testRule(t, "function-result-limit", &rule.FunctionResultsLimitRule{}, &lint.RuleConfig{
|
||||||
|
Arguments: []interface{}{int64(3)},
|
||||||
|
})
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user