Skip to content

Commit

Permalink
Refactor/update rubocop rspec (#178)
Browse files Browse the repository at this point in the history
* Add new cop as a duplicate until v3 is released

* Improve docs

* Remove redundant cop

* Add gemspec cop to ignore list
  • Loading branch information
luke-hill committed Oct 19, 2023
1 parent e734e02 commit 72a3b41
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
24 changes: 14 additions & 10 deletions .rubocop.yml
Expand Up @@ -13,7 +13,11 @@ AllCops:
TargetRubyVersion: 2.7
NewCops: enable

# We don't use MFA yet
# Document gem dependencies in the gemspec
Gemspec/DevelopmentDependencies:
Enabled: false

# Don't use MFA
Gemspec/RequireMFA:
Enabled: false

Expand All @@ -33,31 +37,31 @@ Metrics/MethodLength:
Naming/AccessorMethodName:
Enabled: false

# This will be present until v5 beta
Naming/MemoizedInstanceVariableName:
Exclude:
- 'lib/site_prism/page.rb'

# This is a single standardised transform
RSpec/SpecFilePathFormat:
CustomTransform:
RSpecMatchers: rspec_matchers

# This is a single standardised transform - DEPRECATED (Remove in rubocop-rspec v3)
RSpec/FilePath:
CustomTransform:
RSpecMatchers: rspec_matchers

# Stylistic preference to make the RSpec tests flow better
# Stylistic preference
RSpec/MessageSpies:
EnforcedStyle: receive

# We need to test the RSpec matcher is correctly calling the has_no method
# Test the RSpec matcher is correctly calling the `has_no` method
RSpec/MultipleExpectations:
Exclude:
- spec/site_prism/element_spec.rb

# We don't need to document any testing code
# Don't document any testing code
Style/Documentation:
Exclude:
- features/**/*

# This is a better style, and should be the default IMO
# Stylistic preference
Style/RegexpLiteral:
EnforcedStyle: slashes
AllowInnerSlashes: true
2 changes: 1 addition & 1 deletion site_prism.gemspec
Expand Up @@ -30,7 +30,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'rspec', ['~> 3.12']
s.add_development_dependency 'rubocop', '~> 1.57.1'
s.add_development_dependency 'rubocop-performance', '~> 1.19.0'
s.add_development_dependency 'rubocop-rspec', '~> 2.23.2'
s.add_development_dependency 'rubocop-rspec', '~> 2.24.0'
s.add_development_dependency 'selenium-webdriver', ['~> 4.7']
s.add_development_dependency 'simplecov', ['~> 0.21']
end

0 comments on commit 72a3b41

Please sign in to comment.