makandra-rubocop 12.0.0 → 13.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79beba1f37780c5fdd06ca858be609a0fdb334082583c5010c6c13fda823d182
4
- data.tar.gz: 29a8b15c82b85bee38a43b3463543f21b42097f260500958174cbe20e60ca6dd
3
+ metadata.gz: '038d3a8e8094762ce14bfab35f4c9661e96ff05c307cf84a55b4e20e058d5428'
4
+ data.tar.gz: caa68f4bb5c4d6766bfbb30336284ccb9d4b1d3606effe2dfd7cc4a47540f1a1
5
5
  SHA512:
6
- metadata.gz: 27cc802a7880b20c4939365555330011650d5a08a5f2930916d488b6ce38dd1d50a5bf6ac11e0cdd590774a048b25ec4c859af47a331a99d30623461dec72c26
7
- data.tar.gz: 2ed94b16a50c26fea91cb16aa55182a7f4f983ab1eaf0826f97e8cbdf6524292492138f61789f4c2bf01c6ff202c290f20d745533601112c455aef197f8c2001
6
+ metadata.gz: 9998756e689b5ca1ced689b5ba5a73c26dbfc7301fd3cc48372b54a97fddaf4de2e9f453ca09d156e4b55d070e5d208c6a8d27a0b45d007a7fde8353817471c3
7
+ data.tar.gz: 2d086403fe97c553ead31ad0991d247862a869e8e9bb3d68e89aae2788f34cd85d8e8190df2b53cf11ec829fdcbb3ad695d97815dbec28e2e85be2575d86d2ec
data/CHANGELOG.md CHANGED
@@ -9,8 +9,30 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
9
9
  ### Compatible changes
10
10
 
11
11
 
12
+ ## 13.0.0 - 2024-05-27
13
+
14
+ ### Compatible changes
15
+
16
+ ### Breaking changes
17
+
18
+ - Upgrade to `rubocop-rspec` 2.25.0 (was 2.13.2)
19
+ - Disable nested cops introduced by dependencies (e.g. Rspec/Capybara).
20
+ Since the config for the respective gem should be considered the single source of truth
21
+
22
+
23
+ ## 12.1.0 - 2024-01-07
24
+
25
+ ### Compatible changes
26
+
27
+ - Add default configuration for `rubocop-capybara` and `rubocop-factory_bot`
28
+
29
+
12
30
  ## 12.0.0 - 2024-01-17
13
31
 
32
+ ### Compatible changes
33
+
34
+ - Supports Ruby 3.3 and Rails 7.1.
35
+
14
36
  ### Breaking changes
15
37
 
16
38
  - Upgrade to `rubocop` 1.60.0 (was 1.39.0)
data/Gemfile.lock CHANGED
@@ -1,38 +1,50 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- makandra-rubocop (12.0.0)
4
+ makandra-rubocop (13.0.0)
5
5
  rubocop (~> 1.60.0)
6
+ rubocop-capybara (~> 2.20.0)
7
+ rubocop-factory_bot (~> 2.25.1)
6
8
  rubocop-rails (~> 2.23.1)
7
- rubocop-rspec (~> 2.13.2)
9
+ rubocop-rspec (~> 2.25.0)
8
10
 
9
11
  GEM
10
12
  remote: https://rubygems.org/
11
13
  specs:
12
- activesupport (6.1.7.3)
14
+ activesupport (7.1.3)
15
+ base64
16
+ bigdecimal
13
17
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
+ connection_pool (>= 2.2.5)
19
+ drb
14
20
  i18n (>= 1.6, < 2)
15
21
  minitest (>= 5.1)
22
+ mutex_m
16
23
  tzinfo (~> 2.0)
17
- zeitwerk (~> 2.3)
18
24
  ast (2.4.2)
19
- concurrent-ruby (1.2.2)
20
- i18n (1.12.0)
25
+ base64 (0.2.0)
26
+ bigdecimal (3.1.6)
27
+ concurrent-ruby (1.2.3)
28
+ connection_pool (2.4.1)
29
+ drb (2.2.0)
30
+ ruby2_keywords
31
+ i18n (1.14.1)
21
32
  concurrent-ruby (~> 1.0)
22
- json (2.6.3)
33
+ json (2.7.2)
23
34
  language_server-protocol (3.17.0.3)
24
- minitest (5.18.0)
25
- parallel (1.22.1)
26
- parser (3.3.0.4)
35
+ minitest (5.21.2)
36
+ mutex_m (0.2.0)
37
+ parallel (1.24.0)
38
+ parser (3.3.0.5)
27
39
  ast (~> 2.4.1)
28
40
  racc
29
41
  racc (1.7.3)
30
- rack (3.0.7)
42
+ rack (3.0.9)
31
43
  rainbow (3.1.1)
32
44
  rake (12.3.2)
33
- regexp_parser (2.7.0)
34
- rexml (3.2.5)
35
- rubocop (1.60.0)
45
+ regexp_parser (2.9.0)
46
+ rexml (3.2.6)
47
+ rubocop (1.60.2)
36
48
  json (~> 2.3)
37
49
  language_server-protocol (>= 3.17.0)
38
50
  parallel (~> 1.10)
@@ -43,20 +55,26 @@ GEM
43
55
  rubocop-ast (>= 1.30.0, < 2.0)
