Newer
Older
# TODO: Enable RedundantMatch Cop.
# Use `=~` instead of `String#match` or `Regexp#match` in a context where the
# returned `MatchData` is not needed.
Performance/RedundantMatch:
Enabled: false
# TODO: Enable RedundantMerge Cop.
# Use `Hash#[]=`, rather than `Hash#merge!` with a single key-value pair.
Performance/RedundantMerge:
# Max number of key-value pairs to consider an offense
MaxKeyValuePairs: 2
Enabled: false
# Use `sort` instead of `sort_by { |x| x }`.
Performance/RedundantSortBy:
# Use `start_with?` instead of a regex match anchored to the beginning of a
# string.
Performance/StartWith:
# Use `tr` instead of `gsub` when you are replacing the same number of
# characters. Use `delete` instead of `gsub` when you are deleting
# characters.
Performance/StringReplacement:
# Checks for `.times.map` calls.
Performance/TimesMap:
##################### Rails ##################################
# Enables Rails cops.
Rails:
Enabled: true
# Enforces consistent use of action filter methods.
Rails/ActionFilter:
# Checks the correct usage of date aware methods, such as `Date.today`,
# `Date.current`, etc.
# Prefer delegate method for delegations.
Rails/Delegate:
Enabled: false
# Prefer `find_by` over `where.first`.
Rails/FindBy:
# Prefer `all.find_each` over `all.find`.
Rails/FindEach:
# Prefer has_many :through to has_and_belongs_to_many.
Rails/HasAndBelongsToMany:
# Checks for calls to puts, print, etc.
Rails/Output:
# Checks for incorrect grammar when using methods like `3.day.ago`.
Rails/PluralizationGrammar:
# Checks for `read_attribute(:attr)` and `write_attribute(:attr, val)`.
Rails/ReadWriteAttribute:
Enabled: false
# Checks the arguments of ActiveRecord scopes.
Rails/ScopeArgs:
# Checks the correct usage of time zone aware methods.
# http://danilenko.org/2012/7/6/rails_timezones
Rails/TimeZone:
Enabled: false
# Use validates :attribute, hash of validations.
Rails/Validation:
Enabled: false
Rails/UniqBeforePluck:
Enabled: false
##################### RSpec ##################################
# Check that instances are not being stubbed globally.
# Check that the first argument to the top level describe is the tested class or
# module.
# Use `described_class` for tested class / module.
# Checks that the second argument to top level describe is the tested method
# name.
# Checks for long example.
RSpec/ExampleLength:
Enabled: false
Max: 5
# Do not use should when describing your tests.
RSpec/ExampleWording:
Enabled: false
CustomTransform:
be: is
have: has
not: does not
IgnoredWords: []
# Checks the file and folder naming of the spec file.
RSpec/FilePath:
Enabled: false
CustomTransform:
RuboCop: rubocop
RSpec: rspec
# Checks if there are focused specs.
# Checks for the usage of instance variables.
# Checks for multiple top-level describes.
# Enforces the usage of the same method on all negative message expectations.
# Prefer using verifying doubles over normal doubles.