struct Ameba::Rule::Lint::PercentArrays
- Ameba::Rule::Lint::PercentArrays
- Ameba::Rule::Base
- Struct
- Value
- Object
Overview
A rule that disallows some unwanted symbols in percent array literals.
For example, this is usually written by mistake:
%i(:one, :two)
%w("one", "two")
And the expected example is:
%i(one two)
%w(one two)
YAML configuration example:
Lint/PercentArrays:
Enabled: true
StringArrayUnwantedSymbols: ',"'
SymbolArrayUnwantedSymbols: ',:'
Defined in:
ameba/rule/lint/percent_array.crConstant Summary
-
MSG =
"Symbols `%s` may be unwanted in %s array literals"
Constructors
-
.new(config = nil)
A rule that disallows some unwanted symbols in percent array literals.
Instance Method Summary
Instance methods inherited from struct Ameba::Rule::Base
catch(source : Source)
catch,
excluded?(source)
excluded?,
group
group,
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 some unwanted symbols in percent array literals.
For example, this is usually written by mistake:
%i(:one, :two)
%w("one", "two")
And the expected example is:
%i(one two)
%w(one two)
YAML configuration example:
Lint/PercentArrays:
Enabled: true
StringArrayUnwantedSymbols: ',"'
SymbolArrayUnwantedSymbols: ',:'