44
56
  ruby-progressbar (~> 1.7)
45
57
  unicode-display_width (>= 2.4.0, < 3.0)
46
- rubocop-ast (1.30.0)
47
- parser (>= 3.2.1.0)
58
+ rubocop-ast (1.31.2)
59
+ parser (>= 3.3.0.4)
60
+ rubocop-capybara (2.20.0)
61
+ rubocop (~> 1.41)
62
+ rubocop-factory_bot (2.25.1)
63
+ rubocop (~> 1.41)
48
64
  rubocop-rails (2.23.1)
49
65
  activesupport (>= 4.2.0)
50
66
  rack (>= 1.1)
51
67
  rubocop (>= 1.33.0, < 2.0)
52
68
  rubocop-ast (>= 1.30.0, < 2.0)
53
- rubocop-rspec (2.13.2)
54
- rubocop (~> 1.33)
69
+ rubocop-rspec (2.25.0)
70
+ rubocop (~> 1.40)
71
+ rubocop-capybara (~> 2.17)
72
+ rubocop-factory_bot (~> 2.22)
55
73
  ruby-progressbar (1.13.0)
74
+ ruby2_keywords (0.0.5)
56
75
  tzinfo (2.0.6)
57
76
  concurrent-ruby (~> 1.0)
58
- unicode-display_width (2.4.2)
59
- zeitwerk (2.6.7)
77
+ unicode-display_width (2.5.0)
60
78
 
61
79
  PLATFORMS
62
80
  ruby
data/README.md CHANGED
@@ -54,6 +54,24 @@ inherit_gem:
54
54
  - config/ext/rspec.yml
55
55
  ```
56
56
 
57
+ **For Capybara**
58
+
59
+ ```yaml
60
+ inherit_gem:
61
+ makandra-rubocop:
62
+ - config/default.yml
63
+ - config/ext/capybara.yml
64
+ ```
65
+
66
+ **For Factory Bot**
67
+
68
+ ```yaml
69
+ inherit_gem:
70
+ makandra-rubocop:
71
+ - config/default.yml
72
+ - config/ext/factory_bot.yml
73
+ ```
74
+
57
75
  Any per-project rules can then be defined in the `.rubocop.yml`:
58
76
 
59
77
  ```yaml
