From 426c884270761aa0a1b9f60d252ee33e21519360 Mon Sep 17 00:00:00 2001 From: Cory Lown Date: Mon, 15 Jul 2024 13:05:52 -0400 Subject: [PATCH 1/4] Backport: Call the on_error handler with the correct number of arguments. --- app/services/spotlight/etl/solr_loader.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/spotlight/etl/solr_loader.rb b/app/services/spotlight/etl/solr_loader.rb index 08631d58a..658300403 100644 --- a/app/services/spotlight/etl/solr_loader.rb +++ b/app/services/spotlight/etl/solr_loader.rb @@ -53,7 +53,7 @@ def send_one(document, pipeline) data: [document].to_json, headers: { 'Content-Type' => 'application/json' } rescue StandardError => e - pipeline&.on_error(self, e, document.to_json) + pipeline&.on_error(e, document.to_json) end def blacklight_solr From 599f0760581584285d05a0ffa6a89e0ba93a5867 Mon Sep 17 00:00:00 2001 From: Cory Lown Date: Mon, 15 Jul 2024 13:21:27 -0400 Subject: [PATCH 2/4] Remove unrecognized rubocop matcher --- .rubocop.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 8a3d2fab5..f830d2f0b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -20,9 +20,6 @@ Bundler/DuplicatedGem: Bundler/OrderedGems: Enabled: false -RSpec/Capybara/VisibilityMatcher: - Enabled: false - Layout/EmptyLinesAroundAttributeAccessor: Enabled: true From 58a76fe23b4477ad3d5cebaeecb7f2cf43085b32 Mon Sep 17 00:00:00 2001 From: Cory Lown Date: Mon, 15 Jul 2024 13:21:41 -0400 Subject: [PATCH 3/4] Add rubocop-capybara --- blacklight-spotlight.gemspec | 1 + 1 file changed, 1 insertion(+) diff --git a/blacklight-spotlight.gemspec b/blacklight-spotlight.gemspec index 95ba30581..4ddb2a486 100644 --- a/blacklight-spotlight.gemspec +++ b/blacklight-spotlight.gemspec @@ -71,6 +71,7 @@ these collections.) s.add_development_dependency 'rspec-its' s.add_development_dependency 'rspec-rails', '>= 4.0.0.beta1' s.add_development_dependency 'rubocop', '~> 1.8' + s.add_development_dependency 'rubocop-capybara' s.add_development_dependency 'rubocop-rails' s.add_development_dependency 'rubocop-rspec' s.add_development_dependency 'selenium-webdriver' From da681b8fb2b5826303745e32b56b9a46b0fa8852 Mon Sep 17 00:00:00 2001 From: Cory Lown Date: Mon, 15 Jul 2024 13:21:55 -0400 Subject: [PATCH 4/4] Autogenerate rubocop todo --- .rubocop_todo.yml | 347 ++++++++++++++++++++++++++++------------------ 1 file changed, 210 insertions(+), 137 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index f47f5255a..3df5a84c0 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,21 +1,13 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2021-05-05 23:47:56 UTC using RuboCop version 1.13.0. +# on 2024-07-15 17:19:28 UTC using RuboCop version 1.64.1. # 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 -# Cop supports --auto-correct. -# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include. -# Include: **/*.gemspec -Gemspec/OrderedDependencies: - Exclude: - - 'blacklight-spotlight.gemspec' - # Offense count: 3 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyleAlignWith, Severity. # SupportedStylesAlignWith: start_of_line, begin Layout/BeginEndAlignment: @@ -24,17 +16,17 @@ Layout/BeginEndAlignment: - 'app/services/spotlight/iiif_resource_resolver.rb' # Offense count: 3 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Layout/RescueEnsureAlignment: Exclude: - 'app/models/spotlight/analytics/ga.rb' - 'app/services/spotlight/iiif_resource_resolver.rb' -# Offense count: 4 -# Configuration parameters: IgnoredMethods. +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowedMethods, AllowedPatterns. Lint/AmbiguousBlockAssociation: Exclude: - - 'spec/controllers/spotlight/featured_images_controller_spec.rb' - 'spec/controllers/spotlight/roles_controller_spec.rb' - 'spec/features/report_a_problem_spec.rb' - 'spec/models/spotlight/resources/iiif_service_spec.rb' @@ -51,6 +43,21 @@ Lint/ConstantDefinitionInBlock: - 'spec/models/spotlight/browse_category_search_builder_spec.rb' - 'spec/models/spotlight/resources/web_spec.rb' +# Offense count: 28 +# Configuration parameters: DebuggerMethods, DebuggerRequires. +Lint/Debugger: + Exclude: + - 'spec/features/javascript/blocks/browse_group_categories_block_spec.rb' + - 'spec/features/javascript/blocks/featured_browse_categories_block_spec.rb' + - 'spec/features/javascript/blocks/featured_pages_block_spec.rb' + - 'spec/features/javascript/blocks/link_to_search_block_spec.rb' + - 'spec/features/javascript/blocks/rule_block_spec.rb' + - 'spec/features/javascript/blocks/search_result_block_spec.rb' + - 'spec/features/javascript/blocks/solr_documents_block_spec.rb' + - 'spec/features/javascript/blocks/solr_documents_carousel_block_spec.rb' + - 'spec/features/javascript/blocks/uploaded_items_block_spec.rb' + - 'spec/features/javascript/multi_image_select_spec.rb' + # Offense count: 2 # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches. Lint/DuplicateBranch: @@ -58,11 +65,6 @@ Lint/DuplicateBranch: - 'app/controllers/spotlight/concerns/application_controller.rb' - 'app/models/spotlight/resources/iiif_manifest.rb' -# Offense count: 1 -Lint/DuplicateRequire: - Exclude: - - 'spec/spec_helper.rb' - # Offense count: 2 # Configuration parameters: AllowComments, AllowEmptyLambdas. Lint/EmptyBlock: @@ -84,28 +86,20 @@ Lint/MissingCopEnableDirective: - 'app/models/spotlight/blacklight_configuration.rb' - 'lib/spotlight/engine.rb' -# Offense count: 2 +# Offense count: 1 +# Configuration parameters: AllowedParentClasses. Lint/MissingSuper: Exclude: - 'app/services/spotlight/carrierwave_file_resolver.rb' - - 'spec/models/spotlight/access_controls_enforcement_search_builder_spec.rb' # Offense count: 1 Lint/NoReturnInBeginEndBlocks: Exclude: - 'app/models/spotlight/exhibit.rb' -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: AllowedMethods. -# AllowedMethods: instance_of?, kind_of?, is_a?, eql?, respond_to?, equal? -Lint/RedundantSafeNavigation: - Exclude: - - 'app/controllers/spotlight/catalog_controller.rb' - # Offense count: 3 -# Cop supports --auto-correct. -# Configuration parameters: AllowComments. +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AutoCorrect. Lint/UselessMethodDefinition: Exclude: - 'app/controllers/spotlight/about_pages_controller.rb' @@ -113,28 +107,28 @@ Lint/UselessMethodDefinition: - 'app/controllers/spotlight/home_pages_controller.rb' # Offense count: 25 -# Configuration parameters: IgnoredMethods, CountRepeatedAttributes. +# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. Metrics/AbcSize: Max: 22 -# Offense count: 7 -# Configuration parameters: IgnoredMethods. +# Offense count: 8 +# Configuration parameters: AllowedMethods, AllowedPatterns. Metrics/CyclomaticComplexity: Max: 9 -# Offense count: 10 -# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods. +# Offense count: 11 +# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. Metrics/MethodLength: Max: 11 # Offense count: 2 -# Configuration parameters: IgnoredMethods. +# Configuration parameters: AllowedMethods, AllowedPatterns. Metrics/PerceivedComplexity: Max: 10 -# Offense count: 6 +# Offense count: 7 # Configuration parameters: ForbiddenDelimiters. -# ForbiddenDelimiters: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$)) +# ForbiddenDelimiters: (?i-mx:(^|\s)(EO[A-Z]{1}|END)(\s|$)) Naming/HeredocDelimiterNaming: Exclude: - 'lib/generators/spotlight/install_generator.rb' @@ -142,6 +136,7 @@ Naming/HeredocDelimiterNaming: - 'spec/test_app_templates/lib/generators/test_app_generator.rb' # Offense count: 8 +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyleForLeadingUnderscores. # SupportedStylesForLeadingUnderscores: disallowed, required, optional Naming/MemoizedInstanceVariableName: @@ -156,7 +151,7 @@ Naming/MemoizedInstanceVariableName: # Offense count: 9 # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. -# AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to +# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to Naming/MethodParameterName: Exclude: - 'app/helpers/spotlight/crop_helper.rb' @@ -166,9 +161,9 @@ Naming/MethodParameterName: - 'app/models/spotlight/resources/iiif_manifest.rb' # Offense count: 14 -# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers. +# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns. # SupportedStyles: snake_case, normalcase, non_integer -# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339 +# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64 Naming/VariableNumber: Exclude: - 'spec/features/browse_category_navigation_spec.rb' @@ -176,23 +171,75 @@ Naming/VariableNumber: - 'spec/models/sir_trevor_rails/blocks/browse_block_spec.rb' - 'spec/services/spotlight/exhibit_import_export_service_spec.rb' -# Offense count: 64 +# Offense count: 65 RSpec/AnyInstance: Enabled: false +# Offense count: 36 +# This cop supports unsafe autocorrection (--autocorrect-all). +RSpec/BeEq: + Exclude: + - 'spec/controllers/spotlight/catalog_controller_spec.rb' + - 'spec/features/browse_category_admin_spec.rb' + - 'spec/helpers/spotlight/languages_helper_spec.rb' + - 'spec/lib/spotlight/controller_spec.rb' + - 'spec/models/sir_trevor_rails/blocks/solr_documents_block_spec.rb' + - 'spec/models/solr_document_spec.rb' + - 'spec/models/spotlight/blacklight_configuration_spec.rb' + - 'spec/models/spotlight/exhibit_spec.rb' + - 'spec/services/spotlight/exhibit_import_export_service_spec.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: be, be_nil +RSpec/BeNil: + Exclude: + - 'spec/features/browse_category_admin_spec.rb' + # Offense count: 2 RSpec/BeforeAfterAll: Exclude: - 'spec/features/exhibits/translation_editing_spec.rb' - 'spec/features/javascript/locale_selector_spec.rb' +# Offense count: 5 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: NegatedMatcher. +RSpec/ChangeByZero: + Exclude: + - 'spec/models/spotlight/exhibit_spec.rb' + - 'spec/services/spotlight/clone_translated_page_from_locale_spec.rb' + - 'spec/services/spotlight/invite_users_service_spec.rb' + +# Offense count: 25 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: be_a, be_kind_of +RSpec/ClassCheck: + Exclude: + - 'spec/controllers/application_controller_spec.rb' + - 'spec/controllers/spotlight/about_pages_controller_spec.rb' + - 'spec/controllers/spotlight/appearances_controller_spec.rb' + - 'spec/controllers/spotlight/catalog_controller_spec.rb' + - 'spec/models/sir_trevor_rails/block_spec.rb' + - 'spec/models/solr_document_spec.rb' + - 'spec/models/spotlight/blacklight_configuration_spec.rb' + - 'spec/models/spotlight/exhibit_spec.rb' + - 'spec/models/spotlight/resources/web_spec.rb' + - 'spec/models/spotlight/solr_document/uploaded_resource_spec.rb' + - 'spec/services/spotlight/carrierwave_file_resolver_spec.rb' + - 'spec/services/spotlight/exhibit_import_export_service_spec.rb' + # Offense count: 56 -# Configuration parameters: Prefixes. +# Configuration parameters: Prefixes, AllowedPatterns. # Prefixes: when, with, without RSpec/ContextWording: Enabled: false # Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AutoCorrect. RSpec/EmptyExampleGroup: Exclude: - 'spec/factories/tags.rb' @@ -204,6 +251,17 @@ RSpec/ExpectInHook: - 'spec/services/spotlight/iiif_resource_resolver_spec.rb' - 'spec/views/spotlight/catalog/_edit_default.html.erb_spec.rb' +# Offense count: 2 +RSpec/IdenticalEqualityAssertion: + Exclude: + - 'spec/models/solr_document_spec.rb' + - 'spec/models/spotlight/site_spec.rb' + +# Offense count: 71 +# Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns. +RSpec/IndexedLet: + Enabled: false + # Offense count: 5 RSpec/LeakyConstantDeclaration: Exclude: @@ -213,10 +271,20 @@ RSpec/LeakyConstantDeclaration: - 'spec/models/spotlight/browse_category_search_builder_spec.rb' - 'spec/models/spotlight/resources/web_spec.rb' -# Offense count: 57 +# Offense count: 59 RSpec/LetSetup: Enabled: false +# Offense count: 5 +# This cop supports safe autocorrection (--autocorrect). +RSpec/MatchArray: + Exclude: + - 'spec/controllers/spotlight/catalog_controller_spec.rb' + - 'spec/helpers/spotlight/languages_helper_spec.rb' + - 'spec/models/solr_document_spec.rb' + - 'spec/models/spotlight/exhibit_spec.rb' + - 'spec/services/spotlight/exhibit_import_export_service_spec.rb' + # Offense count: 4 RSpec/MessageChain: Exclude: @@ -231,27 +299,57 @@ RSpec/MessageChain: RSpec/MessageSpies: Enabled: false +# Offense count: 77 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: hash, symbol +RSpec/MetadataStyle: + Enabled: false + # Offense count: 2 RSpec/MissingExampleGroupArgument: Exclude: - 'spec/factories/tags.rb' - 'spec/views/spotlight/search_configurations/_facets.html.erb_spec.rb' -# Offense count: 84 +# Offense count: 85 # Configuration parameters: AllowSubject. RSpec/MultipleMemoizedHelpers: Max: 18 -# Offense count: 804 -# Configuration parameters: IgnoreSharedExamples. +# Offense count: 809 +# Configuration parameters: EnforcedStyle, IgnoreSharedExamples. +# SupportedStyles: always, named_only RSpec/NamedSubject: Enabled: false -# Offense count: 8 +# Offense count: 3 +# Configuration parameters: AllowedPatterns. +# AllowedPatterns: ^expect_, ^assert_ +RSpec/NoExpectationExample: + Exclude: + - 'spec/models/spotlight/custom_translation_extension_spec.rb' + - 'spec/services/spotlight/exhibit_import_export_service_spec.rb' + +# Offense count: 10 +RSpec/PendingWithoutReason: + Exclude: + - 'spec/features/import_exhibit_spec.rb' + - 'spec/features/javascript/blocks/featured_browse_categories_block_spec.rb' + - 'spec/features/javascript/blocks/featured_pages_block_spec.rb' + - 'spec/features/javascript/blocks/link_to_search_block_spec.rb' + - 'spec/i18n_spec.rb' + - 'spec/lib/spotlight/controller_spec.rb' + +# Offense count: 60 +# This cop supports unsafe autocorrection (--autocorrect-all). +RSpec/ReceiveMessages: + Enabled: false + +# Offense count: 2 RSpec/RepeatedDescription: Exclude: - 'spec/models/spotlight/blacklight_configuration_spec.rb' - - 'spec/models/spotlight/solr_document_sidecar_spec.rb' # Offense count: 3 RSpec/RepeatedExampleGroupBody: @@ -259,6 +357,8 @@ RSpec/RepeatedExampleGroupBody: - 'spec/controllers/spotlight/featured_images_controller_spec.rb' # Offense count: 20 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AutoCorrect. RSpec/ScatteredSetup: Exclude: - 'spec/controllers/spotlight/solr_controller_spec.rb' @@ -270,15 +370,36 @@ RSpec/ScatteredSetup: - 'spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb' - 'spec/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb_spec.rb' +# Offense count: 17 +# This cop supports safe autocorrection (--autocorrect). +RSpec/SortMetadata: + Enabled: false + # Offense count: 59 RSpec/StubbedMock: Enabled: false +# Offense count: 2 +RSpec/SubjectDeclaration: + Exclude: + - 'spec/models/sir_trevor_rails/blocks/textable_spec.rb' + - 'spec/presenters/spotlight/iiif_manifest_presenter_spec.rb' + # Offense count: 70 RSpec/SubjectStub: Enabled: false -# Offense count: 71 +# Offense count: 3 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: constant, string +RSpec/VerifiedDoubleReference: + Exclude: + - 'spec/controllers/spotlight/bulk_actions_controller_spec.rb' + - 'spec/controllers/spotlight/catalog_controller_spec.rb' + - 'spec/views/spotlight/translations/_page.html.erb_spec.rb' + +# Offense count: 70 # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames. RSpec/VerifiedDoubles: Enabled: false @@ -289,13 +410,13 @@ RSpec/VoidExpect: - 'spec/helpers/spotlight/crud_link_helpers_spec.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). Rails/ApplicationController: Exclude: - 'spec/lib/spotlight/controller_spec.rb' # Offense count: 3 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). Rails/ApplicationMailer: Exclude: - 'app/mailers/spotlight/confirmation_mailer.rb' @@ -303,12 +424,12 @@ Rails/ApplicationMailer: - 'app/mailers/spotlight/invitation_mailer.rb' # Offense count: 23 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). Rails/ApplicationRecord: Enabled: false # Offense count: 12 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: NilOrEmpty, NotPresent, UnlessPresent. Rails/Blank: Exclude: @@ -323,26 +444,17 @@ Rails/Blank: - 'lib/migration/iiif.rb' - 'spec/support/features/test_features_helpers.rb' -# Offense count: 9 -# Cop supports --auto-correct. -Rails/ContentTag: - Exclude: - - 'app/builders/spotlight/bootstrap_breadcrumbs_builder.rb' - - 'app/helpers/spotlight/crop_helper.rb' - - 'app/helpers/spotlight/crud_link_helpers.rb' - - 'app/helpers/spotlight/title_helper.rb' - # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Whitelist, AllowedMethods, AllowedReceivers. -# Whitelist: find_by_sql -# AllowedMethods: find_by_sql -# AllowedReceivers: Gem::Specification +# Whitelist: find_by_sql, find_by_token_for +# AllowedMethods: find_by_sql, find_by_token_for +# AllowedReceivers: Gem::Specification, page Rails/DynamicFindBy: Exclude: - 'app/models/spotlight/role.rb' -# Offense count: 6 +# Offense count: 10 # Configuration parameters: Include. # Include: app/models/**/*.rb Rails/HasManyOrHasOneDependent: @@ -364,7 +476,7 @@ Rails/HelperInstanceVariable: - 'app/helpers/spotlight/title_helper.rb' # Offense count: 2 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: numeric, symbolic Rails/HttpStatus: @@ -373,14 +485,14 @@ Rails/HttpStatus: - 'app/controllers/spotlight/solr_controller.rb' # Offense count: 2 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Rails/IndexBy: Exclude: - 'app/helpers/spotlight/roles_helper.rb' - 'app/models/spotlight/resources/iiif_manifest.rb' # Offense count: 6 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Rails/IndexWith: Exclude: - 'app/controllers/spotlight/metadata_configurations_controller.rb' @@ -388,7 +500,7 @@ Rails/IndexWith: - 'app/models/spotlight/blacklight_configuration.rb' # Offense count: 4 -# Configuration parameters: Include. +# Configuration parameters: IgnoreScopes, Include. # Include: app/models/**/*.rb Rails/InverseOf: Exclude: @@ -397,30 +509,22 @@ Rails/InverseOf: # Offense count: 4 # Configuration parameters: Include. -# Include: app/controllers/**/*.rb +# Include: app/controllers/**/*.rb, app/mailers/**/*.rb Rails/LexicallyScopedActionFilter: Exclude: - 'app/controllers/spotlight/catalog_controller.rb' - 'app/controllers/spotlight/resources/upload_controller.rb' - 'app/controllers/spotlight/resources_controller.rb' -# Offense count: 4 +# Offense count: 3 Rails/OutputSafety: Exclude: - 'app/controllers/spotlight/application_controller.rb' - 'app/helpers/spotlight/pages_helper.rb' - 'app/helpers/spotlight/rendering_helper.rb' - - 'app/helpers/spotlight/title_helper.rb' - -# Offense count: 3 -# Cop supports --auto-correct. -Rails/Pluck: - Exclude: - - 'app/models/sir_trevor_rails/blocks/displayable.rb' - - 'app/models/sir_trevor_rails/blocks/solr_documents_block.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. # SupportedStyles: conservative, aggressive Rails/PluckInWhere: @@ -428,7 +532,7 @@ Rails/PluckInWhere: - 'app/models/concerns/spotlight/user.rb' # Offense count: 5 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Rails/Presence: Exclude: - 'app/helpers/spotlight/application_helper.rb' @@ -437,7 +541,7 @@ Rails/Presence: - 'app/models/spotlight/main_navigation.rb' # Offense count: 13 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: NotNilAndNotEmpty, NotBlank, UnlessBlank. Rails/Present: Exclude: @@ -446,7 +550,7 @@ Rails/Present: - 'app/models/spotlight/blacklight_configuration.rb' # Offense count: 3 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Include. # Include: **/Rakefile, **/*.rake Rails/RakeEnvironment: @@ -455,6 +559,7 @@ Rails/RakeEnvironment: - 'spec/test_app_templates/spotlight_test.rake' # Offense count: 4 +# This cop supports unsafe autocorrection (--autocorrect-all). Rails/ReflectionClassName: Exclude: - 'app/models/spotlight/exhibit.rb' @@ -462,7 +567,7 @@ Rails/ReflectionClassName: - 'app/models/spotlight/role.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: conservative, aggressive Rails/ShortI18n: @@ -478,14 +583,14 @@ Rails/SkipsModelValidations: - 'app/models/spotlight/resource.rb' # Offense count: 1 -# Configuration parameters: Environments. +# Configuration parameters: Severity, Environments. # Environments: development, test, production Rails/UnknownEnv: Exclude: - 'spec/test_app_templates/carrierwave.rb' # Offense count: 2 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: separated, grouped Style/AccessorGrouping: @@ -493,28 +598,14 @@ Style/AccessorGrouping: - 'app/jobs/spotlight/add_uploads_from_csv.rb' # Offense count: 1 -# Configuration parameters: AllowedChars. -# AllowedChars: © -Style/AsciiComments: - Exclude: - - 'app/models/spotlight/featured_image.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: nested, compact -Style/ClassAndModuleChildren: - Exclude: - - 'lib/generators/spotlight/templates/config/initializers/sir_trevor_rails.rb' - -# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). Style/CombinableLoops: Exclude: - 'app/services/spotlight/exhibit_import_export_service.rb' # Offense count: 4 -# Cop supports --auto-correct. -# Configuration parameters: Keywords. +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Keywords, RequireColon. # Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE Style/CommentAnnotation: Exclude: @@ -524,13 +615,13 @@ Style/CommentAnnotation: - 'spec/controllers/spotlight/contact_email_controller_spec.rb' # Offense count: 2 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). Style/CommentedKeyword: Exclude: - 'spec/features/javascript/search_config_admin_spec.rb' # Offense count: 4 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Style/ExplicitBlockArgument: Exclude: - 'app/controllers/spotlight/translations_controller.rb' @@ -539,13 +630,13 @@ Style/ExplicitBlockArgument: - 'app/models/spotlight/search.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). Style/GlobalStdStream: Exclude: - 'lib/tasks/spotlight_tasks.rake' # Offense count: 3 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: braces, no_braces Style/HashAsLastArrayItem: @@ -554,19 +645,13 @@ Style/HashAsLastArrayItem: - 'app/controllers/spotlight/pages_controller.rb' # Offense count: 1 -# Cop supports --auto-correct. -Style/HashEachMethods: - Exclude: - - 'app/models/spotlight/blacklight_configuration.rb' - -# Offense count: 1 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). Style/HashTransformKeys: Exclude: - 'app/models/spotlight/field_metadata.rb' # Offense count: 4 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). Style/HashTransformValues: Exclude: - 'app/models/concerns/spotlight/blacklight_configuration_defaults.rb' @@ -574,41 +659,29 @@ Style/HashTransformValues: - 'app/models/spotlight/page_configurations.rb' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports safe autocorrection (--autocorrect). Style/KeywordParametersOrder: Exclude: - 'lib/spotlight/upload_field_config.rb' # Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, IgnoredMethods. +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns. # SupportedStyles: predicate, comparison Style/NumericPredicate: Exclude: - 'lib/tasks/spotlight_tasks.rake' # Offense count: 1 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Methods. Style/RedundantArgument: Exclude: - 'app/helpers/spotlight/search_configurations_helper.rb' -# Offense count: 1 -# Cop supports --auto-correct. -Style/RedundantRegexpCharacterClass: - Exclude: - - 'app/models/spotlight/contact_form.rb' - -# Offense count: 3 -# Cop supports --auto-correct. -Style/RedundantRegexpEscape: - Exclude: - - 'app/helpers/spotlight/pages_helper.rb' - - 'app/models/spotlight/contact_form.rb' - # Offense count: 4 -# Cop supports --auto-correct. +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Mode. Style/StringConcatenation: Exclude: - 'lib/generators/spotlight/install_generator.rb'