Skip to content

Commit bb8b429

Browse files
authored
Merge pull request #3598 from projectblacklight/rubocop
Add new rubocops and regnerate todo
2 parents 1bffac5 + 35685ac commit bb8b429

File tree

2 files changed

+66
-48
lines changed

2 files changed

+66
-48
lines changed

.rubocop.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require:
1+
plugins:
22
- rubocop-capybara
33
- rubocop-rspec
44
- rubocop-rspec_rails
@@ -631,3 +631,25 @@ Rails/MultipleRoutePaths: # new in 2.29
631631
Enabled: true
632632
Rails/StrongParametersExpect: # new in 2.29
633633
Enabled: true
634+
Lint/CopDirectiveSyntax: # new in 1.72
635+
Enabled: true
636+
Lint/RedundantTypeConversion: # new in 1.72
637+
Enabled: true
638+
Lint/SuppressedExceptionInNumberConversion: # new in 1.72
639+
Enabled: true
640+
Lint/UselessConstantScoping: # new in 1.72
641+
Enabled: true
642+
Style/ComparableBetween: # new in 1.74
643+
Enabled: true
644+
Style/HashFetchChain: # new in 1.75
645+
Enabled: true
646+
Style/ItBlockParameter: # new in 1.75
647+
Enabled: true
648+
Style/RedundantFormat: # new in 1.72
649+
Enabled: true
650+
Capybara/FindAllFirst: # new in 2.22
651+
Enabled: true
652+
Capybara/NegationMatcherAfterVisit: # new in 2.22
653+
Enabled: true
654+
RSpec/IncludeExamples: # new in 3.6
655+
Enabled: true

.rubocop_todo.yml

Lines changed: 43 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2024-09-03 14:22:19 UTC using RuboCop version 1.66.0.
3+
# on 2025-05-09 14:34:28 UTC using RuboCop version 1.75.5.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
@@ -12,6 +12,16 @@ Capybara/CurrentPathExpectation:
1212
Exclude:
1313
- 'spec/features/alternate_controller_spec.rb'
1414

15+
# Offense count: 7
16+
Capybara/NegationMatcherAfterVisit:
17+
Exclude:
18+
- 'spec/features/bookmarks_spec.rb'
19+
- 'spec/features/facets_spec.rb'
20+
- 'spec/features/modal_spec.rb'
21+
- 'spec/features/record_view_spec.rb'
22+
- 'spec/features/search_context_spec.rb'
23+
- 'spec/features/sitelinks_search_box_spec.rb'
24+
1525
# Offense count: 13
1626
Capybara/VisibilityMatcher:
1727
Exclude:
@@ -35,7 +45,7 @@ Lint/AmbiguousOperator:
3545
- 'spec/models/blacklight/facet_paginator_spec.rb'
3646
- 'spec/services/blacklight/search_service_spec.rb'
3747

38-
# Offense count: 45
48+
# Offense count: 43
3949
# This cop supports safe autocorrection (--autocorrect).
4050
Lint/AmbiguousRegexpLiteral:
4151
Exclude:
@@ -45,7 +55,6 @@ Lint/AmbiguousRegexpLiteral:
4555
- 'spec/helpers/catalog_helper_spec.rb'
4656
- 'spec/models/record_mailer_spec.rb'
4757
- 'spec/views/catalog/_document.html.erb_spec.rb'
48-
- 'spec/views/catalog/_search_header.erb_spec.rb'
4958
- 'spec/views/catalog/_sort_and_per_page.html.erb_spec.rb'
5059
- 'spec/views/catalog/index.html.erb_spec.rb'
5160
- 'spec/views/catalog/show.html.erb_spec.rb'
@@ -75,7 +84,7 @@ Lint/EmptyBlock:
7584
- 'app/controllers/concerns/blacklight/bookmarks.rb'
7685
- 'lib/blacklight/solr/search_builder_behavior.rb'
7786

78-
# Offense count: 48
87+
# Offense count: 50
7988
# Configuration parameters: AllowedParentClasses.
8089
Lint/MissingSuper:
8190
Enabled: false
@@ -90,12 +99,7 @@ Lint/ParenthesesAsGroupedExpression:
9099
- 'spec/features/search_spec.rb'
91100
- 'spec/models/blacklight/solr/repository_spec.rb'
92101