@@ -0,0 +1,105 @@
1
+ require:
2
+ - rubocop-capybara
3
+
4
+ inherit_mode:
5
+ merge:
6
+ - Exclude
7
+
8
+ Capybara:
9
+ Enabled: true
10
+ DocumentationBaseURL: https://docs.rubocop.org/rubocop-capybara
11
+ Include: &1
12
+ - "**/*_spec.rb"
13
+ - "**/spec/**/*"
14
+ - "**/test/**/*"
15
+ - "**/*_steps.rb"
16
+ - "**/features/step_definitions/**/*"
17
+
18
+ Capybara/ClickLinkOrButtonStyle:
19
+ Description: Checks for methods of button or link clicks.
20
+ Enabled: pending
21
+ VersionAdded: '2.19'
22
+ VersionChanged: '2.20'
23
+ EnforcedStyle: link_or_button
24
+ SupportedStyles:
25
+ - link_or_button
26
+ - strict
27
+ Reference: https://www.rubydoc.info/gems/rubocop-capybara/RuboCop/Cop/Capybara/ClickLinkOrButtonStyle
28
+
29
+ Capybara/CurrentPathExpectation:
30
+ Description: Checks that no expectations are set on Capybara's `current_path`.
31
+ Enabled: true
32
+ VersionAdded: '1.18'
33
+ VersionChanged: '2.0'
34
+ Reference: https://www.rubydoc.info/gems/rubocop-capybara/RuboCop/Cop/Capybara/CurrentPathExpectation
35
+
36
+ Capybara/MatchStyle:
37
+ Description: Checks for usage of deprecated style methods.
38
+ Enabled: pending
39
+ VersionAdded: '2.17'
40
+ Reference: https://www.rubydoc.info/gems/rubocop-capybara/RuboCop/Cop/Capybara/MatchStyle
41
+
42
+ Capybara/NegationMatcher:
43
+ Description: Enforces use of `have_no_*` or `not_to` for negated expectations.
44
+ Enabled: pending
45
+ VersionAdded: '2.14'
46
+ VersionChanged: '2.20'
47
+ EnforcedStyle: have_no
48
+ SupportedStyles:
49
+ - have_no
50
+ - not_to
51
+ Reference: https://www.rubydoc.info/gems/rubocop-capybara/RuboCop/Cop/Capybara/NegationMatcher
52
+
53
+ Capybara/RedundantWithinFind:
54
+ Description: Checks for redundant `within find(...)` calls.
55
+ Enabled: pending
56
+ VersionAdded: '2.20'
57
+ Reference: https://www.rubydoc.info/gems/rubocop-capybara/RuboCop/Cop/Capybara/RedundantWithinFind
58
+
59
+ Capybara/SpecificActions:
60
+ Description: Checks for there is a more specific actions offered by Capybara.
61
+ Enabled: pending
62
+ VersionAdded: '2.14'
63
+ Reference: https://www.rubydoc.info/gems/rubocop-capybara/RuboCop/Cop/Capybara/SpecificActions
64
+
65
+ Capybara/SpecificFinders:
66
+ Description: Checks if there is a more specific finder offered by Capybara.
67
+ Enabled: pending
68
+ VersionAdded: '2.13'
69
+ Reference: https://www.rubydoc.info/gems/rubocop-capybara/RuboCop/Cop/Capybara/SpecificFinders
70
+
71
+ Capybara/SpecificMatcher:
72
+ Description: Checks for there is a more specific matcher offered by Capybara.
73
+ Enabled: pending
74
+ VersionAdded: '2.12'
75
+ Reference: https://www.rubydoc.info/gems/rubocop-capybara/RuboCop/Cop/Capybara/SpecificMatcher
76
+
77
+ Capybara/VisibilityMatcher:
78
+ Description: Checks for boolean visibility in Capybara finders.
79
+ Enabled: true
80
+ VersionAdded: '1.39'
81
+ VersionChanged: '2.0'
82
+ Reference: https://www.rubydoc.info/gems/rubocop-capybara/RuboCop/Cop/Capybara/VisibilityMatcher
83
+
84
+ Capybara/RSpec:
85
+ Enabled: false # disable nested cops, as we load rubocop-rspec separately
86
+ Include: *1
87
+
88
+ Capybara/RSpec/HaveSelector:
89
+ Description: Use `have_css` or `have_xpath` instead of `have_selector`.
90
+ Enabled: pending
91
+ DefaultSelector: css
92
+ VersionAdded: '2.19'
93
+ Reference: https://www.rubydoc.info/gems/rubocop-capybara/RuboCop/Cop/Capybara/RSpec/HaveSelector
94
+
95
+ Capybara/RSpec/PredicateMatcher:
96
+ Description: Prefer using predicate matcher over using predicate method directly.
97
+ Enabled: pending
98
+ Strict: true
99
+ EnforcedStyle: inflected
100
+ AllowedExplicitMatchers: []
101
+ SupportedStyles:
102
+ - inflected
103
+ - explicit
104
+ VersionAdded: '2.19'
105
+ Reference: https://www.rubydoc.info/gems/rubocop-capybara/RuboCop/Cop/Capybara/RSpec/PredicateMatcher
@@ -0,0 +1,148 @@
1
+ require:
2
+ - rubocop-factory_bot
3
+
4
+ inherit_mode:
5
+ merge:
6
+ - Exclude
7
+
8
+ FactoryBot:
9
+ Enabled: true
10
+ Include:
11
+ - "**/spec/factories.rb"
12
+ - "**/spec/factories/**/*.rb"
13
+ - "**/test/factories.rb"
14
+ - "**/test/factories/**/*.rb"
15
+ - "**/features/support/factories/**/*.rb"
16
+ DocumentationBaseURL: https://docs.rubocop.org/rubocop-factory_bot
17
+
18
+ FactoryBot/AssociationStyle:
19
+ Description: Use a consistent style to define associations.
20
+ Enabled: pending
21
+ Safe: false
22
+ VersionAdded: '2.23'
23
+ VersionChanged: '2.24'
24
+ EnforcedStyle: implicit
25
+ SupportedStyles:
26
+ - explicit
27
+ - implicit
28
+ NonImplicitAssociationMethodNames: ~
29
+ Reference: https://www.rubydoc.info/gems/rubocop-factory_bot/RuboCop/Cop/FactoryBot/AssociationStyle
30
+
31
+ FactoryBot/AttributeDefinedStatically:
32
+ Description: Always declare attribute values as blocks.
33
+ Enabled: true
34
+ VersionAdded: '1.28'
35
+ VersionChanged: '2.24'
36
+ Reference: https://www.rubydoc.info/gems/rubocop-factory_bot/RuboCop/Cop/FactoryBot/AttributeDefinedStatically
37
+
38
+ FactoryBot/ConsistentParenthesesStyle:
39
+ Description: Use a consistent style for parentheses in factory_bot calls.
40
+ Enabled: pending
41
+ Include:
42
+ - "**/*_spec.rb"
43
+ - "**/spec/**/*"
44
+ - "**/test/**/*"
45
+ - "**/features/support/factories/**/*.rb"
46
+ EnforcedStyle: require_parentheses
47
+ SupportedStyles:
48
+ - require_parentheses
49
+ - omit_parentheses
50
+ ExplicitOnly: false
51
+ VersionAdded: '2.14'
52
+ VersionChanged: '2.23'
53
+ Reference: https://www.rubydoc.info/gems/rubocop-factory_bot/RuboCop/Cop/FactoryBot/ConsistentParenthesesStyle
54
+
55
+ FactoryBot/CreateList:
56
+ Description: Checks for create_list usage.
57
+ Enabled: true
58
+ Include:
59
+ - "**/*_spec.rb"
60
+ - "**/spec/**/*"
61
+ - "**/test/**/*"
62
+ - "**/features/support/factories/**/*.rb"
63
+ EnforcedStyle: create_list
64
+ SupportedStyles:
65
+ - create_list
66
+ - n_times
67
+ ExplicitOnly: false
68
+ SafeAutoCorrect: false
69
+ VersionAdded: '1.25'
70
+ VersionChanged: '2.24'
71
+ Reference: https://www.rubydoc.info/gems/rubocop-factory_bot/RuboCop/Cop/FactoryBot/CreateList
72
+
73
+ FactoryBot/ExcessiveCreateList:
74
+ Description: Check for excessive model creation in a list.
75
+ Enabled: pending
76
+ Include:
77
+ - "**/*_spec.rb"
78
+ - "**/spec/**/*"
79
+ - "**/test/**/*"
80
+ - "**/features/support/factories/**/*.rb"
81
+ MaxAmount: 10
82
+ VersionAdded: '2.25'
83
+ Reference: https://www.rubydoc.info/gems/rubocop-factory_bot/RuboCop/Cop/FactoryBot/ExcessiveCreateList
84
+
85
+ FactoryBot/FactoryAssociationWithStrategy:
86
+ Description: Use definition in factory association instead of hard coding a strategy.
87
+ Enabled: pending
88
+ Include:
89
+ - "**/*_spec.rb"
90
+ - "**/spec/**/*"
91
+ - "**/test/**/*"
92
+ - "**/features/support/factories/**/*.rb"
93
+ VersionAdded: '2.23'
94
+ VersionChanged: '2.23'
95
+ Reference: https://www.rubydoc.info/gems/rubocop-factory_bot/RuboCop/Cop/FactoryBot/FactoryAssociationWithStrategy
96
+
97
+ FactoryBot/FactoryClassName:
98
+ Description: Use string value when setting the class attribute explicitly.
99
+ Enabled: true
100
+ VersionAdded: '1.37'
101
+ VersionChanged: '2.24'
102
+ Reference: https://www.rubydoc.info/gems/rubocop-factory_bot/RuboCop/Cop/FactoryBot/FactoryClassName
103
+
104
+ FactoryBot/FactoryNameStyle:
105
+ Description: Checks for name style for argument of FactoryBot::Syntax::Methods.
106
+ Enabled: pending
107
+ Include:
108
+ - "**/*_spec.rb"
109
+ - "**/spec/**/*"
110
+ - "**/test/**/*"
111
+ - "**/features/support/factories/**/*.rb"
112
+ EnforcedStyle: symbol
113
+ SupportedStyles:
114
+ - symbol
115
+ - string
116
+ ExplicitOnly: false
117
+ VersionAdded: '2.16'
118
+ VersionChanged: '2.23'
119
+ Reference: https://www.rubydoc.info/gems/rubocop-factory_bot/RuboCop/Cop/FactoryBot/FactoryNameStyle
120
+
121
+ FactoryBot/IdSequence:
122
+ Description: Do not create a FactoryBot sequence for an id column.
123
+ Enabled: pending
124
+ VersionAdded: '2.24'
125
+ Reference: https://www.rubydoc.info/gems/rubocop-factory_bot/RuboCop/Cop/FactoryBot/IdSequence
126
+
127
+ FactoryBot/RedundantFactoryOption:
128
+ Description: Checks for redundant `factory` option.
129
+ Enabled: pending
130
+ Include:
131
+ - "**/*_spec.rb"
132
+ - "**/spec/**/*"
133
+ - "**/test/**/*"
134
+ - "**/features/support/factories/**/*.rb"
135
+ VersionAdded: '2.23'
136
+ Reference: https://www.rubydoc.info/gems/rubocop-factory_bot/RuboCop/Cop/FactoryBot/RedundantFactoryOption
137
+
138
+ FactoryBot/SyntaxMethods:
139
+ Description: Use shorthands from `FactoryBot::Syntax::Methods` in your specs.
140
+ Enabled: pending
141
+ Include:
142
+ - "**/*_spec.rb"
143
+ - "**/spec/**/*"
144
+ - "**/test/**/*"
145
+ - "**/features/support/factories/**/*.rb"
146
+ SafeAutoCorrect: false
147
+ VersionAdded: '2.7'
148
+ Reference: https://www.rubydoc.info/gems/rubocop-factory_bot/RuboCop/Cop/FactoryBot/SyntaxMethods
data/config/ext/rspec.yml CHANGED
@@ -18,8 +18,6 @@ RSpec:
18
18
  - Expectations
