Ameba::Rule::Style::LargeNumbers
Inherits Ameba::AST::Util < YAML::Serializable < Ameba::Rule::Base < Ameba::Config::RuleConfig < Reference < Object
A rule that disallows usage of large numbers without underscore. These do not affect the value of the number, but can help read large numbers more easily.
For example, these are considered invalid:
100000
141592654
5.123456
And has to be rewritten as the following:
100_000
141_592_654
5.123_456
YAML configuration example:
Style/LargeNumbers:
Enabled: true
IntMinDigits: 6 # i.e. integers higher than 99999
Constants
Constructors
A rule that disallows usage of large numbers without underscore. These do not affect the value of the number, but can help read large numbers more easily.
For example, these are considered invalid:
100000
141592654
5.123456
And has to be rewritten as the following:
100_000
141_592_654
5.123_456
YAML configuration example:
Style/LargeNumbers:
Enabled: true
IntMinDigits: 6 # i.e. integers higher than 99999
Class methods
Returns true if this rule is deprecated, false otherwise.
Returns the deprecation reason for this rule, if there is any.
Returns the documentation URL for this rule.
Ameba::Rule::Lint::Syntax.documentation_url
# => "https://crystal-ameba.org/api/master/Ameba/Rule/Lint/Syntax.html"
Returns the documentation for this rule, if there is any.
module Ameba
# This is a test rule.
# Does nothing.
class Rule::MyRule < Rule::Base
def test(source)
end
end
end
Ameba::Rule::MyRule.parsed_doc # => "This is a test rule.\nDoes nothing."