Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to rubocop 1.x #1008

Merged
merged 2 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require:
- rubocop-performance

AllCops:
TargetRubyVersion: 2.5
TargetRubyVersion: 3.1
DisplayCopNames: true
Exclude:
- 'Gemfile'
Expand Down
113 changes: 51 additions & 62 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2023-01-18 22:57:39 UTC using RuboCop version 0.93.1.
# on 2023-11-03 20:55:41 UTC using RuboCop version 1.57.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 7
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: symmetrical, new_line, same_line
Layout/MultilineMethodCallBraceLayout:
Expand All @@ -16,21 +16,21 @@ Layout/MultilineMethodCallBraceLayout:
- 'spec/routing/media_routing_spec.rb'

# Offense count: 7
# Configuration parameters: IgnoredMethods.
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 22

# Offense count: 2
# Configuration parameters: IgnoredMethods.
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/CyclomaticComplexity:
Max: 10

# Offense count: 12
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
# Offense count: 13
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Max: 25

# Offense count: 34
# Offense count: 35
RSpec/AnyInstance:
Exclude:
- 'spec/controllers/media_controller_spec.rb'
Expand All @@ -44,7 +44,7 @@ RSpec/AnyInstance:
- 'spec/requests/media_auth_request_spec.rb'

# Offense count: 89
# Configuration parameters: Prefixes.
# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
RSpec/ContextWording:
Exclude:
Expand All @@ -62,23 +62,8 @@ RSpec/ContextWording:
- 'spec/services/iiif_metadata_service_spec.rb'
- 'spec/services/media_authentication_json_spec.rb'

# Offense count: 10
# Configuration parameters: IgnoredMetadata.
RSpec/DescribeClass:
Exclude:
- 'spec/features/iiif_spec.rb'
- 'spec/features/status_spec.rb'
- 'spec/requests/iiif_spec.rb'
- 'spec/requests/remote_iiif_image_delivery_spec.rb'
- 'spec/routing/file_routing_spec.rb'
- 'spec/routing/iiif_routing_spec.rb'
- 'spec/routing/legacy_image_api_spec.rb'
- 'spec/routing/media_routing_spec.rb'
- 'spec/routing/webauth_routing_spec.rb'
- 'spec/views/webauth/logout.html.erb_spec.rb'

# Offense count: 27
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: SkipBlocks, EnforcedStyle.
# SupportedStyles: described_class, explicit
RSpec/DescribedClass:
Expand All @@ -88,15 +73,15 @@ RSpec/DescribedClass:
- 'spec/models/user_spec.rb'

# Offense count: 7
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
RSpec/EmptyLineAfterExampleGroup:
Exclude:
- 'spec/abilities/ability_spec.rb'
- 'spec/controllers/legacy_image_service_controller_spec.rb'
- 'spec/requests/file_auth_request_spec.rb'

# Offense count: 37
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
RSpec/EmptyLineAfterFinalLet:
Exclude:
- 'spec/abilities/ability_spec.rb'
Expand All @@ -110,15 +95,16 @@ RSpec/EmptyLineAfterFinalLet:
- 'spec/services/media_authentication_json_spec.rb'

# Offense count: 6
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowConsecutiveOneLiners.
RSpec/EmptyLineAfterHook:
Exclude:
- 'spec/controllers/application_controller_spec.rb'
- 'spec/features/status_spec.rb'
- 'spec/requests/iiif_spec.rb'

# Offense count: 12
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
RSpec/EmptyLineAfterSubject:
Exclude:
- 'spec/abilities/ability_spec.rb'
Expand All @@ -129,29 +115,24 @@ RSpec/EmptyLineAfterSubject:
- 'spec/models/stacks_image_spec.rb'
- 'spec/services/iiif_metadata_service_spec.rb'

# Offense count: 22
# Configuration parameters: Max.
# Offense count: 20
# Configuration parameters: CountAsOne.
RSpec/ExampleLength:
Exclude:
- 'spec/controllers/iiif_controller_spec.rb'
- 'spec/controllers/legacy_image_service_controller_spec.rb'
- 'spec/controllers/object_controller_spec.rb'
- 'spec/features/iiif_spec.rb'
- 'spec/models/purl_spec.rb'
- 'spec/models/stacks_media_token_spec.rb'
- 'spec/requests/media_auth_request_spec.rb'
- 'spec/services/iiif_info_service_spec.rb'
Max: 24

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: CustomTransform, IgnoredWords.
# Offense count: 15
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: CustomTransform, IgnoredWords, DisallowedExamples.
# DisallowedExamples: works
RSpec/ExampleWording:
Exclude:
- 'spec/controllers/legacy_image_service_controller_spec.rb'
- 'spec/controllers/media_controller_spec.rb'
- 'spec/models/stacks_media_token_spec.rb'
- 'spec/requests/iiif_auth_request_spec.rb'

# Offense count: 3
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: implicit, each, example
RSpec/HookArgument:
Expand All @@ -160,7 +141,7 @@ RSpec/HookArgument:
- 'spec/requests/iiif_auth_request_spec.rb'

