Skip to content

Commit

Permalink
➕ Add rubocop-rspec
Browse files Browse the repository at this point in the history
  • Loading branch information
pboling committed Dec 17, 2022
1 parent 73dcc77 commit 6f24198
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 11 deletions.
5 changes: 4 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# We chose not to make these changes
inherit_from: .rubocop_todo.yml
inherit_from:
- .rubocop_todo.yml
- .rubocop_rspec.yml

inherit_gem:
rubocop-lts: rubocop-lts.yml

require:
- rubocop-md
- rubocop-rspec

# It's the lowest supported Ruby version
AllCops:
Expand Down
32 changes: 32 additions & 0 deletions .rubocop_rspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
RSpec/FilePath:
Enabled: false

RSpec/MultipleExpectations:
Enabled: false

RSpec/NamedSubject:
Enabled: false

RSpec/ExampleLength:
Enabled: false

RSpec/VerifiedDoubles:
Enabled: false

RSpec/MessageSpies:
Enabled: false

RSpec/InstanceVariable:
Enabled: false

RSpec/NestedGroups:
Enabled: false

RSpec/ExpectInHook:
Enabled: false

# NOTE: for many tests of equality `eql` works, while `be` does not, because
# expected #<Fixnum:...> => 101
# got #<BigDecimal:...> => 101.0 (0.101e3)
RSpec/BeEql:
Enabled: false
73 changes: 63 additions & 10 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2020-02-21 21:25:40 +0200 using RuboCop version 0.80.0.
# on 2022-12-16 17:45:21 -0700 using RuboCop version 0.81.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
Layout/ExtraSpacing:
Exclude:
- 'dynamoid.gemspec'

# Offense count: 1
# Cop supports --auto-correct.
Lint/OrderedMagicComments:
Expand All @@ -34,15 +27,75 @@ Naming/MemoizedInstanceVariableName:
Exclude:
- 'lib/dynamoid/dirty.rb'

# Offense count: 3
# Offense count: 13
RSpec/AnyInstance:
Exclude:
- 'spec/dynamoid/adapter_plugin/aws_sdk_v3_spec.rb'
- 'spec/dynamoid/adapter_spec.rb'
- 'spec/dynamoid/criteria/chain_spec.rb'
- 'spec/dynamoid/persistence_spec.rb'

# Offense count: 125
# Configuration parameters: Prefixes.
# Prefixes: when, with, without
RSpec/ContextWording:
Enabled: false

# Offense count: 2
RSpec/DescribeClass:
Exclude:
- 'spec/dynamoid/before_type_cast_spec.rb'
- 'spec/dynamoid/type_casting_spec.rb'

# Offense count: 4
# Configuration parameters: CustomIncludeMethods.
RSpec/EmptyExampleGroup:
Exclude:
- 'spec/dynamoid/persistence_spec.rb'
- 'spec/dynamoid/type_casting_spec.rb'

# Offense count: 8
RSpec/LeakyConstantDeclaration:
Exclude:
- 'spec/dynamoid/criteria/chain_spec.rb'
- 'spec/dynamoid/indexes_spec.rb'
- 'spec/dynamoid/sti_spec.rb'

# Offense count: 1
RSpec/LetSetup:
Exclude:
- 'spec/dynamoid/sti_spec.rb'

# Offense count: 2
RSpec/RepeatedDescription:
Exclude:
- 'spec/dynamoid/associations/belongs_to_spec.rb'

# Offense count: 2
RSpec/RepeatedExample:
Exclude:
- 'spec/dynamoid/associations/has_one_spec.rb'

# Offense count: 6
RSpec/RepeatedExampleGroupDescription:
Exclude:
- 'spec/dynamoid/adapter_plugin/aws_sdk_v3_spec.rb'
- 'spec/dynamoid/finders_spec.rb'

# Offense count: 9
RSpec/SubjectStub:
Exclude:
- 'spec/dynamoid/adapter_spec.rb'

# Offense count: 2
Style/CommentedKeyword:
Exclude:
- 'lib/dynamoid/dirty.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, Autocorrect.
# SupportedStyles: module_function, extend_self
# SupportedStyles: module_function, extend_self, forbidden
Style/ModuleFunction:
Exclude:
- 'lib/dynamoid.rb'
Expand Down
1 change: 1 addition & 0 deletions dynamoid.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,6 @@ Gem::Specification.new do |spec|
# 'rubocop-lts' is for Ruby 2.3+, see https://rubocop-lts.gitlab.io/
spec.add_development_dependency 'rubocop-lts', '~> 10.0'
spec.add_development_dependency 'rubocop-md'
spec.add_development_dependency 'rubocop-rspec'
spec.add_development_dependency 'yard'
end

0 comments on commit 6f24198

Please sign in to comment.