Skip to content

Commit fd2e856

Browse files
committed
chore(rubocop): update version
1 parent ea2d2ae commit fd2e856

File tree

3 files changed

+176
-52
lines changed

3 files changed

+176
-52
lines changed

.rubocop.yml

Lines changed: 122 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1+
require:
2+
- rubocop-rspec
3+
- rubocop-rails
4+
- rubocop-performance
15
AllCops:
26
Exclude:
37
- "vendor/**/*"
48
- "spec/dummy/db/schema.rb"
59
- "db/schema.rb"
610
- "bin/**/*"
711
- "spec/dummy/db/schema.rb"
8-
DisplayCopNames: false
912
TargetRubyVersion: 2.7
1013
Rails:
1114
Enabled: true
12-
Layout/AlignParameters:
15+
Performance:
16+
Enabled: true
17+
Layout/ParameterAlignment:
1318
Description: Align the parameters of a method call if they span more than one line.
1419
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-double-indent
1520
Enabled: true
@@ -121,7 +126,7 @@ Naming/PredicateName:
121126
- is_
122127
- has_
123128
- have_
124-
NamePrefixBlacklist:
129+
ForbiddenPrefixes:
125130
- is_
126131
Style/RaiseArgs:
127132
Description: Checks the arguments passed to raise/fail.
@@ -172,7 +177,7 @@ Style/TrivialAccessors:
172177
ExactNameMatch: false
173178
AllowPredicates: false
174179
AllowDSLWriters: false
175-
Whitelist:
180+
AllowedMethods:
176181
- to_ary
177182
- to_a
178183
- to_c
@@ -200,6 +205,17 @@ Style/WordArray:
200205
Enabled: false
201206
MinSize: 0
202207
WordRegex: !ruby/regexp /\A[\p{Word}]+\z/
208+
Style/ExponentialNotation:
209+
Enabled: true
210+
Style/HashEachMethods:
211+
Description: Use Hash#each_key and Hash#each_value.
212+
Enabled: true
213+
Style/HashTransformKeys:
214+
Description: Prefer `transform_keys` over `each_with_object` and `map`.
215+
Enabled: true
216+
Style/HashTransformValues:
217+
Description: Prefer `transform_values` over `each_with_object` and `map`.
218+
Enabled: true
203219
Metrics/AbcSize:
204220
Description: A calculated magnitude based on number of assignments, branches, and
205221
conditions.
@@ -215,15 +231,6 @@ Metrics/ClassLength:
215231
Enabled: false
216232
CountComments: false
217233
Max: 100
218-
Metrics/LineLength:
219-
Description: Limit lines to 100 characters.
220-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#100-character-limits
221-
Enabled: true
222-
Max: 100
223-
AllowURI: true
224-
URISchemes:
225-
- http
226-
- https
227234
Metrics/MethodLength:
228235
Description: Avoid methods longer than 15 lines of code.
229236
StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
@@ -243,6 +250,15 @@ Lint/AssignmentInCondition:
243250
StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
244251
Enabled: false
245252
AllowSafeAssignment: true
253+
Layout/LineLength:
254+
Description: Limit lines to 100 characters.
255+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#100-character-limits
256+
Enabled: true
257+
Max: 100
258+
AllowURI: true
259+
URISchemes:
260+
- http
261+
- https
246262
Layout/EndAlignment:
247263
Description: Align ends correctly.
248264
Enabled: true
@@ -257,13 +273,69 @@ Layout/DefEndAlignment:
257273
SupportedStylesAlignWith:
258274
- start_of_line
259275
- def
276+
Layout/SpaceAroundMethodCallOperator:
277+
Description: Checks method call operators to not have spaces around them.
278+
Enabled: true
260279
Style/SymbolArray:
261280
Description: Use %i or %I for arrays of symbols.
262281
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-i
263282
Enabled: false
264283
Layout/ExtraSpacing:
265284
Description: Do not use unnecessary spacing.
266285
Enabled: false
286+
Layout/ClassStructure:
287+
Enabled: true
288+
Categories:
289+
validation:
290+
- validate
291+
- validates
292+
association:
293+
- belongs_to
294+
- has_one
295+
- has_many
296+
- has_and_belongs_to_many
297+
attribute_macros:
298+
- attribute
299+
- attr_accessor
300+
- attr_reader
301+
- attr_writer
302+
callbacks:
303+
- before_validation
304+
- after_validation
305+
- before_save
306+
- before_create
307+
- after_create
308+
- after_save
309+
- after_commit
310+
- after_create_commit
311+
other_macros:
312+
- devise
313+
- acts_as_token_authenticatable
314+
- accepts_nested_attributes_for
315+
- humanize
316+
- monetize
317+
scope:
318+
- scope
319+
- pg_search_scope
320+
ExpectedOrder:
321+
- module_inclusion
322+
- constants
323+
- public_attribute_macros
324+
- association
325+
- validation
326+
- enum
327+
- aasm
328+
- scope
329+
- public_delegate
330+
- other_macros
331+
- class_methods
332+
- initializer
333+
- public_methods
334+
- protected_attribute_macros
335+
- protected_methods
336+
- private_attribute_macros
337+
- private_delegate
338+
- private_methods
267339
Naming/AccessorMethodName:
268340
Description: Check the naming of accessor methods for get_/set_.
269341
Enabled: false
@@ -444,7 +516,7 @@ Lint/DeprecatedClassMethods:
444516
Lint/ElseLayout:
445517
Description: Check for odd code arrangement in an else block.
446518
Enabled: false
447-
Lint/HandleExceptions:
519+
Lint/SuppressedException:
448520
Description: Don't suppress exception.
449521
StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
450522
Enabled: false
@@ -472,10 +544,43 @@ Lint/UnderscorePrefixedVariableName:
472544
Lint/Void:
473545
Description: Possible use of operator/literal/variable in void context.
474546
Enabled: false
475-
Rails/Delegate:
476-
Description: Prefer delegate method for delegations.
477-
Enabled: false
547+
Lint/RaiseException:
548+
Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
549+
Enabled: true
550+
Lint/StructNewOverride:
551+
Description: Disallow overriding the `Struct` built-in methods via `Struct.new`.
552+
Enabled: true
478553
Performance/RedundantBlockCall:
479554
Description: Use `yield` instead of `block.call`.
480555
Reference: https://github.com/JuanitoFatas/fast-ruby#proccall-vs-yield-code
481556
Enabled: false
557+
Style/OptionalBooleanParameter:
558+
Description: 'Use keyword arguments when defining method with boolean argument.'
559+
Enabled: false
560+
Lint/MissingSuper:
561+
Description: >-
562+
This cop checks for the presence of constructors and lifecycle callbacks
563+
without calls to `super`'.
564+
Enabled: false
565+
Style/RedundantFileExtensionInRequire:
566+
Description: >-
567+
Checks for the presence of superfluous `.rb` extension in
568+
the filename provided to `require` and `require_relative`.
569+
Enabled: false
570+
Gemspec/RequiredRubyVersion:
571+
Enabled: false
572+
RSpec/MultipleExpectations:
573+
Max: 5
574+
RSpec/NestedGroups:
575+
Max: 5
576+
RSpec/ExampleLength:
577+
Max: 10
578+
RSpec/LetSetup:
579+
Enabled: false
580+
RSpec/ExpectChange:
581+
Enabled: true
582+
EnforcedStyle: block
583+
RSpec/FilePath:
584+
Enabled: false
585+
RSpec/InstanceVariable:
586+
Enabled: false

