Skip to content

Commit

Permalink
Merge pull request #485 from psu-libraries/483-ruby-3
Browse files Browse the repository at this point in the history
Upgrade to ruby 3.1.2
  • Loading branch information
ajkiessl authored Aug 11, 2022
2 parents 30674d3 + 75bf29c commit 78f6562
Show file tree
Hide file tree
Showing 203 changed files with 1,190 additions and 4,707 deletions.
7 changes: 5 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ version: 2.1
orbs:
ruby: circleci/[email protected]
node: circleci/node@2
browser-tools: circleci/[email protected]

jobs:
build:
docker:
- image: cimg/ruby:2.6.6-node
- image: cimg/ruby:3.1.2-node
executor: ruby/default
steps:
- checkout
Expand All @@ -17,7 +18,7 @@ jobs:

test:
docker:
- image: circleci/ruby:2.6.6-node-browsers
- image: cimg/ruby:3.1.2-browsers
- image: circleci/postgres:12.7
environment:
POSTGRES_USER: psu_research_metadata_test
Expand All @@ -33,6 +34,8 @@ jobs:
RAILS_ENV: test
# A series of steps to run, some are similar to those in "build".
steps:
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- checkout
- ruby/install-deps
- node/install-packages:
Expand Down
154 changes: 112 additions & 42 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,77 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2021-11-18 16:49:25 UTC using RuboCop version 0.93.1.
# on 2022-08-05 14:48:13 UTC using RuboCop version 1.33.0.
# 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
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches.
Lint/DuplicateBranch:
Exclude:
- 'app/mappers/status_mapper.rb'

# Offense count: 1
Lint/DuplicateHashKey:
Exclude:
- 'spec/integration/admin/publications/show_spec.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Lint/DuplicateRequire:
Exclude:
- 'spec/integration/integration_spec_helper.rb'

# Offense count: 12
# Configuration parameters: AllowComments, AllowEmptyLambdas.
Lint/EmptyBlock:
Exclude:
- 'app/models/ability.rb'
- 'config/initializers/rails_admin.rb'
- 'spec/component/models/journal_spec.rb'
- 'spec/component/models/organization_spec.rb'
- 'spec/component/models/publisher_spec.rb'
- 'spec/factories/api_token.rb'
- 'spec/factories/duplicate_publication_group.rb'
- 'spec/factories/grant.rb'
- 'spec/factories/non_duplicate_publication_group.rb'
- 'spec/factories/statistics_snapshot.rb'
- 'spec/requests/api/v1/publications_spec.rb'

# Offense count: 2
Lint/RescueException:
Exclude:
- 'app/importers/activity_insight_importer.rb'
- 'app/jobs/scholarsphere_upload_job.rb'

# Offense count: 1
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
Lint/UnusedMethodArgument:
Exclude:
- 'app/importers/pure_publication_tag_importer.rb'

# Offense count: 2
Lint/UriEscapeUnescape:
Exclude:
- 'app/controllers/orcid_access_tokens_controller.rb'
- 'app/importers/open_access_button_publication_importer.rb'

# Offense count: 136
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
# ExcludedMethods: refine
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods, inherit_mode.
# AllowedMethods: refine
Metrics/BlockLength:
Max: 298

# Offense count: 12
# Offense count: 13
# Configuration parameters: CountComments, CountAsOne.
Metrics/ClassLength:
Max: 1213

# Offense count: 27
# Configuration parameters: IgnoredMethods.
# Offense count: 34
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods.
Metrics/CyclomaticComplexity:
Max: 43
Max: 42

# Offense count: 25
# Configuration parameters: IgnoredMethods.
# Offense count: 32
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods.
Metrics/PerceivedComplexity:
Max: 44
Max: 43

# Offense count: 1
Naming/AccessorMethodName:
Expand All @@ -77,26 +94,31 @@ Naming/MemoizedInstanceVariableName:
# MethodDefinitionMacros: define_method, define_singleton_method
Naming/PredicateName:
Exclude:
- 'spec/**/*'
- 'app/importers/activity_insight_importer.rb'
- 'app/models/external_publication_waiver.rb'
- 'app/models/publication.rb'

