Showing 1,556 of 1,556 total issues
Line is too long. [151/80] Open
template "views/static_page_form.html.#{options.template}", "app/views/#{options.namespace}/content_blocks/#{file_name}.html.#{options.template}"
- Exclude checks
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
init_source = options.fine ? "../templates/initializers/fae_fine.rb" : "../templates/initializers/fae.rb"
- 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"
Do not use space inside array brackets. Open
config.unlock_keys = [ :email ]
- Read upRead up
- Exclude checks
Checks that brackets used for array literals have or don't have surrounding space depending on configuration.
Example: EnforcedStyle: space
# The `space` style enforces that array literals have
# surrounding space.
# bad
array = [a, b, c, d]
# good
array = [ a, b, c, d ]
Example: EnforcedStyle: no_space
# The `no_space` style enforces that array literals have
# no surrounding space.
# bad
array = [ a, b, c, d ]
# good
array = [a, b, c, d]
Example: EnforcedStyle: compact
# The `compact` style normally requires a space inside
# array brackets, with the exception that successive left
# or right brackets are collapsed together in nested arrays.
# bad
array = [ a, [ b, c ] ]
# good
array = [ a, [ b, c ]]
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
inject_into_file "config/initializers/fae.rb", after: "Fae.setup do |config|\n" do <<-RUBY
- 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"
Unused method argument - block
. If it's necessary, use _
or _block
as an argument name to indicate that it won't be used. You can also write as setup(*)
if you want the method to accept any arguments but don't care about them. Open
def self.setup(&block)
- Read upRead up
- Exclude checks
This cop checks for unused method arguments.
Example:
# bad
def some_method(used, unused, _unused_but_allowed)
puts used
end
Example:
# good
def some_method(used, _unused, _unused_but_allowed)
puts used
end
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
template "graphql/graphql_page_type.rb", "app/graphql/types/#{file_name}_page_type.rb"
- 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. [82/80] Open
# a value less than 10 in other environments. Note that, for bcrypt (the default
- Exclude checks
Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem pry
should appear before rspec-rails
. Open
gem 'pry'
- Read upRead up
- Exclude checks
Gems should be alphabetically sorted within groups.
Example:
# bad
gem 'rubocop'
gem 'rspec'
# good
gem 'rspec'
gem 'rubocop'
# good
gem 'rubocop'
gem 'rspec'
# good only if TreatCommentsAsGroupSeparators is true
# For code quality
gem 'rubocop'
# For tests
gem 'rspec'
Extra empty line detected at class body end. Open
end
- Read upRead up
- Exclude checks
This cops checks if empty lines around the bodies of classes match the configuration.
Example: EnforcedStyle: empty_lines
# good
class Foo
def bar
# ...
end
end
Example: EnforcedStyle: emptylinesexcept_namespace
# good
class Foo
class Bar
# ...
end
end
Example: EnforcedStyle: emptylinesspecial
# good
class Foo
def bar; end
end
Example: EnforcedStyle: noemptylines (default)
# good
class Foo
def bar
# ...
end
end
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
- 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"
%W
-literals should be delimited by [
and ]
. Open
config.eager_load_paths += %W(#{config.root}/app)
- 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. [85/80] Open
# find_for_authentication method and considered in your model lookup. For instance,
- Exclude checks
Line is too long. [85/80] Open
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
- Exclude checks
Line is too long. [83/80] Open
# a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
- Exclude checks
Align the parameters of a method call if they span more than one line. Open
user: 'fae',
roles: %w{web app db},
port: 8022,
ssh_options: {
forward_agent: true
- Read upRead up
- Exclude checks
Here we check if the parameters on a multi-line method call or definition are aligned.
Example: EnforcedStyle: withfirstparameter (default)
# good
foo :bar,
:baz
# bad
foo :bar,
:baz
Example: EnforcedStyle: withfixedindentation
# good
foo :bar,
:baz
# bad
foo :bar,
:baz
Line is too long. [82/80] Open
# Turn scoped views on. Before rendering "sessions/new", it will first check for
- Exclude checks
Line is too long. [86/80] Open
# initial account confirmation) to be applied. Requires additional unconfirmed_email
- Exclude checks
Line is too long. [87/80] Open
# Allow you to use another encryption algorithm besides bcrypt (default). You can use
- Exclude checks
Line is too long. [93/80] Open
# To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
- Exclude checks
Line is too long. [120/80] Open
match 'content_blocks/:slug/update' => '/admin/content_blocks#update', via: [:put, :patch], as: 'update_content_block'
- Exclude checks