rubocop-config-captive 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d26b4c18e60a16162ee86f408a1dc11d3282b14e7d0dfee767f338e78b298c7c
4
- data.tar.gz: 9d8451ae556c8177d7887f80e72162065c6eb9d81b010cb2f29db5418ce2d412
3
+ metadata.gz: cc95a360374085a6fc41b84492a751f49109deda5cebd33475bf81b6425bb7b2
4
+ data.tar.gz: c4a32511f6caa8236bf57c411d30f5ca94453d376b066352b0fc797a5f543f2c
5
5
  SHA512:
6
- metadata.gz: e3c325ded0d7ab84d1c2b1ffad5c5efc2cec260fe29e9a612f578e39f9523f6ee5b2bce951ddc0e8ac1be9a73652318fbd62c003f3b62188724822fd224adb63
7
- data.tar.gz: c42b32494c79c5398a55ce22d4ab1c9cb457ffdcb0c446fd55c7e2002f8fbe31f689bff75d65823484db406f9f705908411782c2b3c5c0ccd98147abd856f9e8
6
+ metadata.gz: 7300f2e8987fea65e0815bc1c0ab39b605d458191b9ff32f9135600d4bb0035948379f2618291bf01037aa8eaf5a70d72845663e881fef4f3f49d639024cf731
7
+ data.tar.gz: a8c8772907072d6d68404c52bebc83f989d2a43fdd32e58763e119745d63a1c2d96713cbd3249382d85424db904be3ff534c28ed9bea6750d4dbb66019191737
data/Gemfile CHANGED
@@ -4,6 +4,10 @@ source "https://rubygems.org"
4
4
 
5
5
  gemspec
6
6
 
7
+ group :development do
8
+ gem 'yard', '~> 0.9.34'
9
+ end
10
+
7
11
  group :test do
8
12
  gem 'pry', '0.14.2'
9
13
  end
data/README.md CHANGED
@@ -32,7 +32,9 @@ inherit_gem:
32
32
  # - config/rubocop-XXX.yml
