Ameba::Rule::Documentation::Admonition
Inherits Ameba::AST::Util < YAML::Serializable < Ameba::Rule::Base < Ameba::Config::RuleConfig < Reference < Object
A rule that reports documentation admonitions.
Optionally, these can fail at an appropriate time.
def get_user(id)
# TODO(2024-04-24) Fix this hack when the database migration is complete
if id < 1_000_000
v1_api_call(id)
else
v2_api_call(id)
end
end
TODO comments are used to remind yourself of source code related things.
The premise here is that TODO should be dealt with in the near future
and are therefore reported by Ameba.
FIXME comments are used to indicate places where source code needs fixing.
The premise here is that FIXME should indeed be fixed as soon as possible
and are therefore reported by Ameba.
YAML configuration example:
Documentation/Admonition:
Enabled: true
Admonitions: [TODO, FIXME, BUG]
Timezone: UTC
Constants
Constructors
A rule that reports documentation admonitions.
Optionally, these can fail at an appropriate time.
def get_user(id)
# TODO(2024-04-24) Fix this hack when the database migration is complete
if id < 1_000_000
v1_api_call(id)
else
v2_api_call(id)
end
end
TODO comments are used to remind yourself of source code related things.
The premise here is that TODO should be dealt with in the near future
and are therefore reported by Ameba.
FIXME comments are used to indicate places where source code needs fixing.
The premise here is that FIXME should indeed be fixed as soon as possible
and are therefore reported by Ameba.
YAML configuration example:
Documentation/Admonition:
Enabled: true
Admonitions: [TODO, FIXME, BUG]
Timezone: UTC
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."