Showing 1,727 of 1,727 total issues
Inconsistent indentation detected. Open
def error_message
options[:message] || "is not valid"
end
- Read upRead up
- Exclude checks
This cops checks for inconsistent indentation.
Example:
class A
def test
puts 'hello'
puts 'world'
end
end
Missing magic comment # frozen_string_literal: true
. Open
#!/usr/bin/env ruby
- Read upRead up
- Exclude checks
This cop is designed to help upgrade to Ruby 3.0. It will add the
comment # frozen_string_literal: true
to the top of files to
enable frozen string literals. Frozen string literals may be default
in Ruby 3.0. The comment will be added below a shebang and encoding
comment. The frozen string literal comment is only valid in Ruby 2.3+.
Example: EnforcedStyle: when_needed (default)
# The `when_needed` style will add the frozen string literal comment
# to files only when the `TargetRubyVersion` is set to 2.3+.
# bad
module Foo
# ...
end
# good
# frozen_string_literal: true
module Foo
# ...
end
Example: EnforcedStyle: always
# The `always` style will always add the frozen string literal comment
# to a file, regardless of the Ruby version or if `freeze` or `<<` are
# called on a string literal.
# bad
module Bar
# ...
end
# good
# frozen_string_literal: true
module Bar
# ...
end
Example: EnforcedStyle: never
# The `never` will enforce that the frozen string literal comment does
# not exist in a file.
# bad
# frozen_string_literal: true
module Baz
# ...
end
# good
module Baz
# ...
end
Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem pg_search
should appear before sucker_punch
. Open
gem 'pg_search', '~> 2.1', '>= 2.1.2'
- 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'
Avoid vendor prefixes. Open
-webkit-box-sizing: border-box;
- Exclude checks
0.032
should be written without a leading zero as .032
Open
background: linear-gradient(rgba(75, 12, 178, 0.0095), rgba(75, 12, 178, 0.032));
- Exclude checks
Color literals like rgba(0, 0, 0, 0.35)
should only be used in variable declarations; they should be referred to via variable everywhere else. Open
text-shadow: 1px 1px 0 rgba(0, 0, 0, .35);
- Exclude checks
Shorthand form for property padding
should be written more concisely as .5rem .5rem .31rem
instead of .5rem .5rem .31rem .5rem
Open
padding: .5rem .5rem .31rem .5rem;
- Exclude checks
Properties should be ordered border-bottom, font-size, line-height, padding Open
padding: 1.5rem 3rem;
- Exclude checks
Properties should be ordered border-bottom-right-radius, border-top-right-radius Open
border-top-right-radius: $box-radius !important;
- Exclude checks
0.5
should be written without a leading zero as .5
Open
margin-bottom: 0.5rem;
- Exclude checks
Selector event-box__attending
should be written in lowercase with hyphens Open
.event-box__attending {
- Exclude checks
Selector event-box-big__data
should be written in lowercase with hyphens Open
.event-box-big__data {
- Exclude checks
0.15
should be written without a leading zero as .15
Open
border: 1px solid rgba(0, 0, 0, 0.15);
- Exclude checks
Selector user-box__image
should be written in lowercase with hyphens Open
.user-box__image {
- Exclude checks
Expected item on line 74 to appear before line 71. Rule sets should be ordered as follows: @extends
, @includes
without @content
, properties, @includes
with @content
, nested rule sets Open
@include section-borders;
- Exclude checks
Properties should be ordered padding-bottom, padding-top Open
padding-top: 4rem;
- Exclude checks
Color literals like #dee0e3
should only be used in variable declarations; they should be referred to via variable everywhere else. Open
border: 1px solid #dee0e3;
- Exclude checks
Properties should be ordered padding-bottom, padding-top Open
padding-top: .5rem;
- Exclude checks
Inconsistent indentation detected. Open
def updated_data
@_updated_data ||= @event.updated_fields.keys.map do |field_name|
simplified_name_for field_name
end
end
- Read upRead up
- Exclude checks
This cops checks for inconsistent indentation.
Example:
class A
def test
puts 'hello'
puts 'world'
end
end
Missing top-level class documentation comment. Open
class EmailValidator < ActiveModel::EachValidator
- 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