struct Ameba::Rule::Lint::UselessAssign
- Ameba::Rule::Lint::UselessAssign
- Ameba::Rule::Base
- Struct
- Value
- Object
Overview
A rule that disallows useless assignments.
For example, this is considered invalid:
def method
var = 1
do_something
end
And has to be written as the following:
def method
var = 1
do_something(var)
end
YAML configuration example:
Lint/UselessAssign:
Enabled: true
Defined in:
ameba/rule/lint/useless_assign.crConstant Summary
-
MSG =
"Useless assignment to variable `%s`"
Constructors
-
.new(config = nil)
A rule that disallows useless assignments.
Instance Method Summary
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 disallows useless assignments.
For example, this is considered invalid:
def method
var = 1
do_something
end
And has to be written as the following:
def method
var = 1
do_something(var)
end
YAML configuration example:
Lint/UselessAssign:
Enabled: true