Showing 235 of 235 total issues
Use only ascii symbols in comments. (https://github.com/bbatsov/ruby-style-guide#english-comments) Open
# # => #<User id: 1, first_name: "Penélope", last_name: nil>
- 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
Add an empty line after magic comments. (https://github.com/bbatsov/ruby-style-guide#separate-magic-comments-from-code) Open
source "https://rubygems.org"
- Read upRead up
- Exclude checks
Checks for a newline after the final magic comment.
Example:
# good
# frozen_string_literal: true
# Some documentation for Person
class Person
# Some code
end
# bad
# frozen_string_literal: true
# Some documentation for Person
class Person
# Some code
end
Add an empty line after magic comments. (https://github.com/bbatsov/ruby-style-guide#separate-magic-comments-from-code) Open
module ActiveMocker
- Read upRead up
- Exclude checks
Checks for a newline after the final magic comment.
Example:
# good
# frozen_string_literal: true
# Some documentation for Person
class Person
# Some code
end
# bad
# frozen_string_literal: true
# Some documentation for Person
class Person
# Some code
end
Unused method argument - arguments
. (https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars) Open
def call_mock_method(method:, caller:, arguments: [])
- 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
Rename is_of
to of?
. (https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark) Open
def is_of(conditions = {})
- Read upRead up
- Exclude checks
This cop makes sure that predicates are named properly.
Example:
# bad
def is_even?(value)
end
# good
def even?(value)
end
# bad
def has_value?
end
# good
def value?
end
Use only ascii symbols in comments. (https://github.com/bbatsov/ruby-style-guide#english-comments) Open
# UserMock.find_or_create_by(first_name: 'Penélope')
- 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
Add an empty line after magic comments. (https://github.com/bbatsov/ruby-style-guide#separate-magic-comments-from-code) Open
module ActiveMocker
- Read upRead up
- Exclude checks
Checks for a newline after the final magic comment.
Example:
# good
# frozen_string_literal: true
# Some documentation for Person
class Person
# Some code
end
# bad
# frozen_string_literal: true
# Some documentation for Person
class Person
# Some code
end
Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem appraisal
should appear before sqlite3
. Open
gem "appraisal"
- 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'
Add an empty line after magic comments. (https://github.com/bbatsov/ruby-style-guide#separate-magic-comments-from-code) Open
require "active_mocker/inspectable/bigdecimal"
- Read upRead up
- Exclude checks
Checks for a newline after the final magic comment.
Example:
# good
# frozen_string_literal: true
# Some documentation for Person
class Person
# Some code
end
# bad
# frozen_string_literal: true
# Some documentation for Person
class Person
# Some code
end
Line is too long. [124/120] (https://github.com/bbatsov/ruby-style-guide#80-character-limits) Open
# @param [Array<Symbol, String, ActiveMocker::Mock>] args an array of ActiveRecord Model Names as Strings or Symbols
- Exclude checks
Line is too long. [124/120] (https://github.com/bbatsov/ruby-style-guide#80-character-limits) Open
def initialize(parsed_source:, klasses_to_be_mocked:, mock_append_name:, active_record_base_klass: ::ActiveRecord::Base)
- Exclude checks
When defining the ==
operator, name its argument other
. (https://github.com/bbatsov/ruby-style-guide#other-arg) Open
def ==(val)
- Read upRead up
- Exclude checks
This cop makes sure that certain binary operator methods have their
sole parameter named other
.
Example:
# bad
def +(amount); end
# good
def +(other); end
Line is too long. [128/120] (https://github.com/bbatsov/ruby-style-guide#80-character-limits) Open
# Returns +true+ if the specified +attribute+ has been set and is neither +nil+ nor <tt>empty?</tt> (the latter only applies
- Exclude checks
Rename has_attribute?
to attribute?
. (https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark) Open
def has_attribute?(attr_name)
- Read upRead up
- Exclude checks
This cop makes sure that predicates are named properly.
Example:
# bad
def is_even?(value)
end
# good
def even?(value)
end
# bad
def has_value?
end
# good
def value?
end
Use only ascii symbols in comments. (https://github.com/bbatsov/ruby-style-guide#english-comments) Open
# UserMock.find_or_create_by(first_name: 'Penélope')
- 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