93-
# Offense count: 2
94-
Lint/ShadowingOuterLocalVariable:
95-
Exclude:
96-
- 'spec/models/blacklight/configuration_spec.rb'
97-
98-
# Offense count: 83
102+
# Offense count: 81
99103
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
100104
Metrics/AbcSize:
101105
Max: 46
@@ -106,27 +110,27 @@ Metrics/AbcSize:
106110
Metrics/BlockLength:
107111
Max: 26
108112

109-
# Offense count: 42
113+
# Offense count: 40
110114
# Configuration parameters: AllowedMethods, AllowedPatterns.
111115
Metrics/CyclomaticComplexity:
112-
Max: 14
116+
Max: 13
113117

114-
# Offense count: 78
118+
# Offense count: 77
115119
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
116120
Metrics/MethodLength:
117121
Max: 27
118122

119-
# Offense count: 4
123+
# Offense count: 3
120124
# Configuration parameters: CountComments, CountAsOne.
121125
Metrics/ModuleLength:
122-
Max: 124
126+
Max: 114
123127

124-
# Offense count: 8
128+
# Offense count: 7
125129
# Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
126130
Metrics/ParameterLists:
127131
Max: 6
128132

129-
# Offense count: 36
133+
# Offense count: 33
130134
# Configuration parameters: AllowedMethods, AllowedPatterns.
131135
Metrics/PerceivedComplexity:
132136
Max: 14
@@ -155,7 +159,7 @@ Naming/MethodParameterName:
155159
# Offense count: 9
156160
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
157161
# SupportedStyles: snake_case, normalcase, non_integer
158-
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
162+
# AllowedIdentifiers: TLS1_1, TLS1_2, capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
159163
Naming/VariableNumber:
160164
Exclude:
161165
- 'spec/lib/blacklight/search_state_spec.rb'
@@ -175,7 +179,7 @@ RSpec/BeforeAfterAll:
175179
RSpec/ContextWording:
176180
Enabled: false
177181

178-
# Offense count: 138
182+
# Offense count: 146
179183
# Configuration parameters: CountAsOne.
180184
RSpec/ExampleLength:
181185
Max: 33
@@ -226,7 +230,7 @@ RSpec/MessageChain:
226230
- 'spec/presenters/blacklight/field_presenter_spec.rb'
227231
- 'spec/views/shared/_user_util_links.html.erb_spec.rb'
228232

229-
# Offense count: 28
233+
# Offense count: 27
230234
# Configuration parameters: EnforcedStyle.
231235
# SupportedStyles: have_received, receive
232236
RSpec/MessageSpies:
@@ -240,22 +244,22 @@ RSpec/MessageSpies:
240244
- 'spec/models/blacklight/suggest_search_spec.rb'
241245
- 'spec/presenters/blacklight/field_presenter_spec.rb'
242246

243-
# Offense count: 390
247+
# Offense count: 401
244248
RSpec/MultipleExpectations:
245249
Max: 16
246250

247-
# Offense count: 292
251+
# Offense count: 294
248252
# Configuration parameters: AllowSubject.
249253
RSpec/MultipleMemoizedHelpers:
250254
Max: 14
251255

252-
# Offense count: 399
256+
# Offense count: 431
253257
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
254258
# SupportedStyles: always, named_only
255259
RSpec/NamedSubject:
256260
Enabled: false
257261

258-
# Offense count: 60
262+
# Offense count: 62
259263
# Configuration parameters: AllowedGroups.
260264
RSpec/NestedGroups:
261265
Max: 5
@@ -283,7 +287,7 @@ RSpec/ScatteredLet:
283287
Exclude:
284288
- 'spec/views/catalog/index.atom.builder_spec.rb'
285289

286-
# Offense count: 20
290+
# Offense count: 19
287291
RSpec/StubbedMock:
288292
Exclude:
289293
- 'spec/controllers/catalog_controller_spec.rb'
@@ -309,7 +313,7 @@ RSpec/SubjectStub:
309313
- 'spec/presenters/blacklight/document_presenter_spec.rb'
310314
- 'spec/services/blacklight/search_service_spec.rb'
311315

312-
# Offense count: 80
316+
# Offense count: 79
313317
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
314318
RSpec/VerifiedDoubles:
315319
Enabled: false
@@ -322,7 +326,7 @@ Rails/Date:
322326
Exclude:
323327
- 'spec/models/search_spec.rb'
324328

325-
# Offense count: 20
329+
# Offense count: 17
326330
# Configuration parameters: Include.
327331
# Include: app/helpers/**/*.rb
328332
Rails/HelperInstanceVariable:
@@ -345,7 +349,7 @@ Rails/OutputSafety:
345349
Exclude:
346350
- 'app/presenters/blacklight/rendering/join.rb'
347351

