diff --git a/.rubocop.yml b/.rubocop.yml index 4a5fb78c8..7af771792 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,133 +1,127 @@ -# Turn on RSpec cops -require: rubocop-rspec -inherit_from: .rubocop_todo.yml +inherit_from: + - .rubocop_fixme.yml -# With the rubocop 0.47.0 and rubocop-rspec 1.8.0 the following stderr message was sent: -# An error occurred while RSpec/DescribedClass cop was inspecting path/to/file -RSpec/DescribedClass: - Enabled: false +inherit_gem: + bixby: bixby_default.yml AllCops: + TargetRubyVersion: 2.6 DisplayCopNames: true - TargetRubyVersion: 2.3 Exclude: - - 'bin/**/*' - 'db/**/*' - - 'config/**/*' - - 'vendor/**/*' - - '.internal_test_app/**/*' - - 'spec/fixtures/**/*' - - 'spec/internal/**/*' + - 'script/**/*' - 'spec/test_app_templates/**/*' - - 'Rakefile' - - 'lib/tasks/rubocop.rake' - # disabling collections controller as most of the rubocop errors are in hyrax - - 'app/controllers/hyrax/dashboard/collections_controller.rb' - -Rails: - Enabled: true + - 'vendor/**/*' + - 'lib/hyrax/specs/**/*' -Rails/DynamicFindBy: - Whitelist: - - find_by_user_key +Lint/ImplicitStringConcatenation: Exclude: - - 'lib/importer/factory/object_factory.rb' + - 'lib/generators/hyrax/**/*' -Rails/UnknownEnv: - Environments: - - development - - production - - staging - - test +Rails/Output: + Exclude: + - 'lib/generators/**/*' -Metrics/LineLength: - Max: 120 +Metrics/BlockLength: + ExcludedMethods: ['included'] Exclude: - - 'app/controllers/catalog_controller.rb' - - 'spec/controllers/curation_concerns/generic_works_controller_spec.rb' - - 'spec/services/iiif_collection_thumbnail_path_service_spec.rb' - - 'spec/services/iiif_work_thumbnail_path_service_spec.rb' - - 'spec/routing/proprietor/accounts_routing_spec.rb' + - 'hyrax.gemspec' + - 'app/models/concerns/hyrax/content_block_behavior.rb' + - 'app/services/hyrax/workflow/workflow_schema.rb' + - 'config/initializers/simple_form.rb' + - 'config/features.rb' + - 'config/routes.rb' + - 'lib/generators/hyrax/templates/catalog_controller.rb' + - 'lib/generators/hyrax/templates/config/initializers/simple_form_bootstrap.rb' + - 'lib/hyrax/rails/routes.rb' + - 'lib/tasks/*.rake' + - 'spec/**/*.rb' + - 'tasks/benchmark.rake' -Layout/IndentationConsistency: - EnforcedStyle: rails +Style/AsciiComments: + Enabled: false -Layout/DotPosition: - EnforcedStyle: leading +# rubocop suggests !thing.nil? instead, but that is NOT equivalent +Style/DoubleNegation: + Enabled: false + +Style/CollectionMethods: + PreferredMethods: + collect: 'map' + collect!: 'map!' + inject: 'reduce' + detect: 'find' + find_all: 'select' -Style/Documentation: +Style/SymbolArray: Enabled: false -Style/StringLiterals: +Style/ClassAndModuleChildren: Enabled: false -Style/WordArray: +Style/SingleLineBlockParams: Enabled: false -Metrics/ClassLength: - Exclude: - - 'app/controllers/catalog_controller.rb' +Rails/ApplicationJob: + Enabled: false -Metrics/ModuleLength: - Max: 200 +Rails/ApplicationRecord: + Enabled: false -Rails/HasAndBelongsToMany: - Exclude: - - 'app/models/role.rb' +Rails/RakeEnvironment: + Enabled: false -RSpec/AnyInstance: +# We define custom methods like `find_by_user_key`, +# `find_by_created_date`, etc +Rails/DynamicFindBy: Enabled: false -RSpec/InstanceVariable: +Rails/FilePath: Exclude: - - 'spec/controllers/hyku/registrations_controller_spec.rb' + - 'spec/abilities/**/*' -RSpec/NamedSubject: - Enabled: false +Rails/OutputSafety: + Exclude: + - 'app/builders/hyrax/form_builder.rb' + - 'app/helpers/hyrax/citations_behaviors/formatters/apa_formatter.rb' + - 'app/helpers/hyrax/citations_behaviors/formatters/chicago_formatter.rb' + - 'app/helpers/hyrax/citations_behaviors/formatters/mla_formatter.rb' + - 'app/helpers/hyrax/collections_helper.rb' + - 'app/helpers/hyrax/content_block_helper_behavior.rb' + - 'app/helpers/hyrax/hyrax_helper_behavior.rb' + - 'app/presenters/hyrax/fixity_status_presenter.rb' + - 'app/presenters/hyrax/presents_attributes.rb' + - 'app/renderers/hyrax/renderers/attribute_renderer.rb' + - 'spec/views/hyrax/my/works/_list_works.html.erb_spec.rb' RSpec/DescribeClass: Exclude: - - 'spec/requests/**/*' + - 'spec/abilities/**/*' + - 'spec/config/hyrax_events_spec.rb' + - 'spec/conversions/**/*' - 'spec/features/**/*' + - 'spec/inputs/**/*' + - 'spec/javascripts/jasmine_spec.rb' + - 'spec/tasks/rake_spec.rb' - 'spec/views/**/*' - - 'spec/routing/**/*' - - 'spec/tasks/**/*' -Rails/FilePath: - Exclude: - - 'spec/routing/**/*' +# # By default RSpec/MessageSpies has the following: +# # Prefer have_received for setting message expectations. Setup form as a spy using allow or instance_spy. +# # The default assumes EnforcedStyle is 'have_received'. Most of our specs are 'receive' +RSpec/MessageSpies: + Enabled: false RSpec/ExpectActual: - Exclude: - - 'spec/routing/**/*' + Enabled: false -RSpec/VerifiedDoubles: +RSpec/LetSetup: Enabled: false RSpec/MessageExpectation: Enabled: false -# By default RSpec/MessageSpies has the following: -# Prefer have_received for setting message expectations. Setup form as a spy using allow or instance_spy. -RSpec/MessageSpies: - Enabled: true - EnforcedStyle: receive - -RSpec/ExampleLength: - Max: 20 - RSpec/NestedGroups: - Max: 4 - -RSpec/MultipleExpectations: Enabled: false -Metrics/BlockLength: - Exclude: - - 'spec/**/*.rb' - - 'lib/tasks/*.rake' - - 'app/controllers/catalog_controller.rb' - -RSpec/FilePath: - Exclude: - - 'spec/config/application_spec.rb' +RSpec/LeadingSubject: + Enabled: false diff --git a/.rubocop_fixme.yml b/.rubocop_fixme.yml new file mode 100644 index 000000000..964bae6dc --- /dev/null +++ b/.rubocop_fixme.yml @@ -0,0 +1,201 @@ +Security/MarshalLoad: + Exclude: + - 'app/models/concerns/hyrax/user.rb' + +Metrics/ClassLength: + Exclude: + - 'app/controllers/hyrax/dashboard/collections_controller.rb' + - 'app/controllers/hyrax/admin/admin_sets_controller.rb' + - 'app/controllers/hyrax/batch_edits_controller.rb' + - 'app/controllers/hyrax/downloads_controller.rb' + - 'app/controllers/hyrax/file_sets_controller.rb' + - 'app/forms/hyrax/forms/permission_template_form.rb' + - 'app/presenters/hyrax/work_show_presenter.rb' + - 'app/presenters/hyrax/collection_presenter.rb' + - 'app/services/hyrax/user_stat_importer.rb' + - 'lib/generators/hyrax/templates/catalog_controller.rb' + - 'lib/generators/hyrax/install_generator.rb' + - 'lib/hyrax/configuration.rb' + +Metrics/ParameterLists: + Exclude: + - 'app/jobs/batch_create_job.rb' + +Metrics/ModuleLength: + Exclude: + - 'app/controllers/concerns/hyrax/works_controller_behavior.rb' + - 'app/helpers/hyrax/hyrax_helper_behavior.rb' + - 'app/models/concerns/hyrax/ability.rb' + - 'app/services/hyrax/workflow/permission_query.rb' + - 'spec/services/hyrax/workflow/permission_query_spec.rb' + # TODO: extract CollectionAccessControls or something, so we don't have to skip this check? + - 'app/models/concerns/hyrax/collection_behavior.rb' + +RSpec/NamedSubject: + Enabled: false + +RSpec/ExampleLength: + Max: 9 + Exclude: + - 'spec/actors/hyrax/actors/file_set_actor_spec.rb' + - 'spec/actors/hyrax/actors/generic_work_actor_spec.rb' + - 'spec/controllers/hyrax/api/items_controller_spec.rb' + - 'spec/controllers/hyrax/batch_edits_controller_spec.rb' + - 'spec/controllers/hyrax/batch_uploads_controller_spec.rb' + - 'spec/controllers/hyrax/file_sets_controller_spec.rb' + - 'spec/controllers/hyrax/generic_works_controller_spec.rb' + - 'spec/controllers/hyrax/my/highlights_controller_spec.rb' + - 'spec/controllers/hyrax/transfers_controller_spec.rb' + - 'spec/forms/hyrax/forms/collection_form_spec.rb' + - 'spec/forms/hyrax/forms/batch_edit_form_spec.rb' + - 'spec/forms/hyrax/forms/batch_upload_form_spec.rb' + - 'spec/forms/hyrax/forms/file_set_edit_form_spec.rb' + - 'spec/features/**/*' + - 'spec/helpers/hyrax/charts_helper_spec.rb' + - 'spec/helpers/dashboard_helper_spec.rb' + - 'spec/helpers/hyrax_helper_spec.rb' + - 'spec/indexers/hyrax/file_set_indexer_spec.rb' + - 'spec/javascripts/jasmine_spec.rb' + - 'spec/jobs/file_set_attached_event_job_spec.rb' + - 'spec/jobs/batch_create_job_spec.rb' + - 'spec/jobs/create_work_job_spec.rb' + - 'spec/jobs/content_update_event_job_spec.rb' + - 'spec/jobs/content_restored_version_event_job_spec.rb' + - 'spec/jobs/content_new_version_event_job_spec.rb' + - 'spec/jobs/content_depositor_change_event_job_spec.rb' + - 'spec/jobs/change_depositor_event_job_spec.rb' + - 'spec/jobs/content_deposit_event_job_spec.rb' + - 'spec/jobs/content_delete_event_job_spec.rb' + - 'spec/jobs/ingest_file_job_spec.rb' + - 'spec/lib/hyrax/arkivo/actor_spec.rb' + - 'spec/lib/hyrax/resource_sync/capability_list_writer_spec.rb' + - 'spec/models/checksum_audit_log_spec.rb' + - 'spec/models/featured_work_spec.rb' + - 'spec/models/file_set_spec.rb' + - 'spec/models/generic_work_spec.rb' + - 'spec/presenters/hyrax/inspect_work_presenter_spec.rb' + - 'spec/services/hyrax/actor_factory_spec.rb' + - 'spec/services/hyrax/admin_set_create_service_spec.rb' + - 'spec/services/hyrax/default_middleware_stack_spec.rb' + - 'spec/services/hyrax/graph_exporter_spec.rb' + - 'spec/services/hyrax/user_stat_importer_spec.rb' + - 'spec/services/hyrax/workflow/activate_object_spec.rb' + - 'spec/services/hyrax/workflow/deactivate_object_spec.rb' + - 'spec/services/hyrax/workflow/permission_generator_spec.rb' + - 'spec/services/hyrax/workflow/permission_query_spec.rb' + - 'spec/services/hyrax/workflow/state_machine_generator_spec.rb' + - 'spec/services/hyrax/workflow/workflow_importer_spec.rb' + - 'spec/views/**/*' + - 'spec/wings/valkyrie/persister_spec.rb' + +RSpec/VerifiedDoubles: + Enabled: false + +RSpec/SubjectStub: + Exclude: + - 'spec/actors/hyrax/actors/generic_work_actor_spec.rb' + - 'spec/controllers/hyrax/file_sets_controller_spec.rb' + - 'spec/models/file_set_spec.rb' + - 'spec/models/hyrax/work_behavior_spec.rb' + - 'spec/search_builders/hyrax/file_set_search_builder_spec.rb' + - 'spec/models/hyrax/operation_spec.rb' + - 'spec/controllers/hyrax/accepts_batches_controller_spec.rb' + - 'spec/indexers/hyrax/repository_reindexer_spec.rb' + - 'spec/lib/hyrax/analytics_spec.rb' + - 'spec/models/job_io_wrapper_spec.rb' + - 'spec/search_builders/hyrax/abstract_type_relation_spec.rb' + - 'spec/services/hyrax/database_migrator_spec.rb' + +RSpec/AnyInstance: + Exclude: + - 'spec/actors/hyrax/actors/generic_work_actor_spec.rb' + - 'spec/controllers/hyrax/api/items_controller_spec.rb' + - 'spec/controllers/hyrax/api/zotero_controller_spec.rb' + - 'spec/controllers/hyrax/batch_edits_controller_spec.rb' + - 'spec/controllers/hyrax/stats_controller_spec.rb' + - 'spec/controllers/hyrax/users_controller_spec.rb' + - 'spec/hyrax/transactions/steps/delete_access_control_spec.rb' + - 'spec/hyrax/transactions/steps/save_access_control_spec.rb' + - 'spec/jobs/content_restored_version_event_job_spec.rb' + - 'spec/jobs/file_set_attached_event_job_spec.rb' + - 'spec/jobs/hyrax/grant_edit_to_members_job_spec.rb' + - 'spec/jobs/hyrax/grant_read_to_members_job_spec.rb' + - 'spec/jobs/hyrax/revoke_edit_from_members_job_spec.rb' + - 'spec/lib/hyrax/arkivo/create_subscription_job_spec.rb' + - 'spec/presenters/hyrax/file_usage_spec.rb' + - 'spec/presenters/hyrax/work_usage_spec.rb' + - 'spec/services/hyrax/repository_fixity_check_service_spec.rb' + - 'spec/services/hyrax/workflow/permission_generator_spec.rb' + - 'spec/services/hyrax/workflow/sipity_actions_generator_spec.rb' + - 'spec/services/hyrax/workflow/state_machine_generator_spec.rb' + - 'spec/services/hyrax/workflow/workflow_permissions_generator_spec.rb' + - 'spec/controllers/hyrax/homepage_controller_spec.rb' + - 'spec/controllers/hyrax/my/collections_controller_spec.rb' + - 'spec/controllers/hyrax/my/works_controller_spec.rb' + - 'spec/presenters/hyrax/admin/repository_object_presenter_spec.rb' + +# Offense count: 51 +RSpec/ExpectInHook: + Enabled: false + +# Offense count: 27 +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: and_return, block +RSpec/ReturnFromStub: + Exclude: + - 'spec/controllers/hyrax/api/items_controller_spec.rb' + - 'spec/controllers/hyrax/file_sets_controller_spec.rb' + - 'spec/lib/hyrax/arkivo/create_subscription_job_spec.rb' + - 'spec/models/file_set_spec.rb' + - 'spec/presenters/hyrax/admin_set_options_presenter_spec.rb' + - 'spec/routing/api_route_spec.rb' + - 'spec/views/_user_util_links.html.erb_spec.rb' + - 'spec/views/hyrax/base/_attributes.html.erb_spec.rb' + - 'spec/views/hyrax/base/_form.html.erb_spec.rb' + - 'spec/views/hyrax/base/file_manager.html.erb_spec.rb' + - 'spec/views/hyrax/dashboard/profiles/edit.html.erb_spec.rb' + - 'spec/views/hyrax/users/_user_info.html.erb_spec.rb' + +# Offense count: 26 +RSpec/RepeatedDescription: + Exclude: + - 'spec/models/sipity/agent_spec.rb' + - 'spec/models/sipity/comment_spec.rb' + - 'spec/models/sipity/entity_spec.rb' + - 'spec/models/sipity/entity_specific_responsibility_spec.rb' + - 'spec/models/sipity/role_spec.rb' + - 'spec/models/sipity/workflow_action_spec.rb' + - 'spec/models/sipity/workflow_responsibility_spec.rb' + - 'spec/models/sipity/workflow_role_spec.rb' + - 'spec/models/sipity/workflow_state_action_permission_spec.rb' + - 'spec/models/sipity/workflow_state_action_spec.rb' + - 'spec/models/sipity/workflow_state_spec.rb' + +# Offense count: 2 +# Configuration parameters: Include. +# Include: app/models/**/*.rb +Rails/HasManyOrHasOneDependent: + Exclude: + - 'app/models/admin_set.rb' + - 'app/models/hyrax/permission_template.rb' + +# Offense count: 1 +Rails/SkipsModelValidations: + Exclude: + - 'app/services/hyrax/works/migration_service.rb' + +# Offense count: 12 +Lint/MissingSuper: + Exclude: + - 'app/actors/hyrax/actors/interpret_visibility_actor.rb' + - 'app/actors/hyrax/actors/ordered_members_actor.rb' + - 'app/models/concerns/hyrax/file_set/characterization.rb' + - 'app/presenters/hyrax/file_usage.rb' + - 'app/presenters/hyrax/work_usage.rb' + - 'app/services/hyrax/batch_create_failure_service.rb' + - 'app/services/hyrax/batch_create_success_service.rb' + - 'app/services/hyrax/collection_types/create_service.rb' + - 'app/services/hyrax/solr_query_service.rb' + - 'lib/hyrax/form_fields.rb' + - 'lib/hyrax/health_checks/solr_check.rb' + - 'lib/hyrax/schema.rb' diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 902a16471..ad19a7fd2 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,186 +1,139 @@ # This configuration was generated by -# `rubocop --auto-gen-config` -# on 2020-05-15 17:53:23 +0000 using RuboCop version 0.52.1. +# `rubocop --auto-gen-config --no-auto-gen-timestamp` +# using RuboCop version 1.28.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: 1 -Lint/AmbiguousBlockAssociation: - Exclude: - - 'app/controllers/catalog_controller.rb' - -# Offense count: 5 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyleAlignWith, AutoCorrect. -# SupportedStylesAlignWith: keyword, variable, start_of_line -Lint/EndAlignment: +# Offense count: 2 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, AllowAdjacentOneLineDefs, NumberOfEmptyLines. +Layout/EmptyLineBetweenDefs: Exclude: - - 'app/helpers/blacklight/catalog_helper_behavior.rb' + - 'app/jobs/bulkrax/import_file_set_job.rb' + - 'app/models/bulkrax/entry.rb' # Offense count: 2 -Lint/UselessAssignment: +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: empty_lines, no_empty_lines +Layout/EmptyLinesAroundBlockBody: Exclude: - - 'app/forms/hyrax/forms/admin/appearance.rb' - - 'spec/controllers/proprietor/users_controller_spec.rb' - -# Offense count: 10 -Metrics/AbcSize: - Max: 49 + - 'spec/rails_helper.rb' # Offense count: 3 -# Configuration parameters: CountComments. -Metrics/ClassLength: - Max: 112 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. +# SupportedHashRocketStyles: key, separator, table +# SupportedColonStyles: key, separator, table +# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit +Layout/HashAlignment: + Exclude: + - 'app/parsers/bulkrax/csv_parser.rb' + - 'spec/models/bulkrax/rdf_entry_spec.rb' + - 'spec/models/bulkrax/xml_entry_spec.rb' -# Offense count: 2 -Metrics/CyclomaticComplexity: - Max: 12 +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: Width, AllowedPatterns, IgnoredPatterns. +Layout/IndentationWidth: + Exclude: + - 'spec/rails_helper.rb' -# Offense count: 23 -# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. +# Offense count: 8 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns. # URISchemes: http, https -Metrics/LineLength: - Max: 376 - -# Offense count: 7 -# Configuration parameters: CountComments. -Metrics/MethodLength: - Max: 35 +Layout/LineLength: + Max: 301 # Offense count: 1 -# Configuration parameters: CountComments. -Metrics/ModuleLength: - Max: 168 - -# Offense count: 2 -Metrics/PerceivedComplexity: - Max: 14 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: symmetrical, new_line, same_line +Layout/MultilineMethodCallBraceLayout: + Exclude: + - 'app/parsers/bulkrax/csv_parser.rb' # Offense count: 1 -# Configuration parameters: Blacklist. -# Blacklist: END, (?-mix:EO[A-Z]{1}) -Naming/HeredocDelimiterNaming: +# This cop supports safe auto-correction (--auto-correct). +Layout/RescueEnsureAlignment: Exclude: - - 'spec/jobs/import_work_from_purl_job_spec.rb' - -# Offense count: 6 -# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist, MethodDefinitionMacros. -# NamePrefix: is_, has_, have_ -# NamePrefixBlacklist: is_, has_, have_ -# NameWhitelist: is_a? -# MethodDefinitionMacros: define_method, define_singleton_method -Naming/PredicateName: - Exclude: - - 'spec/**/*' - - 'app/controllers/application_controller.rb' - - 'app/helpers/blacklight/catalog_helper_behavior.rb' - - 'app/models/user.rb' + - 'spec/rails_helper.rb' -# Offense count: 6 -RSpec/BeforeAfterAll: - Exclude: - - 'spec/spec_helper.rb' +# Offense count: 7 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: AllowInHeredoc. +Layout/TrailingWhitespace: + Exclude: + - 'app/models/bulkrax/csv_entry.rb' + - 'app/parsers/bulkrax/csv_parser.rb' + - 'spec/models/bulkrax/rdf_entry_spec.rb' + - 'spec/models/bulkrax/xml_entry_spec.rb' - 'spec/rails_helper.rb' - - 'spec/support/**/*.rb' - - 'spec/models/hyku/group_spec.rb' - - 'spec/models/uploaded_file_spec.rb' - - 'spec/tasks/rake_spec.rb' -# Offense count: 85 -# Configuration parameters: Prefixes. -# Prefixes: when, with, without -RSpec/ContextWording: - Enabled: false +# Offense count: 16 +# Configuration parameters: IgnoredMethods, CountRepeatedAttributes. +Metrics/AbcSize: + Max: 42 -# Offense count: 3 -RSpec/ExpectInHook: - Exclude: - - 'spec/controllers/sites_controller_spec.rb' - - 'spec/models/uploaded_file_spec.rb' +# Offense count: 4 +# Configuration parameters: CountComments, CountAsOne. +Metrics/ClassLength: + Max: 201 -# Offense count: 1 -RSpec/IteratedExpectation: - Exclude: - - 'spec/tasks/rake_spec.rb' +# Offense count: 13 +# Configuration parameters: IgnoredMethods. +Metrics/CyclomaticComplexity: + Max: 19 -# Offense count: 4 -RSpec/LetSetup: - Exclude: - - 'spec/models/account_spec.rb' - - 'spec/models/role_spec.rb' - - 'spec/models/user_spec.rb' +# Offense count: 32 +# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods. +Metrics/MethodLength: + Max: 26 # Offense count: 2 -RSpec/MessageChain: - Exclude: - - 'spec/views/shared/select_work_type_modal.html.erb_spec.rb' +# Configuration parameters: CountComments, CountAsOne. +Metrics/ModuleLength: + Max: 131 -# Offense count: 8 -RSpec/ScatteredLet: - Exclude: - - 'spec/controllers/account_sign_up_controller_spec.rb' - - 'spec/controllers/admin/accounts_controller_spec.rb' - - 'spec/controllers/proprietor/accounts_controller_spec.rb' - - 'spec/jobs/import_work_from_purl_job_spec.rb' +# Offense count: 9 +# Configuration parameters: IgnoredMethods. +Metrics/PerceivedComplexity: + Max: 19 # Offense count: 1 # Configuration parameters: Include. # Include: app/models/**/*.rb Rails/HasManyOrHasOneDependent: Exclude: - - 'app/models/endpoint.rb' + - 'app/models/concerns/bulkrax/status_info.rb' -# Offense count: 5 -Rails/OutputSafety: - Exclude: - - 'app/forms/hyrax/forms/admin/appearance.rb' - - 'app/helpers/blacklight/catalog_helper_behavior.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: AutoCorrect, EnforcedStyle. -# SupportedStyles: nested, compact -Style/ClassAndModuleChildren: - Exclude: - - 'app/helpers/blacklight/catalog_helper_behavior.rb' - -# Offense count: 3 -# Configuration parameters: EnforcedStyle. -# SupportedStyles: annotated, template, unannotated -Style/FormatStringToken: +# Offense count: 2 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: Keywords, RequireColon. +# Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE +Style/CommentAnnotation: Exclude: - - 'app/models/account.rb' - - 'spec/models/account_spec.rb' + - 'app/models/bulkrax/xml_entry.rb' + - 'spec/models/bulkrax/oai_entry_spec.rb' -# Offense count: 4 -# Configuration parameters: MinBodyLength. -Style/GuardClause: +# Offense count: 2 +# This cop supports safe auto-correction (--auto-correct). +Style/IfUnlessModifier: Exclude: - - 'app/controllers/application_controller.rb' - - 'app/controllers/hyrax/downloads_controller.rb' - - 'app/helpers/blacklight/catalog_helper_behavior.rb' - - 'app/models/bulkrax/entry.rb' + - 'app/models/bulkrax/csv_entry.rb' + - 'lib/generators/bulkrax/templates/config/initializers/bulkrax.rb' # Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: line_count_dependent, lambda, literal -Style/Lambda: +# This cop supports safe auto-correction (--auto-correct). +Style/MultilineIfModifier: Exclude: - - 'app/models/user.rb' + - 'app/models/bulkrax/csv_entry.rb' # Offense count: 1 -Style/MixinUsage: +# This cop supports safe auto-correction (--auto-correct). +Style/RedundantBegin: Exclude: - - 'spec/support/devise.rb' - -# Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: AutoCorrect, EnforcedStyle. -# SupportedStyles: predicate, comparison -Style/NumericPredicate: - Exclude: - - 'spec/**/*' - - 'app/helpers/blacklight/catalog_helper_behavior.rb' + - 'spec/rails_helper.rb' diff --git a/Dockerfile b/Dockerfile index da22d3d7c..325d61452 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG HYRAX_IMAGE_VERSION=hyrax-v5.0.0.rc2 +ARG HYRAX_IMAGE_VERSION=hyrax-v5.0.0.rc1 FROM ghcr.io/samvera/hyrax/hyrax-base:$HYRAX_IMAGE_VERSION as hyku-base USER root diff --git a/Gemfile b/Gemfile index 1ddb2fe60..a676dbfcb 100644 --- a/Gemfile +++ b/Gemfile @@ -19,6 +19,7 @@ gem 'blacklight_range_limit' gem 'bolognese', '>= 1.9.10' gem 'bootstrap', '~> 4.6' gem 'bootstrap-datepicker-rails' +gem 'bixby', '~> 5.0', '>= 5.0.2', group: %i[development test] gem 'bulkrax', '~> 5.4' gem 'byebug', group: %i[development test] gem 'capybara', group: %i[test] @@ -61,7 +62,7 @@ gem 'omniauth-rails_csrf_protection', '~> 1.0' gem 'omniauth-saml', '~> 2.1' gem 'omniauth_openid_connect' gem 'order_already' -gem 'parser', '~> 2.5.3' +gem 'parser', '>= 3.1.0.0' gem 'pg' gem 'postrank-uri', '>= 1.0.24' gem 'pry-byebug', group: %i[development test] @@ -79,8 +80,9 @@ gem 'rspec-its', group: %i[test] gem 'rspec-rails', '>= 3.6.0', group: %i[development test] gem 'rspec-retry', group: %i[test] gem 'rspec_junit_formatter', group: %i[test] -gem 'rubocop', '~> 0.50', '<= 0.52.1', group: %i[development test] +gem 'rubocop', '1.28.2', group: %i[development test] gem 'rubocop-rspec', '~> 1.22', '<= 1.22.2', group: %i[development test] +gem 'rubocop-rails', '~> 2.15', group: %i[development test] gem 'sass-rails', '~> 6.0' # Use SCSS for stylesheets gem 'scss_lint', require: false, group: %i[development] gem 'secure_headers' diff --git a/Gemfile.lock b/Gemfile.lock index c397bf7af..6676493a1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -274,6 +274,12 @@ GEM bigdecimal (3.1.5) bindata (2.4.15) bindex (0.8.1) + bixby (5.0.2) + rubocop (= 1.28.2) + rubocop-ast + rubocop-performance + rubocop-rails + rubocop-rspec blacklight (7.35.0) deprecation globalid @@ -916,8 +922,9 @@ GEM os (1.1.4) ostruct (0.6.0) parallel (1.23.0) - parser (2.5.3.0) - ast (~> 2.4.0) + parser (3.2.2.4) + ast (~> 2.4.1) + racc parslet (2.0.0) pg (1.5.4) popper_js (1.16.1) @@ -926,7 +933,6 @@ GEM addressable (>= 2.4.0) nokogiri (>= 1.8.0) public_suffix (>= 4.0.0, < 5) - powerpack (0.1.3) pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) @@ -1136,13 +1142,24 @@ GEM rspec-support (3.12.1) rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (0.52.1) + rubocop (1.28.2) parallel (~> 1.10) - parser (>= 2.4.0.2, < 3.0) - powerpack (~> 0.1) + parser (>= 3.1.0.0) rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml + rubocop-ast (>= 1.17.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (~> 1.0, >= 1.0.1) + unicode-display_width (>= 1.4.0, < 3.0) + rubocop-ast (1.30.0) + parser (>= 3.2.1.0) + rubocop-performance (1.19.1) + rubocop (>= 1.7.0, < 2.0) + rubocop-ast (>= 0.4.0) + rubocop-rails (2.15.2) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.7.0, < 2.0) rubocop-rspec (1.22.2) rubocop (>= 0.52.1) ruby-box (1.15.0) @@ -1347,6 +1364,7 @@ GEM zlib (2.1.1) PLATFORMS + aarch64-linux-musl x86_64-linux-musl DEPENDENCIES @@ -1356,6 +1374,7 @@ DEPENDENCIES addressable (= 2.8.1) apartment! aws-sdk-sqs + bixby (~> 5.0, >= 5.0.2) blacklight (~> 7.29) blacklight_advanced_search blacklight_oai_provider (~> 7.0) @@ -1405,7 +1424,7 @@ DEPENDENCIES omniauth-saml (~> 2.1) omniauth_openid_connect order_already - parser (~> 2.5.3) + parser (>= 3.1.0.0) pg postrank-uri (>= 1.0.24) pry-byebug @@ -1424,7 +1443,8 @@ DEPENDENCIES rspec-rails (>= 3.6.0) rspec-retry rspec_junit_formatter - rubocop (~> 0.50, <= 0.52.1) + rubocop (= 1.28.2) + rubocop-rails (~> 2.15) rubocop-rspec (~> 1.22, <= 1.22.2) sass-rails (~> 6.0) scss_lint diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 18b2d58b4..df85c9a77 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -25,7 +25,7 @@ def locale_for(type:, term:, record_class:) locale end - def missing_translation(value, options = {}) + def missing_translation(value, _options = {}) value.include?('translation missing') end end