Gemfile.lock

Lines changed: 46 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -87,20 +87,21 @@ GEM
8787
minitest (>= 5.1)
8888
tzinfo (~> 2.0)
8989
zeitwerk (~> 2.3)
90-
addressable (2.8.0)
91-
public_suffix (>= 2.0.2, < 5.0)
90+
addressable (2.8.4)
91+
public_suffix (>= 2.0.2, < 6.0)
9292
arbre (1.5.0)
9393
activesupport (>= 3.0.0, < 7.1)
9494
ruby2_keywords (>= 0.0.2, < 1.0)
95-
ast (2.4.0)
95+
ast (2.4.2)
9696
builder (3.2.4)
97-
capybara (3.31.0)
97+
capybara (3.39.0)
9898
addressable
99+
matrix
99100
mini_mime (>= 0.1.3)
100101
nokogiri (~> 1.8)
101102
rack (>= 1.6.0)
102103
rack-test (>= 0.6.3)
103-
regexp_parser (~> 1.5)
104+
regexp_parser (>= 1.5, < 3.0)
104105
xpath (~> 3.2)
105106
capybara-selenium (0.0.6)
106107
capybara
@@ -154,11 +155,11 @@ GEM
154155
has_scope (~> 0.6)
155156
railties (>= 5.2, < 7.1)
156157
responders (>= 2, < 4)
157-
jaro_winkler (1.5.4)
158158
jquery-rails (4.5.1)
159159
rails-dom-testing (>= 1, < 3)
160160
railties (>= 4.2.0)
161161
thor (>= 0.14, < 2.0)
162+
json (2.6.3)
162163
kaminari (1.2.2)
163164
activesupport (>= 4.1.0)
164165
kaminari-actionview (= 1.2.2)
@@ -185,34 +186,32 @@ GEM
185186
method_source (0.9.2)
186187
mini_magick (4.11.0)
187188
mini_mime (1.1.2)
188-
mini_portile2 (2.8.0)
189+
mini_portile2 (2.8.1)
189190
minitest (5.16.3)
190191
nenv (0.3.0)
191192
nio4r (2.5.8)
192-
nokogiri (1.13.9)
193+
nokogiri (1.14.3)
193194
mini_portile2 (~> 2.8.0)
194195
racc (~> 1.4)
195196
notiffany (0.1.3)
196197
nenv (~> 0.1)
197198
shellany (~> 0.0)
198-
parallel (1.19.1)
199-
parser (2.7.1.2)
200-
ast (~> 2.4.0)
201-
powerpack (0.1.2)
199+
parallel (1.22.1)
200+
parser (3.2.2.0)
201+
ast (~> 2.4.1)
202202
pry (0.12.2)
203203
coderay (~> 1.1.0)
204204
method_source (~> 0.9.0)
205205
pry-rails (0.3.9)
206206
pry (>= 0.10.4)
207-
psych (3.1.0)
208-
public_suffix (4.0.6)
207+
public_suffix (5.0.1)
209208
puma (5.3.1)
210209
nio4r (~> 2.0)
211-
racc (1.6.0)
212-
rack (2.2.4)
210+
racc (1.6.2)
211+
rack (2.2.6.4)
213212
rack-proxy (0.6.5)
214213
rack
215-
rack-test (2.0.2)
214+
rack-test (2.1.0)
216215
rack (>= 1.3)
217216
rails (6.1.7)
218217
actioncable (= 6.1.7)
@@ -240,7 +239,7 @@ GEM
240239
method_source
241240
rake (>= 12.2)
242241
thor (~> 1.0)
243-
rainbow (3.0.0)
242+
rainbow (3.1.1)
244243
rake (13.0.6)
245244
ransack (3.0.1)
246245
activerecord (>= 6.0.4)
@@ -250,7 +249,7 @@ GEM
250249
rb-inotify (0.10.1)
251250
ffi (~> 1.0)
252251
redcarpet (3.6.0)
253-
regexp_parser (1.6.0)
252+
regexp_parser (2.7.0)
254253
require_all (3.0.0)
255254
responders (3.0.1)
256255
actionpack (>= 5.0)
@@ -281,20 +280,35 @@ GEM
281280
rspec-support (3.9.2)
282281
rspec_junit_formatter (0.4.1)
283282
rspec-core (>= 2, < 4, != 2.12.0)
284-
rubocop (0.65.0)
285-
jaro_winkler (~> 1.5.1)
283+
rubocop (1.50.1)
284+
json (~> 2.3)
286285
parallel (~> 1.10)
287-
parser (>= 2.5, != 2.5.1.1)
288-
powerpack (~> 0.1)
289-
psych (>= 3.1.0)
286+
parser (>= 3.2.0.0)
290287
rainbow (>= 2.2.2, < 4.0)
288+
regexp_parser (>= 1.8, < 3.0)
289+
rexml (>= 3.2.5, < 4.0)
290+
rubocop-ast (>= 1.28.0, < 2.0)
291291
ruby-progressbar (~> 1.7)
292-
unicode-display_width (~> 1.4.0)
293-
ruby-progressbar (1.10.1)
292+
unicode-display_width (>= 2.4.0, < 3.0)
293+
rubocop-ast (1.28.0)
294+
parser (>= 3.2.1.0)
295+
rubocop-capybara (2.17.1)
296+
rubocop (~> 1.41)
297+
rubocop-performance (1.17.1)
298+
rubocop (>= 1.7.0, < 2.0)
299+
rubocop-ast (>= 0.4.0)
300+
rubocop-rails (2.19.0)
301+
activesupport (>= 4.2.0)
302+
rack (>= 1.1)
303+
rubocop (>= 1.33.0, < 2.0)
304+
rubocop-rspec (2.19.0)
305+
rubocop (~> 1.33)
306+
rubocop-capybara (~> 2.17)
307+
ruby-progressbar (1.13.0)
294308
ruby-vips (2.1.4)
295309
ffi (~> 1.12)
296310
ruby2_keywords (0.0.5)
297-
rubyzip (2.2.0)
311+
rubyzip (2.3.2)
298312
selenium-webdriver (3.142.7)
299313
childprocess (>= 0.5, < 4.0)
300314
rubyzip (>= 1.2.2)
@@ -316,7 +330,7 @@ GEM
316330
thor (1.2.1)
317331
tzinfo (2.0.5)
318332
concurrent-ruby (~> 1.0)
319-
unicode-display_width (1.4.1)
333+
unicode-display_width (2.4.2)
320334
webdrivers (4.2.0)
321335
nokogiri (~> 1.6)
322336
rubyzip (>= 1.3.0)
@@ -358,7 +372,10 @@ DEPENDENCIES
358372
rspec-rails
359373
rspec-retry
360374
rspec_junit_formatter
361-
rubocop (~> 0.65.0)
375+
rubocop (~> 1.50)
376+
rubocop-performance
377+
rubocop-rails
378+
rubocop-rspec (~> 2.2)
362379
shoulda-matchers
363380
shrine (~> 3.0)
364381
sqlite3

0 commit comments

Comments
 (0)