# Offense count: 334
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
# SupportedStyles: snake_case, normalcase, non_integer
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339
Naming/VariableNumber:
Enabled: false

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect.
# This cop supports unsafe autocorrection (--autocorrect-all).
Performance/StringInclude:
Exclude:
- 'app/importers/web_of_science_publication.rb'
- 'app/models/wos_grant.rb'

# Offense count: 128
# Offense count: 159
# Configuration parameters: Prefixes.
# Prefixes: when, with, without
RSpec/ContextWording:
Enabled: false

# Offense count: 13
# Offense count: 9
# Configuration parameters: IgnoredMetadata.
RSpec/DescribeClass:
Exclude:
Expand All @@ -109,12 +131,8 @@ RSpec/DescribeClass:
- 'spec/integration/profiles/open_access_publications/edit_spec.rb'
- 'spec/integration/user/sessions/delete_spec.rb'
- 'spec/integration/user/sessions/new_spec.rb'
- 'spec/requests/api/v1/organizations_spec.rb'
- 'spec/requests/api/v1/publications_spec.rb'
- 'spec/requests/api/v1/swagger_checker_spec.rb'
- 'spec/requests/api/v1/users_spec.rb'

# Offense count: 296
# Offense count: 304
RSpec/LetSetup:
Enabled: false

Expand Down Expand Up @@ -142,7 +160,7 @@ RSpec/MessageSpies:
RSpec/MultipleDescribes:
Enabled: false

# Offense count: 893
# Offense count: 918
# Configuration parameters: AllowSubject.
RSpec/MultipleMemoizedHelpers:
Max: 81
Expand All @@ -157,7 +175,7 @@ RSpec/NamedSubject:
- 'spec/component/serializers/api/v1/publication_serializer_spec.rb'
- 'spec/requests/api/v1/swagger_checker_spec.rb'

# Offense count: 1029
# Offense count: 1175
RSpec/NestedGroups:
Max: 8

Expand Down Expand Up @@ -200,14 +218,22 @@ RSpec/SubjectStub:
RSpec/VerifiedDoubles:
Enabled: false

# Offense count: 1
# Cop supports --auto-correct.
Rails/ActiveRecordAliases:
# Offense count: 6
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/CompactBlank:
Exclude:
- 'app/controllers/orcid_employments_controller.rb'
- 'app/models/publication_match_on_doi_policy.rb'
- 'app/models/publication_merge_on_doi_policy.rb'

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/DeprecatedActiveModelErrorsMethods:
Exclude:
- 'app/models/contributor_name.rb'
- 'app/models/scholarsphere_work_deposit.rb'

# Offense count: 21
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Whitelist, AllowedMethods, AllowedReceivers.
# Whitelist: find_by_sql
# AllowedMethods: find_by_sql
Expand All @@ -225,14 +251,22 @@ Rails/DynamicFindBy:
Rails/FilePath:
Enabled: false

# Offense count: 33
# Offense count: 34
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/HasManyOrHasOneDependent:
Enabled: false

# Offense count: 10
Rails/I18nLocaleTexts:
Exclude:
- 'app/mailers/admin_notifications_mailer.rb'
- 'app/mailers/deputy_assignments_mailer.rb'
- 'app/mailers/faculty_confirmations_mailer.rb'
- 'app/mailers/faculty_notifications_mailer.rb'

# Offense count: 3
# Configuration parameters: Include.
# Configuration parameters: IgnoreScopes, Include.
# Include: app/models/**/*.rb
Rails/InverseOf:
Exclude:
Expand All @@ -242,7 +276,7 @@ Rails/InverseOf:

# Offense count: 1
# Configuration parameters: Include.
# Include: app/controllers/**/*.rb
# Include: app/controllers/**/*.rb, app/mailers/**/*.rb
Rails/LexicallyScopedActionFilter:
Exclude:
- 'app/controllers/api/v1/api_controller.rb'
Expand All @@ -259,12 +293,17 @@ Rails/OutputSafety:
- 'app/models/publication.rb'

# Offense count: 1
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: NotNilAndNotEmpty, NotBlank, UnlessBlank.
Rails/Present:
Exclude:
- 'app/models/publication.rb'

# Offense count: 17
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/RedundantPresenceValidationOnBelongsTo:
Enabled: false