19
19
  - Helpers
20
20
  - Hooks
21
- - HookScopes
22
- - Runners
23
21
  - Subjects
24
22
  ExampleGroups:
25
23
  inherit_mode:
@@ -82,12 +80,6 @@ RSpec:
82
80
  - prepend_after
83
81
  - after
84
82
  - append_after
85
- HookScopes:
86
- - each
87
- - example
88
- - context
89
- - all
90
- - suite
91
83
  Includes:
92
84
  inherit_mode:
93
85
  merge:
@@ -99,10 +91,6 @@ RSpec:
99
91
  - include_examples
100
92
  Context:
101
93
  - include_context
102
- Runners:
103
- - to
104
- - to_not
105
- - not_to
106
94
  SharedGroups:
107
95
  inherit_mode:
108
96
  merge:
@@ -157,16 +145,26 @@ RSpec/Be:
157
145
  StyleGuide: https://rspec.rubystyle.guide/#be-matcher
158
146
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Be
159
147
 
148
+ RSpec/BeEmpty:
149
+ Description: Prefer using `be_empty` when checking for an empty array.
150
+ Enabled: pending
151
+ VersionAdded: '2.20'
152
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeEmpty
153
+
160
154
  RSpec/BeEq:
161
155
  Description: Check for expectations where `be(...)` can replace `eq(...)`.
