lib/radiator/type/amount.rb
Missing top-level class documentation comment. Open
Open
class Amount < Hive::Type::Amount
- Read upRead up
- Exclude checks
This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.
The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.
Example:
# bad
class Person
# ...
end
# good
# Description/Explanation of Person class
class Person
# ...
end
Line is too long. [120/80] Open
Open
warn "[DEPRECATED] Using Radiator::Type::Amount class provided is deprecated. Please use: Hive::Type::Amount"
- Exclude checks
Line is too long. [104/80] Open
Open
# @deprecated Using Radiator::Type::Amount class provided is deprecated. Please use: Hive::Type::Amount
- Exclude checks
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
Open
warn "[DEPRECATED] Using Radiator::Type::Amount class provided is deprecated. Please use: Hive::Type::Amount"
- Read upRead up
- Exclude checks
Checks if uses of quotes match the configured preference.
Example: EnforcedStyle: single_quotes (default)
# bad
"No special symbols"
"No string interpolation"
"Just text"
# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"
Example: EnforcedStyle: double_quotes
# bad
'Just some text'
'No special chars or interpolation'
# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"
Trailing whitespace detected. Open
Open
- Exclude checks
Use a guard clause instead of wrapping the code inside a conditional expression. Open
Open
unless defined? @@deprecated_warning_shown
- Read upRead up
- Exclude checks
Use a guard clause instead of wrapping the code inside a conditional expression
Example:
# bad
def test
if something
work
end
end
# good
def test
return unless something
work
end
# also good
def test
work if something
end
# bad
if something
raise 'exception'
else
ok
end
# good
raise 'exception' if something
ok
Replace class var @@deprecated_warning_shown with a class instance var. Open
Open
@@deprecated_warning_shown = true
- Read upRead up
- Exclude checks
This cop checks for uses of class variables. Offenses are signaled only on assignment to class variables to reduce the number of offenses that would be reported.