struct Ameba::Rule::Lint::UnusedArgument
- Ameba::Rule::Lint::UnusedArgument
- Ameba::Rule::Base
- Struct
- Value
- Object
Overview
A rule that reports unused arguments. For example, this is considered invalid:
def method(a, b, c)
a + b
end
and should be written as:
def method(a, b)
a + b
end
YAML configuration example:
Lint/UnusedArgument:
Enabled: true
IgnoreDefs: true
IgnoreBlocks: false
IgnoreProcs: false
Defined in:
ameba/rule/lint/unused_argument.crConstant Summary
-
MSG =
"Unused argument `%s`. If it's necessary, use `%s` as an argument name to indicate that it won't be used."
Constructors
-
.new(config = nil)
A rule that reports unused arguments.
Instance Method Summary
- #test(source, node : Crystal::ProcLiteral, scope : AST::Scope)
- #test(source, node : Crystal::Block, scope : AST::Scope)
- #test(source, node : Crystal::Def, scope : AST::Scope)
- #test(source)
Instance methods inherited from struct Ameba::Rule::Base
==(other)
==,
catch(source : Source)
catch,
excluded?(source)
excluded?,
group
group,
hash
hash,
initialize
initialize,
name
name,
special?
special?,
test(source : Source, node : Crystal::ASTNode, *opts)test(source : Source) test
Constructor methods inherited from struct Ameba::Rule::Base
new
new
Class methods inherited from struct Ameba::Rule::Base
parsed_doc
parsed_doc
Constructor Detail
def self.new(config = nil)
#
A rule that reports unused arguments. For example, this is considered invalid:
def method(a, b, c)
a + b
end
and should be written as:
def method(a, b)
a + b
end
YAML configuration example:
Lint/UnusedArgument:
Enabled: true
IgnoreDefs: true
IgnoreBlocks: false
IgnoreProcs: false