class RuboCop::Cop::Naming::MethodParameterName
end
do_stuff(age_a, height_b, gender_c)
def baz(age_a, height_b, gender_c)
end
speed * distance
def foo(speed, distance)
end
thud + fred
def bar(thud, fred)
# good
end
do_stuff(a, b, c)
def baz(a, b, c)
# With ‘MinNameLength` set to number greater than 1
end
num1 * num2
def foo(num1, num2)
# With `AllowNamesEndingInNumbers` set to false
end
varOne + varTwo
def bar(varOne, varTwo)
# bad
@example
restricted names that will always register an offense.
offense. The `ForbiddenNames` config option takes an array of
takes an array of permitted names that will never register an
numbers. Its default is false. The `AllowedNames` config option
set to false, this cop will register offenses for names ending with
The `AllowNamesEndingInNumbers` config option takes a boolean. When
the minimum amount of characters the name must be. Its default is 3.
The `MinNameLength` config option takes an integer. It represents
are. It is highly configurable.
Checks method parameter names for how descriptive they
def on_def(node)
def on_def(node) return unless node.arguments? check(node, node.arguments) end