# Offense count: 8
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
RSpec/LeadingSubject:
Exclude:
- 'spec/controllers/file_controller_spec.rb'
Expand All @@ -178,12 +159,13 @@ RSpec/MessageSpies:
- 'spec/controllers/file_controller_spec.rb'
- 'spec/controllers/media_controller_spec.rb'

# Offense count: 66
# Offense count: 67
RSpec/MultipleExpectations:
Max: 12

# Offense count: 81
# Configuration parameters: IgnoreSharedExamples.
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
# SupportedStyles: always, named_only
RSpec/NamedSubject:
Exclude:
- 'spec/controllers/application_controller_spec.rb'
Expand All @@ -201,7 +183,8 @@ RSpec/NamedSubject:
- 'spec/services/iiif_metadata_service_spec.rb'
- 'spec/services/media_authentication_json_spec.rb'

# Offense count: 62
# Offense count: 66
# Configuration parameters: AllowedGroups.
RSpec/NestedGroups:
Max: 6

Expand All @@ -211,6 +194,12 @@ RSpec/RepeatedDescription:
- 'spec/routing/file_routing_spec.rb'
- 'spec/routing/legacy_image_api_spec.rb'

# Offense count: 5
RSpec/StubbedMock:
Exclude:
- 'spec/controllers/file_controller_spec.rb'
- 'spec/controllers/media_controller_spec.rb'

# Offense count: 1
RSpec/SubjectStub:
Exclude:
Expand All @@ -235,39 +224,30 @@ Rails/FilePath:
- 'app/controllers/application_controller.rb'
- 'spec/controllers/file_controller_spec.rb'

# Offense count: 12
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: numeric, symbolic
Rails/HttpStatus:
Exclude:
- 'spec/requests/file_auth_request_spec.rb'
- 'spec/requests/iiif_auth_request_spec.rb'

# Offense count: 2
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: separated, grouped
Style/AccessorGrouping:
Exclude:
- 'app/models/stacks_image.rb'

# Offense count: 2
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
Style/EmptyCaseCondition:
Exclude:
- 'app/controllers/legacy_image_service_controller.rb'

# Offense count: 1
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: braces, no_braces
Style/HashAsLastArrayItem:
Exclude:
- 'app/controllers/object_controller.rb'

# Offense count: 18
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: PreferredDelimiters.
Style/PercentLiteralDelimiters:
Exclude:
Expand All @@ -278,16 +258,25 @@ Style/PercentLiteralDelimiters:
- 'spec/requests/media_auth_request_spec.rb'

# Offense count: 3
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Mode.
Style/StringConcatenation:
Exclude:
- 'app/controllers/iiif_controller.rb'
- 'spec/controllers/object_controller_spec.rb'
- 'spec/models/stacks_media_token_spec.rb'

# Offense count: 4
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: MinSize.
# SupportedStyles: percent, brackets
Style/SymbolArray:
EnforcedStyle: brackets

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments.
# AllowedMethods: define_method
Style/SymbolProc:
Exclude:
- 'app/controllers/webauth_controller.rb'
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ group :development, :test do
gem 'webdrivers'

# Rubocop is a static code analyzer to enforce style.
gem 'rubocop', '~> 0.50', require: false
gem 'rubocop', '~> 1.57', require: false
gem 'rubocop-performance', require: false
gem 'rubocop-rails', require: false
gem 'rubocop-rspec', require: false
Expand Down
33 changes: 21 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ GEM
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
json (2.6.3)
jwt (2.7.1)
language_server-protocol (3.17.0.3)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
Expand Down Expand Up @@ -255,7 +257,7 @@ GEM
public_suffix (5.0.3)
puma (5.6.7)
nio4r (~> 2.0)
racc (1.7.1)
racc (1.7.2)
rack (2.2.8)
rack-test (2.1.0)
rack (>= 1.3)
Expand Down Expand Up @@ -324,27 +326,34 @@ GEM
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-support (3.12.1)
rubocop (0.93.1)
rubocop (1.57.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 2.7.1.5)
parser (>= 3.2.2.4)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8)
rexml
rubocop-ast (>= 0.6.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.19.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.24.0)
rubocop (~> 1.33)
rubocop-performance (1.10.2)
rubocop (>= 0.90.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rails (2.9.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 0.90.0, < 2.0)
rubocop-rspec (1.44.1)
rubocop (~> 0.87)
rubocop-ast (>= 0.7.1)
rubocop-rspec (2.25.0)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
Expand All @@ -371,7 +380,7 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (1.8.0)
unicode-display_width (2.5.0)
web-console (4.2.1)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
Expand Down Expand Up @@ -435,7 +444,7 @@ DEPENDENCIES
redis
retries
rspec-rails (~> 5.0)
rubocop (~> 0.50)
rubocop (~> 1.57)
rubocop-performance
rubocop-rails
rubocop-rspec
Expand Down
Loading