makandra-rubocop 11.2.0 → 12.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +20 -0
- data/Gemfile.lock +44 -23
- data/README.md +18 -0
- data/config/default.yml +396 -44
- data/config/ext/capybara.yml +105 -0
- data/config/ext/factory_bot.yml +148 -0
- data/config/ext/rails.yml +111 -24
- data/lib/makandra_rubocop/version.rb +1 -1
- data/makandra-rubocop.gemspec +5 -3
- metadata +38 -8
@@ -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: true
|
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/rails.yml
CHANGED
@@ -7,14 +7,19 @@ inherit_mode:
|
|
7
7
|
|
8
8
|
AllCops:
|
9
9
|
Exclude:
|
10
|
-
- 'node_modules/**/*'
|
11
|
-
- 'vendor/**/*'
|
12
10
|
- '.git/**/*'
|
13
|
-
-
|
14
|
-
-
|
15
|
-
-
|
16
|
-
-
|
17
|
-
-
|
11
|
+
- app/assets/**/*
|
12
|
+
- bin/**/*
|
13
|
+
- db/*schema.rb
|
14
|
+
- node_modules/**/*
|
15
|
+
- log/**/*
|
16
|
+
- public/**/*
|
17
|
+
- storage/**/*
|
18
|
+
- tmp/**/*
|
19
|
+
- vendor/**/*
|
20
|
+
# Enable checking Active Support extensions.
|
21
|
+
# See: https://docs.rubocop.org/rubocop/configuration.html#enable-checking-active-support-extensions
|
22
|
+
ActiveSupportExtensionsEnabled: true
|
18
23
|
# What version of Rails is the inspected code using? If a value is specified
|
19
24
|
# for TargetRailsVersion then it is used. Acceptable values are specified
|
20
25
|
# as a float (i.e. 5.1); the patch version of Rails should not be included.
|
@@ -46,6 +51,31 @@ Lint/NumberConversion:
|
|
46
51
|
- in_milliseconds
|
47
52
|
AllowedPatterns: []
|
48
53
|
|
54
|
+
Lint/RedundantSafeNavigation:
|
55
|
+
# Add `presence` and `present?` methods to the default of the RuboCop core.
|
56
|
+
# https://github.com/rubocop/rubocop/blob/v1.51.0/config/default.yml#L2148-L2159
|
57
|
+
AllowedMethods:
|
58
|
+
- instance_of?
|
59
|
+
- kind_of?
|
60
|
+
- is_a?
|
61
|
+
- eql?
|
62
|
+
- respond_to?
|
63
|
+
- equal?
|
64
|
+
- presence
|
65
|
+
- present?
|
66
|
+
|
67
|
+
Lint/SafeNavigationChain:
|
68
|
+
# Add `presence_in` method to the default of the RuboCop core:
|
69
|
+
# https://github.com/rubocop/rubocop/blob/v1.56.0/config/default.yml#L2265-L2271
|
70
|
+
AllowedMethods:
|
71
|
+
- present?
|
72
|
+
- blank?
|
73
|
+
- presence
|
74
|
+
- presence_in
|
75
|
+
- try
|
76
|
+
- try!
|
77
|
+
- in?
|
78
|
+
|
49
79
|
Rails:
|
50
80
|
Enabled: true
|
51
81
|
DocumentationBaseURL: https://docs.rubocop.org/rubocop-rails
|
@@ -68,8 +98,9 @@ Rails/ActionControllerTestCase:
|
|
68
98
|
|
69
99
|
Rails/ActionFilter:
|
70
100
|
Description: 'Enforces consistent use of action filter methods.'
|
71
|
-
Enabled:
|
101
|
+
Enabled: false
|
72
102
|
VersionAdded: '0.19'
|
103
|
+
VersionChanged: '2.22'
|
73
104
|
EnforcedStyle: action
|
74
105
|
SupportedStyles:
|
75
106
|
- action
|
@@ -145,8 +176,9 @@ Rails/AddColumnIndex:
|
|
145
176
|
index might be used.
|
146
177
|
Enabled: true
|
147
178
|
VersionAdded: '2.11'
|
179
|
+
VersionChanged: '2.20'
|
148
180
|
Include:
|
149
|
-
- db
|
181
|
+
- db/**/*.rb
|
150
182
|
|
151
183
|
Rails/AfterCommitOverride:
|
152
184
|
Description: >-
|
@@ -234,12 +266,13 @@ Rails/BulkChangeTable:
|
|
234
266
|
- https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/Table.html
|
235
267
|
Enabled: false # We'll maybe enable this later.
|
236
268
|
VersionAdded: '0.57'
|
269
|
+
VersionChanged: '2.20'
|
237
270
|
Database: null
|
238
271
|
SupportedDatabases:
|
239
272
|
- mysql
|
240
273
|
- postgresql
|
241
274
|
Include:
|
242
|
-
- db
|
275
|
+
- db/**/*.rb
|
243
276
|
|
244
277
|
Rails/CompactBlank:
|
245
278
|
Description: 'Checks if collection can be blank-compacted with `compact_blank`.'
|
@@ -269,18 +302,31 @@ Rails/CreateTableWithTimestamps:
|
|
269
302
|
when creating a new table.
|
270
303
|
Enabled: true
|
271
304
|
VersionAdded: '0.52'
|
305
|
+
VersionChanged: '2.20'
|
272
306
|
Include:
|
273
|
-
- db
|
307
|
+
- db/**/*.rb
|
274
308
|
Exclude:
|
275
309
|
# Respect the `active_storage_variant_records` table of `*_create_active_storage_tables.active_storage.rb`
|
310
|
+
# and `*_create_active_storage_variant_records.active_storage.rb`
|
276
311
|
# auto-generated by `bin/rails active_storage:install` even if `created_at` is not specified.
|
277
|
-
- db
|
312
|
+
- db/**/*_create_active_storage_tables.active_storage.rb
|
313
|
+
- db/**/*_create_active_storage_variant_records.active_storage.rb
|
314
|
+
|
315
|
+
Rails/DangerousColumnNames:
|
316
|
+
Description: >-
|
317
|
+
Avoid dangerous column names.
|
318
|
+
Enabled: pending
|
319
|
+
Severity: warning
|
320
|
+
VersionAdded: '2.21'
|
321
|
+
Include:
|
322
|
+
- 'db/**/*.rb'
|
278
323
|
|
279
324
|
Rails/Date:
|
280
325
|
Description: >-
|
281
|
-
|
282
|
-
|
326
|
+
Checks the correct usage of date aware methods,
|
327
|
+
such as Date.today, Date.current etc.
|
283
328
|
Enabled: false # It's not that simple. Really.
|
329
|
+
SafeAutoCorrect: false
|
284
330
|
VersionAdded: '0.30'
|
285
331
|
VersionChanged: '2.11'
|
286
332
|
# The value `strict` disallows usage of `Date.today`, `Date.current`,
|
@@ -297,7 +343,6 @@ Rails/Date:
|
|
297
343
|
|
298
344
|
Rails/DefaultScope:
|
299
345
|
Description: 'Avoid use of `default_scope`.'
|
300
|
-
StyleGuide: 'https://rails.rubystyle.guide#avoid-default-scope'
|
301
346
|
Enabled: false
|
302
347
|
VersionAdded: '2.7'
|
303
348
|
|
@@ -388,6 +433,11 @@ Rails/EnumUniqueness:
|
|
388
433
|
Include:
|
389
434
|
- app/models/**/*.rb
|
390
435
|
|
436
|
+
Rails/EnvLocal:
|
437
|
+
Description: 'Use `Rails.env.local?` instead of `Rails.env.development? || Rails.env.test?`.'
|
438
|
+
Enabled: pending
|
439
|
+
VersionAdded: '2.22'
|
440
|
+
|
391
441
|
Rails/EnvironmentComparison:
|
392
442
|
Description: "Favor `Rails.env.production?` over `Rails.env == 'production'`."
|
393
443
|
Enabled: true
|
@@ -440,10 +490,8 @@ Rails/FindBy:
|
|
440
490
|
StyleGuide: 'https://rails.rubystyle.guide#find_by'
|
441
491
|
Enabled: false
|
442
492
|
VersionAdded: '0.30'
|
443
|
-
VersionChanged: '2.
|
493
|
+
VersionChanged: '2.21'
|
444
494
|
IgnoreWhereFirst: true
|
445
|
-
Include:
|
446
|
-
- app/models/**/*.rb
|
447
495
|
|
448
496
|
Rails/FindById:
|
449
497
|
Description: >-
|
@@ -459,9 +507,7 @@ Rails/FindEach:
|
|
459
507
|
Enabled: true
|
460
508
|
Safe: false
|
461
509
|
VersionAdded: '0.30'
|
462
|
-
VersionChanged: '2.
|
463
|
-
Include:
|
464
|
-
- app/models/**/*.rb
|
510
|
+
VersionChanged: '2.21'
|
465
511
|
AllowedMethods:
|
466
512
|
# Methods that don't work well with `find_each`.
|
467
513
|
- order
|
@@ -524,6 +570,10 @@ Rails/I18nLazyLookup:
|
|
524
570
|
Reference: 'https://guides.rubyonrails.org/i18n.html#lazy-lookup'
|
525
571
|
Enabled: true
|
526
572
|
VersionAdded: '2.14'
|
573
|
+
EnforcedStyle: lazy
|
574
|
+
SupportedStyles:
|
575
|
+
- lazy
|
576
|
+
- explicit
|
527
577
|
Include:
|
528
578
|
- 'app/controllers/**/*.rb'
|
529
579
|
|
@@ -629,8 +679,9 @@ Rails/MigrationClassName:
|
|
629
679
|
Description: 'The class name of the migration should match its file name.'
|
630
680
|
Enabled: true
|
631
681
|
VersionAdded: '2.14'
|
682
|
+
VersionChanged: '2.20'
|
632
683
|
Include:
|
633
|
-
- db
|
684
|
+
- db/**/*.rb
|
634
685
|
|
635
686
|
Rails/NegateInclude:
|
636
687
|
Description: 'Prefer `collection.exclude?(obj)` over `!collection.include?(obj)`.'
|
@@ -644,8 +695,12 @@ Rails/NotNullColumn:
|
|
644
695
|
Description: 'Do not add a NOT NULL column without a default value.'
|
645
696
|
Enabled: true
|
646
697
|
VersionAdded: '0.43'
|
698
|
+
VersionChanged: '2.20'
|
699
|
+
Database: null
|
700
|
+
SupportedDatabases:
|
701
|
+
- mysql
|
647
702
|
Include:
|
648
|
-
- db
|
703
|
+
- db/**/*.rb
|
649
704
|
|
650
705
|
Rails/OrderById:
|
651
706
|
Description: >-
|
@@ -750,6 +805,16 @@ Rails/ReadWriteAttribute:
|
|
750
805
|
Include:
|
751
806
|
- app/models/**/*.rb
|
752
807
|
|
808
|
+
Rails/RedundantActiveRecordAllMethod:
|
809
|
+
Description: Detect redundant `all` used as a receiver for Active Record query methods.
|
810
|
+
StyleGuide: 'https://rails.rubystyle.guide/#redundant-all'
|
811
|
+
Enabled: false # While we agree that User.all.find is redundant, it can be useful to make relation access more explicit for other query methods.
|
812
|
+
Safe: false
|
813
|
+
AllowedReceivers:
|
814
|
+
- ActionMailer::Preview
|
815
|
+
- ActiveSupport::TimeZone
|
816
|
+
VersionAdded: '2.21'
|
817
|
+
|
753
818
|
Rails/RedundantAllowNil:
|
754
819
|
Description: >-
|
755
820
|
Finds redundant use of `allow_nil` when `allow_blank` is set to
|
@@ -838,7 +903,7 @@ Rails/RequireDependency:
|
|
838
903
|
VersionAdded: '2.10'
|
839
904
|
|
840
905
|
Rails/ResponseParsedBody:
|
841
|
-
Description: Prefer `response.parsed_body` to `
|
906
|
+
Description: Prefer `response.parsed_body` to custom parsing logic for `response.body`.
|
842
907
|
Enabled: true
|
843
908
|
Safe: false
|
844
909
|
VersionAdded: '2.18'
|
@@ -930,6 +995,12 @@ Rails/ScopeArgs:
|
|
930
995
|
Include:
|
931
996
|
- app/models/**/*.rb
|
932
997
|
|
998
|
+
Rails/SelectMap:
|
999
|
+
Description: 'Checks for uses of `select(:column_name)` with `map(&:column_name)`.'
|
1000
|
+
Enabled: pending
|
1001
|
+
Safe: false
|
1002
|
+
VersionAdded: '2.21'
|
1003
|
+
|
933
1004
|
Rails/ShortI18n:
|
934
1005
|
Description: 'Use the short form of the I18n methods: `t` instead of `translate` and `l` instead of `localize`.'
|
935
1006
|
StyleGuide: 'https://rails.rubystyle.guide/#short-i18n'
|
@@ -1058,6 +1129,7 @@ Rails/TransactionExitStatement:
|
|
1058
1129
|
- https://github.com/rails/rails/commit/15aa4200e083
|
1059
1130
|
Enabled: true # Get a head start on deprecations: https://blog.saeloun.com/2020/04/06/rails-disallow-return-break-and-throw-to-exit-transaction.html
|
1060
1131
|
VersionAdded: '2.14'
|
1132
|
+
TransactionMethods: []
|
1061
1133
|
|
1062
1134
|
Rails/UniqBeforePluck:
|
1063
1135
|
Description: 'Prefer the use of uniq or distinct before pluck.'
|
@@ -1095,6 +1167,12 @@ Rails/UnusedIgnoredColumns:
|
|
1095
1167
|
Include:
|
1096
1168
|
- app/models/**/*.rb
|
1097
1169
|
|
1170
|
+
Rails/UnusedRenderContent:
|
1171
|
+
Description: 'Do not specify body content for a response with a non-content status code.'
|
1172
|
+
Enabled: pending
|
1173
|
+
Severity: warning
|
1174
|
+
VersionAdded: '2.21'
|
1175
|
+
|
1098
1176
|
Rails/Validation:
|
1099
1177
|
Description: 'Use validates :attribute, hash of validations.'
|
1100
1178
|
Enabled: true
|
@@ -1134,6 +1212,7 @@ Rails/WhereNot:
|
|
1134
1212
|
|
1135
1213
|
Rails/WhereNotWithMultipleConditions:
|
1136
1214
|
Description: 'Do not use `where.not(...)` with multiple conditions.'
|
1215
|
+
StyleGuide: 'https://rails.rubystyle.guide/#where-not-with-multiple-attributes'
|
1137
1216
|
Enabled: true
|
1138
1217
|
Severity: warning
|
1139
1218
|
VersionAdded: '2.17'
|
@@ -1147,6 +1226,14 @@ Style/FormatStringToken:
|
|
1147
1226
|
AllowedMethods:
|
1148
1227
|
- redirect
|
1149
1228
|
|
1229
|
+
Style/InvertibleUnlessCondition:
|
1230
|
+
InverseMethods:
|
1231
|
+
# Active Support defines some common inverse methods. They are listed below:
|
1232
|
+
:present?: :blank?
|
1233
|
+
:blank?: :present?
|
1234
|
+
:include?: :exclude?
|
1235
|
+
:exclude?: :include?
|
1236
|
+
|
1150
1237
|
Style/SymbolProc:
|
1151
1238
|
AllowedMethods:
|
1152
1239
|
- define_method
|
data/makandra-rubocop.gemspec
CHANGED
@@ -5,7 +5,7 @@ require 'makandra_rubocop/version'
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'makandra-rubocop'
|
7
7
|
spec.version = MakandraRubocop::VERSION
|
8
|
-
spec.required_ruby_version = '>= 2.
|
8
|
+
spec.required_ruby_version = '>= 2.7.0'
|
9
9
|
spec.authors = ['Arne Hartherz', 'Emanuel Denzel']
|
10
10
|
spec.email = ['arne.hartherz@makandra.de', 'emanuel.denzel@makandra.de']
|
11
11
|
|
@@ -24,9 +24,11 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.executables = spec.files.grep(%r(^exe/)) { |f| File.basename(f) }
|
25
25
|
spec.require_paths = ['lib']
|
26
26
|
|
27
|
-
spec.add_dependency 'rubocop', '~> 1.
|
28
|
-
spec.add_dependency 'rubocop-rails', '~> 2.
|
27
|
+
spec.add_dependency 'rubocop', '~> 1.60.0'
|
28
|
+
spec.add_dependency 'rubocop-rails', '~> 2.23.1'
|
29
29
|
spec.add_dependency 'rubocop-rspec', '~> 2.13.2'
|
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:
|
4
|
+
version: 12.1.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:
|
12
|
+
date: 2024-02-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rubocop
|
@@ -17,28 +17,28 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 1.
|
20
|
+
version: 1.60.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 1.
|
27
|
+
version: 1.60.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rubocop-rails
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 2.
|
34
|
+
version: 2.23.1
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: 2.
|
41
|
+
version: 2.23.1
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rubocop-rspec
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,6 +53,34 @@ dependencies:
|
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: 2.13.2
|
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
|
@@ -120,14 +150,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
120
150
|
requirements:
|
121
151
|
- - ">="
|
122
152
|
- !ruby/object:Gem::Version
|
123
|
-
version: 2.
|
153
|
+
version: 2.7.0
|
124
154
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
155
|
requirements:
|
126
156
|
- - ">="
|
127
157
|
- !ruby/object:Gem::Version
|
128
158
|
version: '0'
|
129
159
|
requirements: []
|
130
|
-
rubygems_version: 3.
|
160
|
+
rubygems_version: 3.1.6
|
131
161
|
signing_key:
|
132
162
|
specification_version: 4
|
133
163
|
summary: makandra's default Rubocop configuration
|