Showing 1,556 of 1,556 total issues
end
at 42, 1 is not aligned with CarrierWave.configure do |config|
at 1, 0. Open
end
- Read upRead up
- Exclude checks
This cop checks whether the end keywords are aligned properly for do end blocks.
Three modes are supported through the EnforcedStyleAlignWith
configuration parameter:
start_of_block
: the end
shall be aligned with the
start of the line where the do
appeared.
start_of_line
: the end
shall be aligned with the
start of the line where the expression started.
either
(which is the default) : the end
is allowed to be in either
location. The autofixer will default to start_of_line
.
Example: EnforcedStyleAlignWith: either (default)
# bad
foo.bar
.each do
baz
end
# good
variable = lambda do |i|
i
end
Example: EnforcedStyleAlignWith: startofblock
# bad
foo.bar
.each do
baz
end
# good
foo.bar
.each do
baz
end
Example: EnforcedStyleAlignWith: startofline
# bad
foo.bar
.each do
baz
end
# good
foo.bar
.each do
baz
end
Do not use spaces inside percent literal delimiters. Open
Rails.application.config.assets.precompile += %w( html5shiv.js html5shiv-printshiv.js )
- Read upRead up
- Exclude checks
Checks for unnecessary additional spaces inside the delimiters of %i/%w/%x literals.
Example:
# good
%i(foo bar baz)
# bad
%w( foo bar baz )
# bad
%x( ls -l )
Line is too long. [85/80] Open
# :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
- Exclude checks
Line is too long. [91/80] Open
# in this configuration, which is recommended due to some quirks from different browsers.
- Exclude checks
%w
-literals should be delimited by [
and ]
. Open
Rails.application.config.assets.precompile += %w( html5shiv.js html5shiv-printshiv.js )
- Read upRead up
- Exclude checks
This cop enforces the consistent usage of %
-literal delimiters.
Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.
Example:
# Style/PercentLiteralDelimiters:
# PreferredDelimiters:
# default: '[]'
# '%i': '()'
# good
%w[alpha beta] + %i(gamma delta)
# bad
%W(alpha #{beta})
# bad
%I(alpha beta)
Line is too long. [87/80] Open
# Tell browsers whether to use the native HTML5 validations (novalidate form option).
- Exclude checks
Use 2 (not 3) spaces for indentation. Open
config.asset_host = 'https://s3.us-west-2.amazonaws.com/fae-engine-test-fly'
- Read upRead up
- Exclude checks
This cops checks for indentation that doesn't use the specified number of spaces.
See also the IndentationConsistency cop which is the companion to this one.
Example:
# bad
class A
def test
puts 'hello'
end
end
# good
class A
def test
puts 'hello'
end
end
Example: IgnoredPatterns: ['^\s*module']
# bad
module A
class B
def test
puts 'hello'
end
end
end
# good
module A
class B
def test
puts 'hello'
end
end
end
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
Time::DATE_FORMATS[:default] = "%b %d, %Y %I:%M%P"
- 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"
Line is too long. [83/80] Open
# :time = Re-enables login after a certain amount of time (see :unlock_in below)
- Exclude checks
Final newline missing. Open
Rails.application.config.assets.precompile += %w( html5shiv.js html5shiv-printshiv.js )
- Exclude checks
Final newline missing. Open
Time::DATE_FORMATS[:filename] = "%Y%m%d%H%M%S"
- Exclude checks
Extra empty line detected at block body beginning. Open
mount Judge::Engine => '/judge'
- Read upRead up
- Exclude checks
This cops checks if empty lines around the bodies of blocks match the configuration.
Example: EnforcedStyle: empty_lines
# good
foo do |bar|
# ...
end
Example: EnforcedStyle: noemptylines (default)
# good
foo do |bar|
# ...
end
Use %i
or %I
for an array of symbols. Open
match "*path" => 'pages#error404', via: [:get, :post]
- Read upRead up
- Exclude checks
This cop can check for array literals made up of symbols that are not using the %i() syntax.
Alternatively, it checks for symbol arrays using the %i() syntax on projects which do not want to use that syntax.
Configuration option: MinSize
If set, arrays with fewer elements than this value will not trigger the
cop. For example, a MinSize of
3` will not enforce a style on an array
of 2 or fewer elements.
Example: EnforcedStyle: percent (default)
# good
%i[foo bar baz]
# bad
[:foo, :bar, :baz]
Example: EnforcedStyle: brackets
# good
[:foo, :bar, :baz]
# bad
%i[foo bar baz]
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
devise_for :users, class_name: "Fae::User", module: :devise, skip: [:sessions]
- 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"
TODO found Open
/ TODO: support 5th level?
- Exclude checks
TODO found Open
# TODO - can we remove this/do we need backwards compaitibility?
- Exclude checks