348-
# Offense count: 14
352+
# Offense count: 15
349353
Security/Eval:
350354
Exclude:
351355
- 'spec/models/blacklight/solr/response_spec.rb'
@@ -377,8 +381,10 @@ Style/BlockDelimiters:
377381

378382
# Offense count: 52
379383
# This cop supports unsafe autocorrection (--autocorrect-all).
380-
# Configuration parameters: EnforcedStyle.
384+
# Configuration parameters: EnforcedStyle, EnforcedStyleForClasses, EnforcedStyleForModules.
381385
# SupportedStyles: nested, compact
386+
# SupportedStylesForClasses: , nested, compact
387+
# SupportedStylesForModules: , nested, compact
382388
Style/ClassAndModuleChildren:
383389
Enabled: false
384390

@@ -403,7 +409,7 @@ Style/DocumentDynamicEvalDefinition:
403409
- 'app/builders/blacklight/action_builder.rb'
404410
- 'lib/blacklight/configuration/fields.rb'
405411

406-
# Offense count: 133
412+
# Offense count: 131
407413
# Configuration parameters: AllowedConstants.
408414
Style/Documentation:
409415
Enabled: false
@@ -422,9 +428,9 @@ Style/ExpandPathArguments:
422428
- 'lib/generators/blacklight/test_support_generator.rb'
423429
- 'lib/generators/blacklight/user_generator.rb'
424430

425-
# Offense count: 16
431+
# Offense count: 17
426432
# This cop supports safe autocorrection (--autocorrect).
427-
# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns.
433+
# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, Mode, AllowedMethods, AllowedPatterns.
428434
# SupportedStyles: annotated, template, unannotated
429435
# AllowedMethods: redirect
430436
Style/FormatStringToken:
@@ -441,18 +447,17 @@ Style/GuardClause:
441447
- 'app/helpers/blacklight/catalog_helper_behavior.rb'
442448
- 'lib/blacklight/solr/search_builder_behavior.rb'
443449

444-
# Offense count: 29
450+
# Offense count: 30
445451
# This cop supports safe autocorrection (--autocorrect).
446452
Style/IfUnlessModifier:
447453
Enabled: false
448454

449-
# Offense count: 6
455+
# Offense count: 4
450456
# This cop supports safe autocorrection (--autocorrect).
451457
Style/MultilineIfModifier:
452458
Exclude:
453459
- 'app/views/catalog/index.atom.builder'
454460
- 'lib/blacklight/solr/response/facets.rb'
455-
- 'lib/blacklight/solr/search_builder_behavior.rb'
456461

457462
# Offense count: 1
458463
# This cop supports safe autocorrection (--autocorrect).
@@ -461,15 +466,7 @@ Style/MultipleComparison:
461466
Exclude:
462467
- 'lib/blacklight/configuration/context.rb'
463468

464-
# Offense count: 2
465-
# This cop supports unsafe autocorrection (--autocorrect-all).
466-
# Configuration parameters: EnforcedStyle.
467-
# SupportedStyles: literals, strict
468-
Style/MutableConstant:
469-
Exclude:
470-
- 'lib/blacklight/solr/request.rb'
471-
472-
# Offense count: 9
469+
# Offense count: 8
473470
# This cop supports unsafe autocorrection (--autocorrect-all).
474471
# Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
475472
# SupportedStyles: predicate, comparison
@@ -501,13 +498,12 @@ Style/ParenthesesAroundCondition:
501498
Exclude:
502499
- 'app/views/catalog/_document.atom.builder'
503500

504-
# Offense count: 3
501+
# Offense count: 1
505502
# This cop supports safe autocorrection (--autocorrect).
506503
# Configuration parameters: PreferredDelimiters.
507504
Style/PercentLiteralDelimiters:
508505
Exclude:
509506
- 'lib/blacklight/engine.rb'
510-
- 'lib/blacklight/solr/request.rb'
511507

512508
# Offense count: 2
513509
# This cop supports safe autocorrection (--autocorrect).
@@ -541,7 +537,7 @@ Style/SoleNestedConditional:
541537
Exclude:
542538
- 'app/controllers/concerns/blacklight/controller.rb'
543539

544-
# Offense count: 32
540+
# Offense count: 31
545541
# This cop supports safe autocorrection (--autocorrect).
546542
# Configuration parameters: MinSize.
547543
# SupportedStyles: percent, brackets

0 commit comments

Comments
 (0)