From 58cf494cee1843a82301adba640a6460109c67e0 Mon Sep 17 00:00:00 2001 From: Jenkins Date: Mon, 11 Sep 2023 02:34:23 -0700 Subject: [PATCH 1/2] Update Ruby dependencies --- Gemfile.lock | 118 +++++++++++++++++++++++++-------------------------- 1 file changed, 59 insertions(+), 59 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index d279be4e6..cef849805 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,67 +1,67 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.0.7.2) - actionpack (= 7.0.7.2) - activesupport (= 7.0.7.2) + actioncable (7.0.8) + actionpack (= 7.0.8) + activesupport (= 7.0.8) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.7.2) - actionpack (= 7.0.7.2) - activejob (= 7.0.7.2) - activerecord (= 7.0.7.2) - activestorage (= 7.0.7.2) - activesupport (= 7.0.7.2) + actionmailbox (7.0.8) + actionpack (= 7.0.8) + activejob (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.7.2) - actionpack (= 7.0.7.2) - actionview (= 7.0.7.2) - activejob (= 7.0.7.2) - activesupport (= 7.0.7.2) + actionmailer (7.0.8) + actionpack (= 7.0.8) + actionview (= 7.0.8) + activejob (= 7.0.8) + activesupport (= 7.0.8) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.7.2) - actionview (= 7.0.7.2) - activesupport (= 7.0.7.2) + actionpack (7.0.8) + actionview (= 7.0.8) + activesupport (= 7.0.8) rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.7.2) - actionpack (= 7.0.7.2) - activerecord (= 7.0.7.2) - activestorage (= 7.0.7.2) - activesupport (= 7.0.7.2) + actiontext (7.0.8) + actionpack (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.7.2) - activesupport (= 7.0.7.2) + actionview (7.0.8) + activesupport (= 7.0.8) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.7.2) - activesupport (= 7.0.7.2) + activejob (7.0.8) + activesupport (= 7.0.8) globalid (>= 0.3.6) - activemodel (7.0.7.2) - activesupport (= 7.0.7.2) - activerecord (7.0.7.2) - activemodel (= 7.0.7.2) - activesupport (= 7.0.7.2) - activestorage (7.0.7.2) - actionpack (= 7.0.7.2) - activejob (= 7.0.7.2) - activerecord (= 7.0.7.2) - activesupport (= 7.0.7.2) + activemodel (7.0.8) + activesupport (= 7.0.8) + activerecord (7.0.8) + activemodel (= 7.0.8) + activesupport (= 7.0.8) + activestorage (7.0.8) + actionpack (= 7.0.8) + activejob (= 7.0.8) + activerecord (= 7.0.8) + activesupport (= 7.0.8) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.7.2) + activesupport (7.0.8) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -222,7 +222,7 @@ GEM faraday marc zeitwerk - globalid (1.2.0) + globalid (1.2.1) activesupport (>= 6.1) hashdiff (1.0.1) hashie (5.0.0) @@ -266,7 +266,7 @@ GEM marcel (1.0.2) method_source (1.0.0) mini_mime (1.1.5) - minitest (5.19.0) + minitest (5.20.0) moab-versioning (6.1.0) druid-tools (>= 1.0.0) json @@ -342,20 +342,20 @@ GEM rack-test rack-test (2.1.0) rack (>= 1.3) - rails (7.0.7.2) - actioncable (= 7.0.7.2) - actionmailbox (= 7.0.7.2) - actionmailer (= 7.0.7.2) - actionpack (= 7.0.7.2) - actiontext (= 7.0.7.2) - actionview (= 7.0.7.2) - activejob (= 7.0.7.2) - activemodel (= 7.0.7.2) - activerecord (= 7.0.7.2) - activestorage (= 7.0.7.2) - activesupport (= 7.0.7.2) + rails (7.0.8) + actioncable (= 7.0.8) + actionmailbox (= 7.0.8) + actionmailer (= 7.0.8) + actionpack (= 7.0.8) + actiontext (= 7.0.8) + actionview (= 7.0.8) + activejob (= 7.0.8) + activemodel (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) bundler (>= 1.15.0) - railties (= 7.0.7.2) + railties (= 7.0.8) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -363,9 +363,9 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.0.7.2) - actionpack (= 7.0.7.2) - activesupport (= 7.0.7.2) + railties (7.0.8) + actionpack (= 7.0.8) + activesupport (= 7.0.8) method_source rake (>= 12.2) thor (~> 1.0) @@ -373,7 +373,7 @@ GEM rainbow (3.1.1) rake (12.3.3) rbtree (0.4.6) - redis-client (0.16.0) + redis-client (0.17.0) connection_pool regexp_parser (2.8.1) request_store (1.5.1) @@ -404,7 +404,7 @@ GEM rspec-core (>= 2, < 4, != 2.12.0) rss (0.3.0) rexml - rubocop (1.56.2) + rubocop (1.56.3) base64 (~> 0.1.1) json (~> 2.3) language_server-protocol (>= 3.17.0) @@ -425,11 +425,11 @@ GEM rubocop-performance (1.19.0) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - rubocop-rails (2.20.2) + rubocop-rails (2.21.0) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) - rubocop-rspec (2.23.2) + rubocop-rspec (2.24.0) rubocop (~> 1.33) rubocop-capybara (~> 2.17) rubocop-factory_bot (~> 2.22) From 1ad41d134acbf15ad8f8ea45df66806ae64cf251 Mon Sep 17 00:00:00 2001 From: Naomi Dushay Date: Mon, 11 Sep 2023 08:55:54 -0700 Subject: [PATCH 2/2] rubocop: update .rubocop_todo, add new rules --- .rubocop.yml | 23 +++++++++++++++--- .rubocop_todo.yml | 46 +++++++++++++---------------------- lib/tasks/missing_druids.rake | 2 +- 3 files changed, 37 insertions(+), 34 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 68b267985..efa4449e3 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -83,10 +83,6 @@ RSpec/ExpectActual: Exclude: - 'spec/routing/**' -RSpec/FilePath: - Exclude: - - 'spec/services/catalog/update_marc_856_record_service_spec.rb' - RSpec/NestedGroups: Max: 5 @@ -680,3 +676,22 @@ RSpec/Rails/NegationBeValid: # new in 2.23 Enabled: true Rails/ThreeStateBooleanColumn: # new in 2.19 Enabled: true + +RSpec/EmptyMetadata: # new in 2.24 + Enabled: true +RSpec/Eq: # new in 2.24 + Enabled: true +RSpec/MetadataStyle: # new in 2.24 + Enabled: true +RSpec/SpecFilePathFormat: # new in 2.24 + Enabled: true + Exclude: + - 'spec/services/catalog/update_marc_856_record_service_spec.rb' +RSpec/SpecFilePathSuffix: # new in 2.24 + Enabled: true +Rails/DangerousColumnNames: # new in 2.21 + Enabled: true +Rails/RedundantActiveRecordAllMethod: # new in 2.21 + Enabled: true +Rails/UnusedRenderContent: # new in 2.21 + Enabled: true diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index cb006d565..c4864cc6e 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,39 +1,33 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2023-03-13 16:36:27 UTC using RuboCop version 1.48.1. +# on 2023-09-11 15:55:19 UTC using RuboCop version 1.56.3. # 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: 1 -# This cop supports safe autocorrection (--autocorrect). -Lint/RedundantCopDisableDirective: - Exclude: - - 'spec/requests/update_metadata_spec.rb' - # Offense count: 1 # Configuration parameters: AllowComments, AllowNil. Lint/SuppressedException: Exclude: - 'lib/tasks/rspec.rake' -# Offense count: 69 +# Offense count: 74 # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. Metrics/AbcSize: Max: 39 -# Offense count: 3 +# Offense count: 6 # Configuration parameters: CountComments, CountAsOne. Metrics/ClassLength: Max: 114 -# Offense count: 12 +# Offense count: 15 # Configuration parameters: AllowedMethods, AllowedPatterns. Metrics/CyclomaticComplexity: Max: 11 -# Offense count: 77 +# Offense count: 85 # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. Metrics/MethodLength: Max: 28 @@ -48,11 +42,6 @@ Metrics/ParameterLists: Metrics/PerceivedComplexity: Max: 12 -# Offense count: 11 -Naming/AccessorMethodName: - Exclude: - - 'app/services/catalog/marc_856_generator.rb' - # Offense count: 9 # Configuration parameters: EnforcedStyle, AllowedIdentifiers, AllowedPatterns. # SupportedStyles: snake_case, camelCase @@ -60,11 +49,10 @@ Naming/VariableName: Exclude: - 'app/services/publish/public_desc_metadata_service.rb' -# Offense count: 17 +# Offense count: 16 RSpec/AnyInstance: Exclude: - 'spec/requests/create_collection_spec.rb' - - 'spec/requests/metadata_spec.rb' - 'spec/requests/notify_goobi_spec.rb' - 'spec/services/preservation_ingest_service_spec.rb' - 'spec/services/publish/metadata_transfer_service_spec.rb' @@ -80,7 +68,7 @@ RSpec/BeforeAfterAll: Exclude: - 'spec/services/digital_stacks_service_spec.rb' -# Offense count: 7 +# Offense count: 6 # Configuration parameters: Prefixes, AllowedPatterns. # Prefixes: when, with, without RSpec/ContextWording: @@ -133,6 +121,7 @@ RSpec/StubbedMock: - 'spec/services/version_service_spec.rb' # Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: slashes, arguments Rails/FilePath: @@ -148,11 +137,12 @@ Rails/TimeZone: - 'spec/services/version_service_spec.rb' # Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). Style/CombinableLoops: Exclude: - 'app/services/digital_stacks_service.rb' -# Offense count: 9 +# Offense count: 8 # Configuration parameters: AllowedConstants. Style/Documentation: Exclude: @@ -163,7 +153,7 @@ Style/Documentation: - 'config/application.rb' - 'config/initializers/okcomputer.rb' -# Offense count: 13 +# Offense count: 12 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: Strict, AllowedNumbers, AllowedPatterns. Style/NumericLiterals: @@ -189,19 +179,17 @@ Style/StringLiterals: - 'spec/rails_helper.rb' - 'spec/spec_helper.rb' -# Offense count: 5 +# Offense count: 4 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle, MinSize. +# Configuration parameters: . # SupportedStyles: percent, brackets Style/SymbolArray: - Exclude: - - 'app/controllers/workspaces_controller.rb' - - 'config/routes.rb' - - 'lib/tasks/rspec.rake' + EnforcedStyle: percent + MinSize: 3 -# Offense count: 473 +# Offense count: 498 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. # URISchemes: http, https Layout/LineLength: - Max: 333 + Max: 289 diff --git a/lib/tasks/missing_druids.rake b/lib/tasks/missing_druids.rake index 26cb87a5d..a51642bbd 100644 --- a/lib/tasks/missing_druids.rake +++ b/lib/tasks/missing_druids.rake @@ -11,7 +11,7 @@ namespace :missing_druids do results.each { |r| druids_from_solr << r['id'] } models.each do |model| - druids_from_db << model.all.pluck(:external_identifier) + druids_from_db << model.pluck(:external_identifier) end missing_druids = druids_from_db.flatten.sort - druids_from_solr.sort