mirror of
https://github.com/mgechev/revive.git
synced 2025-07-07 00:35:38 +02:00
better messages for rules' config errors (#563)
This commit is contained in:
@ -12,9 +12,7 @@ type FunctionResultsLimitRule struct{}
|
||||
|
||||
// Apply applies the rule to given file.
|
||||
func (r *FunctionResultsLimitRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure {
|
||||
if len(arguments) != 1 {
|
||||
panic(`invalid configuration for "function-result-limit"`)
|
||||
}
|
||||
checkNumberOfArguments(1, arguments, r.Name())
|
||||
|
||||
max, ok := arguments[0].(int64) // Alt. non panicking version
|
||||
if !ok {
|
||||
|
Reference in New Issue
Block a user