Missing top-level class documentation comment. Open
class Blitz
- 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
The name of this source file (motion-blitz.rb
) should use snake_case. Open
module Motion
- Read upRead up
- Exclude checks
This cop makes sure that Ruby source files have snake_case names. Ruby scripts (i.e. source files with a shebang in the first line) are ignored.
Example:
# bad
lib/layoutManager.rb
anything/usingCamelCase
# good
lib/layout_manager.rb
anything/using_snake_case.rake
Use only ascii symbols in comments. Open
# blitz (fl•ash), verb
- Read upRead up
- Exclude checks
This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).
Example:
# bad
# Translates from English to 日本語。
# good
# Translates from English to Japanese
Freeze mutable objects assigned to constants. Open
MASKS = {
none: SVProgressHUDMaskTypeNone,
clear: SVProgressHUDMaskTypeClear,
black: SVProgressHUDMaskTypeBlack,
gradient: SVProgressHUDMaskTypeGradient
- Read upRead up
- Exclude checks
This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).
Example:
# bad
CONST = [1, 2, 3]
# good
CONST = [1, 2, 3].freeze
Line is too long. [97/80] Open
raise ArgumentError, "mask must be one of #{MASKS.keys}" unless MASKS.keys.include?(mask)
- Exclude checks
Line is too long. [90/80] Open
hud_class.showProgress(progress, status: message_or_mask, maskType: MASKS[mask])
- Exclude checks