162
156
  Enabled: false # Leads to a large diff and the benefit is not that large
157
+ Safe: false
163
158
  VersionAdded: 2.9.0
159
+ VersionChanged: '2.16'
164
160
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeEq
165
161
 
166
162
  RSpec/BeEql:
167
163
  Description: Check for expectations where `be(...)` can replace `eql(...)`.
168
164
  Enabled: true
165
+ Safe: false
169
166
  VersionAdded: '1.7'
167
+ VersionChanged: '2.16'
170
168
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeEql
171
169
 
172
170
  RSpec/BeNil:
@@ -184,10 +182,11 @@ RSpec/BeforeAfterAll:
184
182
  Description: Check that before/after(:all) isn't being used.
185
183
  Enabled: true
186
184
  Exclude:
187
- - spec/spec_helper.rb
188
- - spec/rails_helper.rb
189
- - spec/support/**/*.rb
185
+ - "**/spec/spec_helper.rb"
186
+ - "**/spec/rails_helper.rb"
187
+ - "**/spec/support/**/*.rb"
190
188
  VersionAdded: '1.12'
189
+ VersionChanged: '2.23'
191
190
  StyleGuide: https://rspec.rubystyle.guide/#avoid-hooks-with-context-scope
192
191
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeforeAfterAll
193
192
 
@@ -195,7 +194,7 @@ RSpec/ChangeByZero:
195
194
  Description: Prefer negated matchers over `to change.by(0)`.
196
195
  Enabled: true
197
196
  VersionAdded: '2.11'
198
- VersionChanged: '2.13'
197
+ VersionChanged: '2.14'
199
198
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ChangeByZero
200
199
  NegatedMatcher: ~
201
200
 
@@ -210,6 +209,12 @@ RSpec/ClassCheck:
210
209
  - be_kind_of
211
210
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ClassCheck
212
211
 
212
+ RSpec/ContainExactly:
213
+ Description: Checks where `contain_exactly` is used.
214
+ Enabled: true
215
+ VersionAdded: '2.19'
216
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ContainExactly
217
+
213
218
  RSpec/ContextMethod:
214
219
  Description: "`context` should not be used for specifying methods."
215
220
  Enabled: true
@@ -291,6 +296,12 @@ RSpec/Dialect:
291
296
  VersionAdded: '1.33'
292
297
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Dialect
293
298
 
299
+ RSpec/DuplicatedMetadata:
300
+ Description: Avoid duplicated metadata.
301
+ Enabled: pending
302
+ VersionAdded: '2.16'
303
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DuplicatedMetadata
304
+
294
305
  RSpec/EmptyExampleGroup:
295
306
  Description: Checks if an example group does not include any tests.
296
307
  Enabled: true
@@ -343,6 +354,18 @@ RSpec/EmptyLineAfterSubject:
343
354
  StyleGuide: https://rspec.rubystyle.guide/#empty-line-after-let
344
355
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterSubject
345
356
 
357
+ RSpec/EmptyMetadata:
358
+ Description: Avoid empty metadata hash.
359
+ Enabled: pending
360
+ VersionAdded: '2.24'
361
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyMetadata
362
+
363
+ RSpec/Eq:
364
+ Description: Use `eq` instead of `be ==` to compare objects.
365
+ Enabled: true
366
+ VersionAdded: '2.24'
367
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Eq
368
+
346
369
  RSpec/ExampleLength:
347
370
  Description: Checks for long examples.
348
371
  Enabled: false # We do not want to have such limitation
@@ -378,8 +401,10 @@ RSpec/ExampleWording:
378
401
  have: has
379
402
  HAVE: HAS
380
403
  IgnoredWords: []
404
+ DisallowedExamples:
405
+ - works
381
406
  VersionAdded: '1.0'
382
- VersionChanged: '1.2'
407
+ VersionChanged: '2.13'
383
408
  StyleGuide: https://rspec.rubystyle.guide/#should-in-example-docstrings
384
409
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleWording
385
410
 
@@ -387,8 +412,9 @@ RSpec/ExpectActual:
387
412
  Description: Checks for `expect(...)` calls containing literal values.
388
413
  Enabled: true
389
414
  Exclude:
390
- - spec/routing/**/*
415
+ - "**/spec/routing/**/*"
391
416
  VersionAdded: '1.7'
417
+ VersionChanged: '2.23'
392
418
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectActual
393
419
 
394
420
  RSpec/ExpectChange:
@@ -427,7 +453,7 @@ RSpec/FilePath:
427
453
  IgnoreMethods: false
428
454
  SpecSuffixOnly: false
429
455
  VersionAdded: '1.2'
430
- VersionChanged: '1.40'
456
+ VersionChanged: '2.24'
431
457
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FilePath
432
458
 
433
459
  RSpec/Focus:
@@ -487,10 +513,21 @@ RSpec/ImplicitSubject:
487
513
  - single_line_only
488
514
  - single_statement_only
489
515
  - disallow
516
+ - require_implicit
490
517
  VersionAdded: '1.29'
491
- VersionChanged: '1.30'
518
+ VersionChanged: '2.13'
492
519
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ImplicitSubject
493
520
 
