From 0463639defc92d52a306b2f3fb9eea6beea91c01 Mon Sep 17 00:00:00 2001 From: Randall Floyd Date: Wed, 10 Jun 2020 16:12:24 -0400 Subject: [PATCH] Upgrading Bixby to 3.0 --- .rubocop.yml | 94 ++------------- .rubocop_todo.yml | 269 +++++++++++++++++++++++++------------------ hydra-editor.gemspec | 2 +- 3 files changed, 168 insertions(+), 197 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 4267899..a3cb38c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,99 +1,19 @@ inherit_gem: bixby: bixby_default.yml -inherit_from: .rubocop_todo.yml AllCops: - DisplayCopNames: true - Include: - - '**/Rakefile' - - '**/config.ru' - Exclude: - - 'db/**/*' - - 'script/**/*' - - 'spec/test_app_templates/**/*' - - 'vendor/bundle/**/*' - -Bundler/DuplicatedGem: - Exclude: - - 'Gemfile' + TargetRubyVersion: 2.6 -Layout/IndentationConsistency: - EnforcedStyle: rails - -Metrics/AbcSize: - Max: 50 - -Metrics/BlockLength: - Exclude: - - 'hydra-editor.gemspec' - - 'spec/views/records/_form.html.erb_spec.rb' - - 'spec/helpers/records_helper_spec.rb' - - 'spec/inputs/multi_value_input_spec.rb' - - 'spec/controllers/records_controller_spec.rb' - - 'spec/routing/records_routing_spec.rb' - - 'spec/presenters/hydra_editor_presenter_spec.rb' - - 'spec/forms/hydra_editor_form_permissions_spec.rb' - - 'spec/forms/hydra_editor_form_spec.rb' - - 'spec/features/record_editing_spec.rb' - -Metrics/LineLength: - Max: 400 - -Metrics/MethodLength: - Max: 30 +inherit_from: .rubocop_todo.yml Naming/FileName: Exclude: - - 'lib/tasks/hydra-editor_tasks.rake' + - '**/Gemfile' + - '**/*.rake' + - 'hydra-pcdm.gemspec' - 'lib/hydra-editor.rb' - - 'hydra-editor.gemspec' - - 'Gemfile' - 'spec/hydra-editor_spec.rb' -Rails: - Enabled: true - -RSpec/AnyInstance: - Exclude: - - 'spec/features/record_editing_spec.rb' - - 'spec/features/create_record_spec.rb' - -RSpec/DescribeClass: - Exclude: - - 'spec/views/records/edit_fields/_default.html.erb_spec.rb' - - 'spec/views/records/_form.html.erb_spec.rb' - - 'spec/routing/records_routing_spec.rb' - - 'spec/javascripts/jasmine_spec.rb' - - 'spec/features/record_editing_spec.rb' - -RSpec/ExampleLength: - Exclude: - - 'spec/helpers/records_helper_spec.rb' - - 'spec/javascripts/jasmine_spec.rb' - - 'spec/features/record_editing_spec.rb' - - 'spec/features/create_record_spec.rb' - -RSpec/InstanceVariable: - Exclude: - - 'spec/controllers/records_controller_spec.rb' - -RSpec/VerifiedDoubles: +Metrics/BlockLength: Exclude: - - 'spec/inputs/multi_value_input_spec.rb' - - 'spec/helpers/records_helper_spec.rb' - - 'spec/forms/hydra_editor_form_spec.rb' - -Style/CollectionMethods: - PreferredMethods: - collect: 'map' - collect!: 'map!' - inject: 'reduce' - detect: 'find' - find_all: 'select' - - -Style/RegexpLiteral: - Enabled: false - -Style/SingleLineBlockParams: - Enabled: false + - 'spec/**/*.rb' \ No newline at end of file diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index c43e6ea..ca07903 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,188 +1,239 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2016-03-17 18:53:16 -0700 using RuboCop version 0.38.0. +# on 2020-06-10 15:17:29 -0400 using RuboCop version 0.85.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: 2 -# Configuration parameters: AllowSafeAssignment. -Lint/AssignmentInCondition: +# Offense count: 1 +# Configuration parameters: Include. +# Include: **/*.gemfile, **/Gemfile, **/gems.rb +Bundler/DuplicatedGem: Exclude: - - 'app/presenters/hydra/presenter.rb' - - 'app/services/hydra_editor/field_metadata_service.rb' + - 'Gemfile' -# Offense count: 2 +# Offense count: 1 # Cop supports --auto-correct. -# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods. -Lint/UnusedMethodArgument: +Layout/BlockEndNewline: Exclude: - - 'app/inputs/multi_value_input.rb' + - 'spec/forms/hydra_editor_form_permissions_spec.rb' -# Offense count: 1 -Lint/UselessAssignment: +# Offense count: 4 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: leading, trailing +Layout/DotPosition: Exclude: - - 'Rakefile' - -# Offense count: 2 -Metrics/AbcSize: - Max: 18 + - 'spec/forms/hydra_editor_form_spec.rb' + - 'spec/routing/records_routing_spec.rb' -# Offense count: 74 -# Configuration parameters: AllowHeredoc, AllowURI, URISchemes. -# URISchemes: http, https -Metrics/LineLength: - Max: 175 +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: AllowAdjacentOneLineDefs, NumberOfEmptyLines. +Layout/EmptyLineBetweenDefs: + Exclude: + - 'app/controllers/concerns/records_controller_behavior.rb' # Offense count: 2 -# Configuration parameters: CountComments. -Metrics/MethodLength: - Max: 13 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only +Layout/EmptyLinesAroundClassBody: + Exclude: + - 'spec/test_app_templates/lib/generators/test_app_generator.rb' # Offense count: 1 # Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. -# SupportedStyles: outdent, indent -Layout/AccessModifierIndentation: - Enabled: false +Layout/EmptyLinesAroundMethodBody: + Exclude: + - 'spec/test_app_templates/lib/generators/test_app_generator.rb' # Offense count: 1 -Naming/AccessorMethodName: +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: special_inside_parentheses, consistent, align_brackets +Layout/FirstArrayElementIndentation: Exclude: - - 'app/controllers/concerns/records_controller_behavior.rb' + - 'lib/hydra_editor/engine.rb' -# Offense count: 1 +# Offense count: 12 # Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, ProceduralMethods, FunctionalMethods, IgnoredMethods. -# SupportedStyles: line_count_based, semantic, braces_for_chaining -# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object -# FunctionalMethods: let, let!, subject, watch -# IgnoredMethods: lambda, proc, it -Style/BlockDelimiters: +# Configuration parameters: EnforcedStyle. +# SupportedStyles: normal, indented_internal_methods +Layout/IndentationConsistency: Exclude: - - 'spec/forms/hydra_editor_form_permissions_spec.rb' + - 'app/forms/hydra_editor/form.rb' + - 'app/inputs/multi_value_input.rb' + - 'app/presenters/hydra/presenter.rb' + +# Offense count: 12 +# Cop supports --auto-correct. +# Configuration parameters: Width, IgnoredPatterns. +Layout/IndentationWidth: + Exclude: + - 'app/forms/hydra_editor/form.rb' + - 'app/inputs/multi_value_input.rb' + - 'app/presenters/hydra/presenter.rb' # Offense count: 1 # Cop supports --auto-correct. -Layout/BlockEndNewline: +Layout/MultilineBlockLayout: Exclude: - 'spec/forms/hydra_editor_form_permissions_spec.rb' -# Offense count: 2 +# Offense count: 3 # Cop supports --auto-correct. -# Configuration parameters: SingleLineConditionsOnly. -Style/ConditionalAssignment: +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: aligned, indented, indented_relative_to_receiver +Layout/MultilineMethodCallIndentation: Exclude: - - 'app/forms/hydra_editor/form.rb' + - 'spec/routing/records_routing_spec.rb' -# Offense count: 19 -Style/Documentation: +# Offense count: 2 +# Configuration parameters: AllowSafeAssignment. +Lint/AssignmentInCondition: Exclude: - - 'spec/**/*' - - 'test/**/*' - - 'app/controllers/concerns/records_controller_behavior.rb' - - 'app/controllers/records_controller.rb' - - 'app/forms/hydra_editor/form.rb' - - 'app/forms/hydra_editor/form/permissions.rb' - - 'app/helpers/concerns/records_helper_behavior.rb' - - 'app/helpers/records_helper.rb' - - 'app/inputs/multi_value_input.rb' - 'app/presenters/hydra/presenter.rb' - 'app/services/hydra_editor/field_metadata_service.rb' - - 'lib/hydra-editor.rb' - - 'lib/hydra_editor/controller_resource.rb' - - 'lib/hydra_editor/engine.rb' -# Offense count: 4 +# Offense count: 2 # Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: leading, trailing -Layout/DotPosition: - Enabled: false +# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods. +Lint/UnusedMethodArgument: + Exclude: + - 'app/inputs/multi_value_input.rb' # Offense count: 1 -Style/EachWithObject: - Exclude: - - 'app/helpers/concerns/records_helper_behavior.rb' +# Configuration parameters: CountComments, ExcludedMethods. +# ExcludedMethods: refine +Metrics/BlockLength: + Max: 33 # Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: AllowAdjacentOneLineDefs. -Layout/EmptyLineBetweenDefs: +Naming/AccessorMethodName: Exclude: - 'app/controllers/concerns/records_controller_behavior.rb' -# Offense count: 1 -# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts. +# Offense count: 2 +# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, Regex, IgnoreExecutableScripts, AllowedAcronyms. +# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS Naming/FileName: Exclude: + - '**/Gemfile' + - '**/*.rake' + - 'hydra-pcdm.gemspec' - 'lib/hydra-editor.rb' + - 'spec/hydra-editor_spec.rb' + +# Offense count: 2 +# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros. +# NamePrefix: is_, has_, have_ +# ForbiddenPrefixes: is_, has_, have_ +# AllowedMethods: is_a? +# MethodDefinitionMacros: define_method, define_singleton_method +Naming/PredicateName: + Exclude: + - 'spec/**/*' + - 'app/controllers/concerns/records_controller_behavior.rb' + - 'lib/hydra_editor/controller_resource.rb' + +# Offense count: 3 +RSpec/AnyInstance: + Exclude: + - 'spec/features/create_record_spec.rb' + - 'spec/features/record_editing_spec.rb' + +# Offense count: 4 +RSpec/DescribeClass: + Exclude: + - 'spec/features/record_editing_spec.rb' + - 'spec/routing/records_routing_spec.rb' + - 'spec/views/records/_form.html.erb_spec.rb' + - 'spec/views/records/edit_fields/_default.html.erb_spec.rb' + +# Offense count: 6 +# Configuration parameters: Max. +RSpec/ExampleLength: + Exclude: + - 'spec/features/create_record_spec.rb' + - 'spec/features/record_editing_spec.rb' + - 'spec/helpers/records_helper_spec.rb' + - 'spec/javascripts/jasmine_spec.rb' # Offense count: 1 +# Configuration parameters: AssignmentOnly. +RSpec/InstanceVariable: + Exclude: + - 'spec/controllers/records_controller_spec.rb' + +# Offense count: 2 # Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. -# SupportedStyles: special_inside_parentheses, consistent, align_brackets -Layout/IndentArray: - Enabled: false +RSpec/LeadingSubject: + Exclude: + - 'spec/presenters/hydra_editor_presenter_spec.rb' + +# Offense count: 4 +# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames. +RSpec/VerifiedDoubles: + Exclude: + - 'spec/forms/hydra_editor_form_spec.rb' + - 'spec/helpers/records_helper_spec.rb' + - 'spec/inputs/multi_value_input_spec.rb' # Offense count: 1 # Cop supports --auto-correct. -Layout/MultilineBlockLayout: +# Configuration parameters: Include. +# Include: **/Rakefile, **/*.rake +Rails/RakeEnvironment: Exclude: - - 'spec/forms/hydra_editor_form_permissions_spec.rb' + - 'lib/capistrano/tasks/**/*.rake' + - 'Rakefile' -# Offense count: 3 +# Offense count: 2 # Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. -# SupportedStyles: aligned, indented -Layout/MultilineMethodCallIndentation: - Enabled: false +# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions. +# SupportedStyles: assign_to_condition, assign_inside_condition +Style/ConditionalAssignment: + Exclude: + - 'app/forms/hydra_editor/form.rb' # Offense count: 1 # Cop supports --auto-correct. -Style/MutableConstant: +Style/EachWithObject: Exclude: - - 'lib/hydra_editor/version.rb' + - 'app/helpers/concerns/records_helper_behavior.rb' -# Offense count: 2 -# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist. -# NamePrefix: is_, has_, have_ -# NamePrefixBlacklist: is_, has_, have_ -# NameWhitelist: is_a? -Naming/PredicateName: +# Offense count: 40 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: always, always_true, never +Style/FrozenStringLiteralComment: + Enabled: false + +# Offense count: 1 +# Cop supports --auto-correct. +Style/RedundantBegin: Exclude: - - 'app/controllers/concerns/records_controller_behavior.rb' - - 'lib/hydra_editor/controller_resource.rb' + - 'spec/features/record_editing_spec.rb' -# Offense count: 2 +# Offense count: 1 # Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes. -# SupportedStyles: slashes, percent_r, mixed -Style/RegexpLiteral: +# Configuration parameters: AllowMultipleReturnValues. +Style/RedundantReturn: Exclude: - - 'app/helpers/concerns/records_helper_behavior.rb' - - 'config/routes.rb' + - 'spec/support/rake.rb' -# Offense count: 2 +# Offense count: 1 # Cop supports --auto-correct. # Configuration parameters: AllowIfMethodIsEmpty. Style/SingleLineMethods: Exclude: - 'app/inputs/multi_value_input.rb' - - 'spec/inputs/multi_value_input_spec.rb' # Offense count: 1 # Cop supports --auto-correct. -# Configuration parameters: SupportedStyles. +# Configuration parameters: . # SupportedStyles: use_perl_names, use_english_names Style/SpecialGlobalVars: EnforcedStyle: use_perl_names - -# Offense count: 10 -# Cop supports --auto-correct. -# Configuration parameters: SupportedStyles, WordRegex. -# SupportedStyles: percent, brackets -Style/WordArray: - EnforcedStyle: percent - MinSize: 3 diff --git a/hydra-editor.gemspec b/hydra-editor.gemspec index 3d338d5..0320ec8 100644 --- a/hydra-editor.gemspec +++ b/hydra-editor.gemspec @@ -25,7 +25,7 @@ Gem::Specification.new do |s| s.add_dependency 'sprockets-es6' s.add_dependency 'thor', '~> 0.19' - s.add_development_dependency "bixby" + s.add_development_dependency "bixby", '~> 3.0' s.add_development_dependency "capybara", '~> 2.4' s.add_development_dependency "devise", '~> 4.0' s.add_development_dependency "engine_cart", '~> 2.2'