33
33
  ```
34
34
 
35
- ## My project has too many errors
35
+ ## Common Errors
36
+
37
+ ### My project has too many errors
36
38
 
37
39
  Firstly, you can use `bundle exec rubocop -a` to auto-correct your project
38
40
 
@@ -40,6 +42,14 @@ Then if you have too many warnings, you can use the command line :
40
42
 
41
43
  `bundle exec rubocop --auto-gen-config` to create `.rubocop_todo.yml` file that ignore these errors
42
44
 
45
+ ### `Gemfile` has lots of `Bundler/GemVersion` errors
46
+
47
+ Explanation : Each dependency should be explicitly set in the `Gemfile` and `bundle update` is strongly discouraged.
48
+ Workaround :
49
+
50
+ 1. Install gem bundle-locker : `gem install bundle-locker`
51
+ 1. Pin Gemfile using Gemfile.lock : `bundle-locker ./Gemfile`
52
+
43
53
  ## Contributing
44
54
 
45
55
  To contribute, here are some inspirations for good configurations :
@@ -1,4 +1,4 @@
1
- ### ⚠️ GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
1
+ ### 🚨 GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
2
2
  # All of these rules are implemented in this gem.
3
3
  # They are custom built for use inside Airbnb and address issues that we have experienced in
4
4
  # testing and production.
@@ -1,4 +1,4 @@
1
- ### ⚠️ GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
1
+ ### 🚨 GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
2
2
  Bundler/DuplicatedGem:
3
3
  Enabled: true
4
4
 
@@ -0,0 +1,7 @@
1
+ ### ⚠️ GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
2
+ require:
3
+ - rubocop-capybara
4
+
5
+ Capybara/CurrentPathExpectation:
6
+ Description: Checks that no expectations are set on Capybara's `current_path`.
7
+ Enabled: false
@@ -1,4 +1,4 @@
1
- ### ⚠️ GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
1
+ ### 🚨 GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
2
2
  Gemspec/OrderedDependencies:
3
3
  Enabled: false
4
4
 
@@ -1,4 +1,4 @@
1
- ### ⚠️ GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
1
+ ### 🚨 GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
2
2
  # Type 'Style' (166):
3
3
  # Supports --auto-correct
4
4
  Layout/AccessModifierIndentation:
@@ -1,4 +1,4 @@
1
- ### ⚠️ GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
1
+ ### 🚨 GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
2
2
  Lint/AmbiguousBlockAssociation:
3
3
  Enabled: false
4
4
 
@@ -1,4 +1,4 @@
1
- ### ⚠️ GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
1
+ ### 🚨 GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
2
2
  # We're using cane for ABC complexity checks
3
3
  Metrics/AbcSize:
4
4
  Enabled: false
@@ -1,4 +1,4 @@
1
- ### ⚠️ GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
1
+ ### 🚨 GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
2
2
  Naming/AccessorMethodName:
3
3
  Description: Check the naming of accessor methods for get_/set_.
4
4
  Enabled: false
@@ -1,4 +1,4 @@
1
- ### ⚠️ GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
1
+ ### 🚨 GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
2
2
  require:
3
3
  - rubocop-performance
4
4
 
@@ -1,4 +1,4 @@
1
- ### ⚠️ GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
1
+ ### 🚨 GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
2
2
  require:
3
3
  - rubocop-rails
4
4
 
@@ -1,85 +1,65 @@
1
- ### ⚠️ GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
1
+ ### 🚨 GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
2
2
  require:
3
3
  - rubocop-rspec
4
-
5
4
  RSpec/AlignLeftLetBrace:
6
5
  Description: Checks that left braces for adjacent single line lets are aligned.
7
6
  Enabled: false
8
-
9
7
  RSpec/AlignRightLetBrace:
10
8
  Description: Checks that right braces for adjacent single line lets are aligned.
11
9
  Enabled: false
12
-
13
10
  RSpec/AnyInstance:
14
11
  Description: 'Prefer instance doubles over stubbing any instance of a class'
15
12
  Enabled: false
16
-
17
13
  RSpec/AroundBlock:
18
14
  Description: Checks that around blocks actually run the test.
19
15
  Enabled: true
20
-
21
16
  RSpec/Be:
22
17
  Description: Check for expectations where `be` is used without argument.
23
18
  Enabled: true
24
-
25
19
  RSpec/BeEql:
26
20
  Description: Check for expectations where `be(...)` can replace `eql(...)`.
27
21
  Enabled: false
28
-
29
22
  RSpec/BeforeAfterAll:
30
23
  Description: Check that before/after(:all) isn't being used.
31
24
  Enabled: true
32
25
  Exclude:
33
- - spec/spec_helper.rb
34
- - spec/rails_helper.rb
35
- - spec/support/**/*.rb
36
-
26
+ - spec/spec_helper.rb
27
+ - spec/rails_helper.rb
28
+ - spec/support/**/*.rb
37
29
  RSpec/ContextWording:
38
30
  Description: "`context` block descriptions should start with 'when', or 'with'."
39
31
  Enabled: false
40
-
41
32
  RSpec/DescribeClass:
42
33
  Description: 'Check that the first argument to the top level describe is the tested class or module.'
43
34
  Enabled: false
44
-
45
35
  RSpec/DescribeMethod:
46
36
  Description: 'Checks that the second argument to top level describe is the tested method name.'
47
37
  Enabled: false
48
-
49
38
  RSpec/DescribeSymbol:
50
39
  Description: Avoid describing symbols.
51
40
  Enabled: true
52
-
53
41
  RSpec/DescribedClass:
54
42
  Description: 'Use `described_class` for tested class / module'
55
43
  Enabled: false
56
-
57
44
  RSpec/EmptyExampleGroup:
58
45
  Description: Checks if an example group does not include any tests.
59
46
  Enabled: true
60
-
61
47
  RSpec/EmptyLineAfterExampleGroup:
62
48
  Description: Checks if there is an empty line after example group blocks.
63
49
  Enabled: true
64
-
65
50
  RSpec/EmptyLineAfterFinalLet:
66
51
  Description: Checks if there is an empty line after the last let block.
67
52
  Enabled: true
68
-
69
53
  RSpec/EmptyLineAfterHook:
70
54
  Description: Checks if there is an empty line after hook blocks.
71
55
  Enabled: true
72
-
73
56
  RSpec/EmptyLineAfterSubject:
74
57
  Description: Checks if there is an empty line after subject block.
75
58
  Enabled: true
76
-
77
59
  RSpec/ExampleLength:
78
60
  Description: >-
79
- A long example is usually more difficult to understand.
80
- Consider extracting out some behaviour, e.g. with a `let` block, or a helper method.
61
+ A long example is usually more difficult to understand. Consider extracting out some behaviour, e.g. with a `let` block, or a helper method.
81
62
  Enabled: false
82
-
83
63
  RSpec/ExampleWording:
84
64
  Description: 'Do not use should when describing your tests.'
85
65
  Enabled: true
@@ -96,139 +76,112 @@ RSpec/ExampleWording:
96
76
  response: responds
97
77
  be redirect: redirects
98
78
  IgnoredWords: []
99
-
100
79
  RSpec/ExpectActual:
101
80
  Description: Checks for `expect(...)` calls containing literal values.
102
81
  Enabled: true
103
82
  Exclude:
104
- - spec/routing/**/*
105
-
83
+ - spec/routing/**/*
106
84
  RSpec/ExpectInHook:
107
85
  Enabled: true
108
86
  Description: Do not use `expect` in hooks such as `before`.
109
-
110
87
  RSpec/ExpectOutput:
111
88
  Description: Checks for opportunities to use `expect { ... }.to output`.
112
89
  Enabled: false
113
-
114
90
  RSpec/FilePath:
115
91
  Description: 'Checks the file and folder naming of the spec file.'
116
92
  Enabled: false
117
93
  CustomTransform:
118
94
  RuboCop: rubocop
119
95
  RSpec: rspec
120
-
121
96
  RSpec/Focus:
122
97
  Description: Checks if examples are focused.
123
98
  Enabled: false
124
-
125
99
  RSpec/HookArgument:
126
100
  Description: Checks the arguments passed to `before`, `around`, and `after`.
127
101
  Enabled: false
128
102
  EnforcedStyle: implicit
129
103
  SupportedStyles:
130
- - implicit
131
- - each
132
- - example
133
-
104
+ - implicit
105
+ - each
106
+ - example
134
107
  RSpec/HooksBeforeExamples:
135
108
  Description: Checks for before/around/after hooks that come after an example.
136
109
  Enabled: true
137
-
138
110
  RSpec/ImplicitExpect:
139
111
  Description: Check that a consistent implicit expectation style is used.
140
112
  Enabled: false
141
113
  EnforcedStyle: is_expected
142
114
  SupportedStyles:
143
- - is_expected
144
- - should
145
-
115
+ - is_expected
116
+ - should
146
117
  RSpec/ImplicitSubject:
147
118
  Description: 'Checks for usage of implicit subject (`is_expected` / `should`).'
148
119
  Enabled: false
149
-
150
120
  RSpec/InstanceSpy:
151
121
  Description: Checks for `instance_double` used with `have_received`.
152
122
  Enabled: false
153
-
154
123
  RSpec/InstanceVariable:
155
124
  Description: 'Checks for the usage of instance variables.'
156
125
  Enabled: false
157
-
158
126
  RSpec/ItBehavesLike:
159
127
  Description: Checks that only one `it_behaves_like` style is used.
160
128
  Enabled: false
161
129
  EnforcedStyle: it_behaves_like
162
130
  SupportedStyles:
163
- - it_behaves_like
164
- - it_should_behave_like
165
-
131
+ - it_behaves_like
132
+ - it_should_behave_like
166
133
  RSpec/IteratedExpectation:
167
134
  Description: Check that `all` matcher is used instead of iterating over an array.
168
135
  Enabled: false
169
-
170
136
  RSpec/LeadingSubject:
171
137
  Description: Checks for `subject` definitions that come after `let` definitions.
172
138
  Enabled: true
173
-
174
139
  RSpec/LetBeforeExamples:
175
140
  Description: Checks for `let` definitions that come after an example.
176
141
  Enabled: true
177
-
178
142
  RSpec/LetSetup:
179
143
  Description: Checks unreferenced `let!` calls being used for test setup.
180
144
  Enabled: false
181
-
182
145
  RSpec/MessageChain:
183
146
  Description: Check that chains of messages are not being stubbed.
184
147
  Enabled: false
185
-
186
148
  RSpec/MessageExpectation:
187
149
  Description: Checks for consistent message expectation style.
188
150
  Enabled: false
189
151
  EnforcedStyle: allow
190
152
  SupportedStyles:
191
- - allow
192
- - expect
193
-
153
+ - allow
154
+ - expect
194
155
  RSpec/MessageSpies:
195
156
  Description: Checks that message expectations are set using spies.
196
157
  Enabled: false
197
158
  EnforcedStyle: have_received
198
159
  SupportedStyles:
199
- - have_received
200
- - receive
201
-
160
+ - have_received
161
+ - receive
202
162
  RSpec/MissingExampleGroupArgument:
203
163
  Description: Checks that the first argument to an example group is not empty.
204
164
  Enabled: true
205
-
206
165
  RSpec/MultipleDescribes:
207
166
  Description: 'Checks for multiple top level describes.'
208
167
  Enabled: true
209
-
210
168
  RSpec/MultipleExpectations:
211
169
  Description: Checks if examples contain too many `expect` calls.
212
170
  Enabled: false
213
171
  Max: 1
214
-
215
172
  RSpec/MultipleSubjects:
216
173
  Description: Checks if an example group defines `subject` multiple times.
217
174
  Enabled: true
218
-
219
175
  RSpec/NamedSubject:
220
176
  Description: Checks for explicitly referenced test subjects.
221
177
  Enabled: false
222
-
223
178
  RSpec/NestedGroups:
224
179
  Description: Checks for nested example groups.
225
180
  Enabled: false
226
181
  Max: 3
227
-
228
182
  RSpec/ReceiveNever:
229
183
  Description: 'Prefer `not_to receive(…)` over `receive(…).never`.'
230
184
  Enabled: true
231
-
232
185
  RSpec/NotToNot:
233
186
  Description: 'Enforces the usage of the same method on all negative message expectations.'
234
187
  Enabled: true
@@ -236,92 +189,66 @@ RSpec/NotToNot:
236
189
  SupportedStyles:
237
190
  - not_to
238
191
  - to_not
239
-
240
192
  RSpec/OverwritingSetup:
241
193
  Enabled: false
242
194
  Description: Checks if there is a let/subject that overwrites an existing one.
243
-
244
195
  RSpec/Pending:
245
196
  Description: Checks for any pending or skipped examples.
246
197
  Enabled: false
247
-
248
198
  RSpec/PredicateMatcher:
249
199
  Description: Prefer using predicate matcher over using predicate method directly.
250
200
  Enabled: false
251
201
  Strict: true
252
202
  EnforcedStyle: inflected
253
203
  SupportedStyles:
254
- - inflected
255
- - explicit
256
-
204
+ - inflected
205
+ - explicit
257
206
  RSpec/ReceiveCounts:
258
207
  Description: Check for `once` and `twice` receive counts matchers usage.
259
208
  Enabled: false
260
-
261
209
  RSpec/RepeatedDescription:
262
210
  Description: Check for repeated description strings in example groups.
263
211
  Enabled: true
264
-
265
212
  RSpec/RepeatedExample:
266
213
  Enabled: true
267
214
  Description: Check for repeated examples within example groups.
268
-
269
215
  RSpec/ReturnFromStub:
270
216
  Enabled: true
271
217
  Description: Checks for consistent style of stub's return setting.
272
218
  EnforcedStyle: and_return
273
219
  SupportedStyles:
274
- - and_return
275
- - block
276
-
220
+ - and_return
221
+ - block
277
222
  RSpec/ScatteredLet:
278
223
  Description: Checks for let scattered across the example group.
279
224
  Enabled: true
280
-
281
225
  RSpec/ScatteredSetup:
282
226
  Description: Checks for setup scattered across multiple hooks in an example group.
283
227
  Enabled: true
284
-
285
228
  RSpec/SharedContext:
286
229
  Description: Checks for proper shared_context and shared_examples usage.
287
230
  Enabled: false
288
-
289
231
  RSpec/SharedExamples:
290
232
  Description: Enforces use of string to titleize shared examples.
291
233
  Enabled: true
292
-
293
234
  RSpec/SingleArgumentMessageChain:
294
235
  Description: Checks that chains of messages contain more than one element.
295
236
  Enabled: true
296
-
297
237
  RSpec/SubjectStub:
298
238
  Description: Checks for stubbed test subjects.
299
239
  Enabled: false
300
-
301
240
  RSpec/UnspecifiedException:
302
241
  Description: Checks for a specified error in checking raised errors.
303
242
  Enabled: false
304
-
305
243
  RSpec/VerifiedDoubles:
306
244
  Description: 'Prefer using verifying doubles over normal doubles.'
307
245
  Enabled: false
308
-
309
246
  RSpec/VoidExpect:
310
247
  Description: This cop checks void `expect()`.
311
248
  Enabled: false
312
-
313
- RSpec/Capybara/CurrentPathExpectation:
314
- Description: Checks that no expectations are set on Capybara's `current_path`.
315
- Enabled: false
316
-
317
- RSpec/Capybara/FeatureMethods:
318
- Description: Checks for consistent method usage in feature specs.
319
- Enabled: false
320
-
321
249
  RSpec/FactoryBot/AttributeDefinedStatically:
322
250
  Description: Always declare attribute values as blocks.
323
251
  Enabled: false
324
-
325
252
  RSpec/FactoryBot/CreateList:
326
253
  Description: Checks for create_list usage.
327
254
  Enabled: true
@@ -1,4 +1,4 @@
1
- ### ⚠️ GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
1
+ ### 🚨 GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
2
2
  Security/Eval:
3
3
  Description: The use of eval represents a serious security risk.
4
4
  Enabled: true
@@ -1,4 +1,4 @@
1
- ### ⚠️ GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
1
+ ### 🚨 GENERATED WITH `script/pull`. DO NOT EDIT MANUALLY. ###
2
2
  Style/AccessModifierDeclarations:
3
3
  Enabled: false
4
4
 
@@ -4,6 +4,7 @@ require:
4
4
  - ../lib/rubocop/cop/captive/translation/rails_i18n_presence.rb
5
5
  - ../lib/rubocop/cop/captive/translation/kaminari_i18n_presence.rb
6
6
  - ../lib/rubocop/cop/captive/string_where_in_scope.rb
7
+ - ../lib/rubocop/cop/captive/no_app_env.rb
7
8
 
8
9
  # ActiveAdmin
9
10
  Captive/ActiveAdmin/ActiveAdminAddonsPresence:
@@ -27,7 +28,11 @@ Captive/Translation/KaminariI18nPresence:
27
28
  Include:
28
29
  - 'Gemfile'
29
30
 
31
+ # other
30
32
  Captive/StringWhereInScope:
31
33
  Description: 'The `where` method should be used in a scope in a model.'
32
34
  Exclude:
33
35
  - 'app/models/**/*'
36
+
37
+ Captive/NoAppEnv:
38
+ Description: "Do not use `APP_ENV` environment variable as it conflicts with standard Rails/Rack environment variable `RAILS_ENV`."
@@ -3,6 +3,6 @@
3
3
  module RuboCop
4
4
  module Captive
5
5
  # Version information for the the Airbnb RuboCop plugin.
6
- VERSION = '1.1.0'
6
+ VERSION = '1.2.0'
7
7
  end
8
8
  end
@@ -4,6 +4,15 @@ module RuboCop
4
4
  module Cop
5
5
  module Captive
6
6
  module ActiveAdmin
7
+ # Ensure to use the gem activeadmin_addons in order to have some additionnal features
8
+ #
9
+ # @example
10
+ # # bad
11
+ # gem 'activeadmin'
12
+ #
13
+ # # good
14
+ # gem 'activeadmin'
15
+ # gem 'activeadmin_addons'
7
16
  class ActiveAdminAddonsPresence < RuboCop::Cop::Cop
8
17
  MSG = "The gem `activeadmin_addons` should be added to the Gemfile "\
9
18
  "if `activeadmin` is present in Gemfile"
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module Cop
5
+ module Captive
6
+ # This cop checks for usages of the `APP_ENV` environment variable.
7
+ # Usage of `APP_ENV` is prohibited as it conflicts with standard Rails/Rack
8
+ # environment variable `RAILS_ENV` and may lead to unexpected results.
9
+ class NoAppEnv < RuboCop::Cop::Cop
10
+ MSG = "Do not use `APP_ENV` environment variable as it conflicts with "\
11
+ "standard Rails/Rack environment variable `RAILS_ENV`."
12
+
13
+ def_node_matcher :env_variable?, <<~PATTERN
14
+ (send
15
+ (const _ :ENV) {:[] :fetch}
16
+ (str "APP_ENV")
17
+ ...
18
+ )
19
+ PATTERN
20
+
21
+ def on_send(node)
22
+ return unless env_variable?(node)
23
+ add_offense(node, message: MSG)
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -3,6 +3,20 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Captive
6
+ ##
7
+ # Prevents to use `where` with string that contains SQL apart from model.
8
+ # Like `where('date > ?', Date.current)`
9
+ # there, you writing a part of SQL.
10
+ # That's why it's important to write this, into a model, in order to respect the MVC architecture
11
+ #
12
+ # @example
13
+ # # bad
14
+ # where('date > ?', Date.current)
15
+ #
16
+ # # good
17
+ # date_after(Date.current)
18
+ #
19
+ # scope :date_after, ->(date) { where('date > ?', date) }
6
20
  class StringWhereInScope < RuboCop::Cop::Cop
7
21
  MSG = 'The `where` method should be used in a scope in a model.'
8
22
 
@@ -4,6 +4,15 @@ module RuboCop
4
4
  module Cop
5
5
  module Captive
6
6
  module Translation
7
+ # Ensure to use the gem devise-i18n in order to have translation
8
+ #
9
+ # @example
10
+ # # bad
11
+ # gem 'devise'
12
+ #
13
+ # # good
14
+ # gem 'devise'
15
+ # gem 'devise-i18n'
7
16
  class DeviseI18nPresence < RuboCop::Cop::Cop
8
17
  MSG = "The gem `devise-i18n` should be added to the Gemfile "\
9
18
  "if `devise` is present in Gemfile"
@@ -6,6 +6,15 @@ module RuboCop
6
6
  module Cop
7
7
  module Captive
8
8
  module Translation
9
+ # Ensure to use the gem kaminari-i18n in order to have translation
10
+ #
11
+ # @example
12
+ # # bad
13
+ # gem 'kaminari'
14
+ #
15
+ # # good
16
+ # gem 'kaminari'
17
+ # gem 'kaminari-i18n'
9
18
  class KaminariI18nPresence < RuboCop::Cop::Cop
10
19
  MSG = "The gem `kaminari-i18n` should be added to the Gemfile "\
11
20
  "if `kaminari` is present in Gemfile"
@@ -6,6 +6,15 @@ module RuboCop
6
6
  module Cop
7
7
  module Captive
8
8
  module Translation
9
+ # Ensure to use the gem rails-i18n in order to have translation
10
+ #
11
+ # @example
12
+ # # bad
13
+ # gem 'rails'
14
+ #
15
+ # # good
16
+ # gem 'rails'
17
+ # gem 'rails-i18n'
9
18
  class RailsI18nPresence < RuboCop::Cop::Cop
10
19
  MSG = "The gem `rails-i18n` should be added to the Gemfile "\
11
20
  "if `rails` is present in Gemfile"
@@ -30,7 +30,7 @@ Gem::Specification.new do |gem|
30
30
  gem.add_dependency('rubocop-rake', '~> 0.6.0')
31
31
  gem.add_dependency('rubocop-rails', '~> 2.18.0')
32
32
  gem.add_dependency('rubocop-rspec', '~> 2.19.0')
33
- gem.add_dependency('rubocop-capybara', '~> 2.17.1')
33
+ gem.add_dependency('rubocop-capybara', '~> 2.18.0')
34
34
  gem.add_development_dependency('rspec', '~> 3.12')
35
35
  # gem.metadata['rubygems_mfa_required'] = 'true'
36
36
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-config-captive
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Captive
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-04-18 00:00:00.000000000 Z
13
+ date: 2023-05-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubocop
@@ -88,14 +88,14 @@ dependencies:
88
88
  requirements:
89
89
  - - "~>"
90
90
  - !ruby/object:Gem::Version
91
- version: 2.17.1
91
+ version: 2.18.0
92
92
  type: :runtime
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - "~>"
97
97
  - !ruby/object:Gem::Version
98
- version: 2.17.1
98
+ version: 2.18.0
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: rspec
101
101
  requirement: !ruby/object:Gem::Requirement
@@ -122,6 +122,7 @@ files:
122
122
  - config/__private__/README.md
123
123
  - config/__private__/rubocop-airbnb.yml
124
124
  - config/__private__/rubocop-bundler.yml
125
+ - config/__private__/rubocop-capybara.yml
125
126
  - config/__private__/rubocop-gemspec.yml
126
127
  - config/__private__/rubocop-layout.yml
127
128
  - config/__private__/rubocop-lint.yml
@@ -152,6 +153,7 @@ files:
152
153
  - lib/rubocop/captive/inject.rb
153
154
  - lib/rubocop/captive/version.rb
154
155
  - lib/rubocop/cop/captive/active_admin/active_admin_addons_presence.rb
156
+ - lib/rubocop/cop/captive/no_app_env.rb
155
157
  - lib/rubocop/cop/captive/string_where_in_scope.rb
156
158
  - lib/rubocop/cop/captive/translation/devise_i18n_presence.rb
157
159
  - lib/rubocop/cop/captive/translation/kaminari_i18n_presence.rb