521
+ RSpec/IndexedLet:
522
+ Description: Do not set up test data using indexes (e.g., `item_1`, `item_2`).
523
+ Enabled: true
524
+ VersionAdded: '2.20'
525
+ VersionChanged: '2.23'
526
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IndexedLet
527
+ Max: 1
528
+ AllowedIdentifiers: []
529
+ AllowedPatterns: []
530
+
494
531
  RSpec/InstanceSpy:
495
532
  Description: Checks for `instance_double` used with `have_received`.
496
533
  Enabled: true
@@ -550,6 +587,12 @@ RSpec/LetSetup:
550
587
  VersionAdded: '1.7'
551
588
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LetSetup
552
589
 
590
+ RSpec/MatchArray:
591
+ Description: Checks where `match_array` is used.
592
+ Enabled: true
593
+ VersionAdded: '2.19'
594
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MatchArray
595
+
553
596
  RSpec/MessageChain:
554
597
  Description: Check that chains of messages are not being stubbed.
555
598
  Enabled: true
@@ -577,6 +620,16 @@ RSpec/MessageSpies:
577
620
  VersionAdded: '1.9'
578
621
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageSpies
579
622
 
623
+ RSpec/MetadataStyle:
624
+ Description: Use consistent metadata style.
625
+ Enabled: true
626
+ EnforcedStyle: symbol
627
+ SupportedStyles:
628
+ - hash
629
+ - symbol
630
+ VersionAdded: '2.24'
631
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MetadataStyle
632
+
580
633
  RSpec/MissingExampleGroupArgument:
581
634
  Description: Checks that the first argument to an example group is not empty.
582
635
  Enabled: true
@@ -616,8 +669,13 @@ RSpec/MultipleSubjects:
616
669
  RSpec/NamedSubject:
617
670
  Description: Checks for explicitly referenced test subjects.
618
671
  Enabled: false # https://github.com/makandra/makandra-rubocop/issues/23 - good default but not enforced
672
+ EnforcedStyle: always
673
+ SupportedStyles:
674
+ - always
675
+ - named_only
619
676
  IgnoreSharedExamples: true
620
677
  VersionAdded: 1.5.3
678
+ VersionChanged: '2.15'
621
679
  StyleGuide: https://rspec.rubystyle.guide/#use-subject
622
680
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NamedSubject
623
681
 
@@ -635,7 +693,11 @@ RSpec/NoExpectationExample:
635
693
  Enabled: false # requires some config for custom expectations
636
694
  Safe: false
637
695
  VersionAdded: '2.13'
696
+ VersionChanged: '2.14'
638
697
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NoExpectationExample
698
+ AllowedPatterns:
699
+ - "^expect_"
700
+ - "^assert_"
639
701
 
640
702
  RSpec/NotToNot:
641
703
  Description: Checks for consistent method usage for negating expectations.
@@ -659,6 +721,12 @@ RSpec/Pending:
659
721
  VersionAdded: '1.25'
660
722
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Pending
661
723
 
724
+ RSpec/PendingWithoutReason:
725
+ Description: Checks for pending or skipped examples without reason.
726
+ Enabled: pending
727
+ VersionAdded: '2.16'
728
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/PendingWithoutReason
729
+
662
730
  RSpec/PredicateMatcher:
663
731
  Description: Prefer using predicate matcher over using predicate method directly.
664
732
  Enabled: true # Maybe we need to remove this in the future
@@ -679,12 +747,25 @@ RSpec/ReceiveCounts:
679
747
  VersionAdded: '1.26'
680
748
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ReceiveCounts
681
749
 
750
+ RSpec/ReceiveMessages:
751
+ Description: Checks for multiple messages stubbed on the same object.
752
+ Enabled: false
753
+ SafeAutoCorrect: false
754
+ VersionAdded: '2.23'
755
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ReceiveMessages
756
+
682
757
  RSpec/ReceiveNever:
683
758
  Description: Prefer `not_to receive(...)` over `receive(...).never`.
684
759
  Enabled: true
685
760
  VersionAdded: '1.28'
686
761
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ReceiveNever
687
762
 
763
+ RSpec/RedundantAround:
764
+ Description: Remove redundant `around` hook.
765
+ Enabled: pending
766
+ VersionAdded: '2.19'
767
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RedundantAround
768
+
688
769
  RSpec/RepeatedDescription:
689
770
  Description: Check for repeated description strings in example groups.
690
771
  Enabled: true
@@ -758,6 +839,43 @@ RSpec/SingleArgumentMessageChain:
758
839
  VersionChanged: '1.10'
759
840
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SingleArgumentMessageChain
760
841
 
842
+ RSpec/SkipBlockInsideExample:
843
+ Description: Checks for passing a block to `skip` within examples.
844
+ Enabled: pending
845
+ VersionAdded: '2.19'
846
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SkipBlockInsideExample
847
+
848
+ RSpec/SortMetadata:
849
+ Description: Sort RSpec metadata alphabetically.
850
+ Enabled: false
851
+ VersionAdded: '2.14'
852
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SortMetadata
853
+
854
+ RSpec/SpecFilePathFormat:
855
+ Description: Checks that spec file paths are consistent and well-formed.
856
+ Enabled: pending
857
+ Include:
858
+ - "**/*_spec.rb"
859
+ Exclude:
860
+ - "**/spec/routing/**/*"
861
+ CustomTransform:
862
+ RuboCop: rubocop
863
+ RSpec: rspec
864
+ IgnoreMethods: false
865
+ IgnoreMetadata:
866
+ type: routing
867
+ VersionAdded: '2.24'
868
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SpecFilePathFormat
869
+
870
+ RSpec/SpecFilePathSuffix:
871
+ Description: Checks that spec file paths suffix are consistent and well-formed.
872
+ Enabled: pending
873
+ VersionAdded: '2.24'
874
+ Include:
875
+ - "**/*_spec*rb*"
876
+ - "**/spec/**/*"
877
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SpecFilePathSuffix
878
+
761
879
  RSpec/StubbedMock:
762
880
  Description: Checks that message expectations do not have a configured response.
763
881
  Enabled: false # Maybe add later, currently there are too many conflicts
@@ -841,7 +959,7 @@ RSpec/Yield:
841
959
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Yield
842
960
 
843
961
  RSpec/Capybara:
844
- Enabled: true
962
+ Enabled: false # disable nested cops, as we load rubocop-capybara separately
845
963
  Include: *1
846
964
  Language: *2
847
965
 
@@ -860,6 +978,28 @@ RSpec/Capybara/FeatureMethods:
860
978
  VersionChanged: '2.0'
861
979
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/FeatureMethods
862
980
 
981
+ RSpec/Capybara/MatchStyle:
982
+ Description: Checks for usage of deprecated style methods.
983
+ Enabled: pending
984
+ VersionAdded: '2.17'
985
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/MatchStyle
986
+
987
+ RSpec/Capybara/NegationMatcher:
988
+ Description: Enforces use of `have_no_*` or `not_to` for negated expectations.
989
+ Enabled: pending
990
+ VersionAdded: '2.14'
991
+ EnforcedStyle: not_to
992
+ SupportedStyles:
993
+ - have_no
994
+ - not_to
995
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/NegationMatcher
996
+
997
+ RSpec/Capybara/SpecificActions:
998
+ Description: Checks for there is a more specific actions offered by Capybara.
999
+ Enabled: pending
1000
+ VersionAdded: '2.14'
1001
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/SpecificActions
1002
+
863
1003
  RSpec/Capybara/SpecificFinders:
864
1004
  Description: Checks if there is a more specific finder offered by Capybara.
865
1005
  Enabled: false # Voted in https://github.com/makandra/makandra-rubocop/pull/41
@@ -880,7 +1020,7 @@ RSpec/Capybara/VisibilityMatcher:
880
1020
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/VisibilityMatcher
881
1021
 
882
1022
  RSpec/FactoryBot:
883
- Enabled: true
1023
+ Enabled: false # disable nested cops, as we load rubocop-factory_bot separately
884
1024
  Include: *1
885
1025
  Language: *2
886
1026
 
@@ -888,41 +1028,61 @@ RSpec/FactoryBot/AttributeDefinedStatically:
888
1028
  Description: Always declare attribute values as blocks.
889
1029
  Enabled: true
890
1030
  Include:
891
- - spec/factories.rb
892
- - spec/factories/**/*.rb
893
- - features/support/factories/**/*.rb
1031
+ - "**/spec/factories.rb"
1032
+ - "**/spec/factories/**/*.rb"
1033
+ - "**/features/support/factories/**/*.rb"
894
1034
  VersionAdded: '1.28'
895
- VersionChanged: '2.0'
1035
+ VersionChanged: '2.23'
896
1036
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/AttributeDefinedStatically
897
1037
 
1038
+ RSpec/FactoryBot/ConsistentParenthesesStyle:
1039
+ Description: Use a consistent style for parentheses in factory bot calls.
1040
+ Enabled: pending
1041
+ EnforcedStyle: require_parentheses
1042
+ SupportedStyles:
1043
+ - require_parentheses
1044
+ - omit_parentheses
1045
+ VersionAdded: '2.14'
1046
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/ConsistentParenthesesStyle
1047
+
898
1048
  RSpec/FactoryBot/CreateList:
899
1049
  Description: Checks for create_list usage.
900
1050
  Enabled: true
901
1051
  Include:
902
1052
  - "**/*_spec.rb"
903
1053
  - "**/spec/**/*"
904
- - spec/factories.rb
905
- - spec/factories/**/*.rb
906
- - features/support/factories/**/*.rb
1054
+ - "**/spec/factories.rb"
1055
+ - "**/spec/factories/**/*.rb"
1056
+ - "**/features/support/factories/**/*.rb"
907
1057
  EnforcedStyle: create_list
908
1058
  SupportedStyles:
909
1059
  - create_list
910
1060
  - n_times
911
1061
  VersionAdded: '1.25'
912
- VersionChanged: '2.0'
1062
+ VersionChanged: '2.23'
913
1063
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/CreateList
914
1064
 
915
1065
  RSpec/FactoryBot/FactoryClassName:
916
1066
  Description: Use string value when setting the class attribute explicitly.
917
1067
  Enabled: true
918
1068
  Include:
919
- - spec/factories.rb
920
- - spec/factories/**/*.rb
921
- - features/support/factories/**/*.rb
1069
+ - "**/spec/factories.rb"
1070
+ - "**/spec/factories/**/*.rb"
1071
+ - "**/features/support/factories/**/*.rb"
922
1072
  VersionAdded: '1.37'
