When using ActiveSupport's number pluralization, proper aliases should be used for readablity. For example,
1.day.ago, while equivalent to
1.days.ago, does not make grammatical sense.
Do not put a space between method name and left parenthesis, it makes the code ambiguous to read.
The referer from the
request object should be accessed in a consistent way throughout the codebase. By default, this issue is raised when
referrer is used. However, it can be configured to raise this issue on usage of
By default, this issue is raised when using
try! in place of
try can be detected, too, if configured in
.rubocop.yml. For example, if
try is detected too
def self.method_name or
class << self to define class methods is recommended.
Access group modifiers should be declared as a group.
A block accepting version of the method can be used that does automatic resource cleanup.
The use of
%x must be avoided unless a command is to be invoked with backquotes in it (which is rather unlikely).
The annotation keyword is followed by a colon and a space, then a note describing the problem. Supported keywords are
Comments, when put on the same line as some keywords (
module), cause this issue.
__dir__to get an absolute path to the current file's directory RB-ST1030
#__dir__ method can replace more complex constructs to retrieve a canonicalized absolute path to the current file.
end of empty method definitions on the next line. A method definition is not considered empty if it contains comments.