Skip to content

Commit 57babd5

Browse files
committed
Add rubocop-rspec extension
This commit adds the rubocop-rspec extension to Puppet's Gemfile and Rubocop configuration file, pinning it at 2.10.0 as it's the last version to support Ruby 2.5 (which the rest of our Rubocop configuration is set up to support). This work includes explicitly adding all pending RSpec cops to the Rubocop config file and enabling them.
1 parent 30c0d22 commit 57babd5

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

.rubocop.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ require:
44
- rubocop-i18n
55
- rubocop-performance
66
- rubocop-rake
7+
- rubocop-rspec
78

89
AllCops:
910
TargetRubyVersion: 2.5
@@ -174,3 +175,27 @@ Performance/RedundantSortBlock: # new in 1.7
174175

175176
Performance/ReverseFirst: # new in 1.7
176177
Enabled: true
178+
179+
RSpec/BeEq: # new in 2.9.0
180+
Enabled: true
181+
182+
RSpec/BeNil: # new in 2.9.0
183+
Enabled: true
184+
185+
RSpec/ExcessiveDocstringSpacing: # new in 2.5
186+
Enabled: true
187+
188+
RSpec/IdenticalEqualityAssertion: # new in 2.4
189+
Enabled: true
190+
191+
RSpec/SubjectDeclaration: # new in 2.5
192+
Enabled: true
193+
194+
RSpec/VerifiedDoubleReference: # new in 2.10.0
195+
Enabled: true
196+
197+
RSpec/FactoryBot/SyntaxMethods: # new in 2.7
198+
Enabled: true
199+
200+
RSpec/Rails/AvoidSetupHook: # new in 2.4
201+
Enabled: true

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ group(:test) do
5151
gem 'rubocop-i18n', '~> 3.0', require: false, platforms: [:ruby]
5252
gem 'rubocop-performance', '1.13.3', require: false, platforms: [:ruby]
5353
gem 'rubocop-rake', '0.6.0', require: false, platforms: [:ruby]
54+
gem 'rubocop-rspec', '2.10.0', require: false, platforms: [:ruby]
5455
end
5556

5657
group(:development, optional: true) do

0 commit comments

Comments
 (0)