# Offense count: 15
# Configuration parameters: ForbiddenMethods, AllowedMethods.
# ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all
Expand All @@ -282,6 +321,11 @@ Rails/SkipsModelValidations:
- 'spec/component/controllers/deputy_assignments_controller_spec.rb'
- 'spec/component/models/user_profile_spec.rb'

# Offense count: 1
Rails/TransactionExitStatement:
Exclude:
- 'app/services/scholarsphere_location_operator.rb'

# Offense count: 7
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Expand All @@ -300,27 +344,53 @@ Security/Open:
- 'spec/component/importers/news_feed_item_importer_spec.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowIfModifier.
Style/IfInsideElse:
Exclude:
- 'app/importers/activity_insight_importer.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedMethods.
# AllowedMethods: nonzero?
Style/IfWithBooleanLiteralBranches:
Exclude:
- 'app/models/publication_merge_on_doi_policy.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/MapToHash:
Exclude:
- 'app/models/user_profile.rb'

# Offense count: 15
Style/OpenStructUse:
Exclude:
- 'app/services/scholarsphere_location_operator.rb'
- 'lib/mailer_previews/admin_notifications_mailer_preview.rb'
- 'lib/mailer_previews/deputy_assignments_mailer_preview.rb'
- 'lib/mailer_previews/faculty_confirmations_mailer_preview.rb'
- 'lib/mailer_previews/faculty_notifications_mailer_preview.rb'
- 'lib/tasks/email_notifications.rake'

# Offense count: 6
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/RedundantSort:
Exclude:
- 'app/models/authorship_merge_policy.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowModifier.
Style/SoleNestedConditional:
Exclude:
- 'app/models/publication.rb'
- 'app/models/scholarsphere_work_deposit.rb'

# Offense count: 409
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# Offense count: 435
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 302
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.5
3.1.2
9 changes: 7 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ gem 'daemons' # for running delayed_job daemon (or oth
gem 'delayed_job_active_record' # for running async jobs
gem 'devise', '~> 4.8' # for authentication and user management
gem 'factory_bot_rails' # For generating records in test, development, and staging/beta envs
gem 'fast_jsonapi' # a lightning fast JSON:API serializer for Ruby Objects
gem 'ffaker' # For generating fake data in test, development, and staging/beta envs
gem 'fieldhand', '~> 0.12' # harvest metadata from OAI-PMH repositories
gem 'font-awesome-rails' # UI Icons
Expand All @@ -34,17 +33,23 @@ gem 'httparty' # HTTP client
gem 'jbuilder', '~> 2.11' # build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jquery-rails' # jQuery packages for Rails
gem 'jquery-ui-rails'
gem 'mini_racer', platforms: :ruby # used to minify assets
gem 'jsonapi-serializer' # a fast JSON:API serializer for Ruby Objects
gem 'multi_json' # JSON parser wrapper
gem 'net-imap', require: false # For Ruby 3 and Rails 6 mail compatibility
gem 'net-ldap' # lightweight Directory Access Protocol client
gem 'net-pop', require: false # For Ruby 3 and Rails 6 mail compatibility
gem 'net-smtp', require: false # For Ruby 3 and Rails 6 mail compatibility
gem 'net-ssh', '7.0.0.beta1' # Needed for cap to run with ruby 3. Can be removed if net-ssh gets updated.
gem 'pg', '>= 0.18', '< 2.0' # use postgresql as the database for Active Record
gem 'progressbar' # the ultimate text progress bar library for Ruby
gem 'psu_identity', '~> 0.2' # connect to Penn State's identity API
gem 'puma', '~> 5.6' # use Puma as the app server
gem 'rss' # RSS reading and writing
gem 'sass-rails' # sass for stylesheets
gem 'scholarsphere-client', '~> 0.3' # upload content into ScholarSphere
gem 'simple_form' # HTML Form builder
gem 'smarter_csv' # simple, efficient CSV processing for Ruby
gem 'strscan', '3.0.1' # Must be kept at 3.0.1 to work with bundler 2.3.8
gem 'swagger-blocks' # DSL for pure Ruby code blocks that can be turned into JSON
gem 'turbolinks', '~> 5' # makes navigating your web application faster
gem 'uglifier', '>= 1.3.0' # use Uglifier as compressor for JavaScript assets
Expand Down
Loading

0 comments on commit 78f6562

Please sign in to comment.