923
- VersionChanged: '2.0'
1073
+ VersionChanged: '2.23'
924
1074
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/FactoryClassName
925
1075
 
1076
+ RSpec/FactoryBot/FactoryNameStyle:
1077
+ Description: Checks for name style for argument of FactoryBot::Syntax::Methods.
1078
+ Enabled: pending
1079
+ VersionAdded: '2.16'
1080
+ EnforcedStyle: symbol
1081
+ SupportedStyles:
1082
+ - symbol
1083
+ - string
1084
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/FactoryNameStyle
1085
+
926
1086
  RSpec/FactoryBot/SyntaxMethods:
927
1087
  Description: Use shorthands from `FactoryBot::Syntax::Methods` in your specs.
928
1088
  Enabled: false # requires the usage of `FactoryBot::Syntax::Methods`
@@ -931,7 +1091,7 @@ RSpec/FactoryBot/SyntaxMethods:
931
1091
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/SyntaxMethods
932
1092
 
933
1093
  RSpec/Rails:
934
- Enabled: true
1094
+ Enabled: false # disable nested cops, as we load rubocop-rails separately
935
1095
  Include: *1
936
1096
  Language: *2
937
1097
 
@@ -955,6 +1115,54 @@ RSpec/Rails/HttpStatus:
955
1115
  SupportedStyles:
956
1116
  - numeric
957
1117
  - symbolic
1118
+ - be_status
958
1119
  VersionAdded: '1.23'
959
- VersionChanged: '2.0'
1120
+ VersionChanged: '2.20'
960
1121
  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/HttpStatus
1122
+
1123
+ RSpec/Rails/InferredSpecType:
1124
+ Description: Identifies redundant spec type.
1125
+ Enabled: pending
1126
+ Safe: false
1127
+ VersionAdded: '2.14'
1128
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/InferredSpecType
1129
+ Inferences:
1130
+ channels: channel
1131
+ controllers: controller
1132
+ features: feature
1133
+ generator: generator
1134
+ helpers: helper
1135
+ jobs: job
1136
+ mailboxes: mailbox
1137
+ mailers: mailer
1138
+ models: model
1139
+ requests: request
1140
+ integration: request
1141
+ api: request
1142
+ routing: routing
1143
+ system: system
1144
+ views: view
1145
+
1146
+ RSpec/Rails/MinitestAssertions:
1147
+ Description: Check if using Minitest matchers.
1148
+ Enabled: pending
1149
+ VersionAdded: '2.17'
1150
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/MinitestAssertions
1151
+
1152
+ RSpec/Rails/NegationBeValid:
1153
+ Description: Enforces use of `be_invalid` or `not_to` for negated be_valid.
1154
+ Safe: false
1155
+ EnforcedStyle: not_to
1156
+ SupportedStyles:
1157
+ - not_to
1158
+ - be_invalid
1159
+ Enabled: pending
1160
+ VersionAdded: '2.23'
1161
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/NegationBeValid
1162
+
1163
+ RSpec/Rails/TravelAround:
1164
+ Description: Prefer to travel in `before` rather than `around`.
1165
+ Enabled: pending
1166
+ Safe: false
1167
+ VersionAdded: '2.19'
1168
+ Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/TravelAround
@@ -1,3 +1,3 @@
1
1
  module MakandraRubocop
2
- VERSION = '12.0.0'.freeze
2
+ VERSION = '13.0.0'.freeze
3
3
  end
@@ -26,7 +26,9 @@ Gem::Specification.new do |spec|
26
26
 
27
27
  spec.add_dependency 'rubocop', '~> 1.60.0'
28
28
  spec.add_dependency 'rubocop-rails', '~> 2.23.1'
29
- spec.add_dependency 'rubocop-rspec', '~> 2.13.2'
29
+ spec.add_dependency 'rubocop-rspec', '~> 2.25.0'
30
+ spec.add_dependency 'rubocop-capybara', '~> 2.20.0'
31
+ spec.add_dependency 'rubocop-factory_bot', '~> 2.25.1'
30
32
 
31
33
  spec.add_development_dependency 'bundler', '~> 2.0'
32
34
  spec.add_development_dependency 'rake', '~> 12.3'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: makandra-rubocop
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.0.0
4
+ version: 13.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arne Hartherz
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2024-01-17 00:00:00.000000000 Z
12
+ date: 2024-05-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rubocop
@@ -45,14 +45,42 @@ dependencies:
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: 2.13.2
48
+ version: 2.25.0
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: 2.13.2
55
+ version: 2.25.0
56
+ - !ruby/object:Gem::Dependency
57
+ name: rubocop-capybara
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: 2.20.0
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: 2.20.0
70
+ - !ruby/object:Gem::Dependency
71
+ name: rubocop-factory_bot
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: 2.25.1
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: 2.25.1
56
84
  - !ruby/object:Gem::Dependency
57
85
  name: bundler
58
86
  requirement: !ruby/object:Gem::Requirement
@@ -101,6 +129,8 @@ files:
101
129
  - bin/console
102
130
  - bin/setup
103
131
  - config/default.yml
132
+ - config/ext/capybara.yml
133
+ - config/ext/factory_bot.yml
104
134
  - config/ext/rails.yml
105
135
  - config/ext/rspec.yml
106
136
  - lib/makandra_rubocop.rb