From b536c96b94dc3c2648c83844399641d8551fbe98 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 11 Jan 2025 14:13:25 -0800 Subject: [PATCH] build(deps-dev): bump rubocop from 1.69.2 to 1.70.0 (#4167) * build(deps-dev): bump rubocop from 1.69.2 to 1.70.0 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.69.2 to 1.70.0. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.69.2...v1.70.0) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Fix rubocop 1.70 errors --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: M. Oleske --- Gemfile | 2 +- Gemfile.lock | 6 +++--- app/actions/task_cancel.rb | 2 +- app/messages/app_manifest_message.rb | 2 +- lib/cloud_controller/diego/task_environment.rb | 4 +--- lib/cloud_controller/diego/tasks_sync.rb | 2 +- spec/unit/lib/vcap/rest_api/query_spec.rb | 2 +- 7 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Gemfile b/Gemfile index e5d40dd2806..fef96f6cb39 100644 --- a/Gemfile +++ b/Gemfile @@ -83,7 +83,7 @@ group :test do gem 'rspec-its' gem 'rspec-rails', '~> 7.1.0' gem 'rspec-wait' - gem 'rubocop', '~> 1.69.2' + gem 'rubocop', '~> 1.70.0' gem 'rubocop-capybara' gem 'rubocop-factory_bot' gem 'rubocop-rails', '~> 2.28' diff --git a/Gemfile.lock b/Gemfile.lock index 1121f63d330..3f80c10d052 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -458,7 +458,7 @@ GEM activesupport (>= 3.0.0) mustache (~> 1.0, >= 0.99.4) rspec (~> 3.0) - rubocop (1.69.2) + rubocop (1.70.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -560,7 +560,7 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) uber (0.1.0) - unicode-display_width (3.1.2) + unicode-display_width (3.1.3) unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (4.0.4) useragent (0.16.10) @@ -647,7 +647,7 @@ DEPENDENCIES rspec-rails (~> 7.1.0) rspec-wait rspec_api_documentation (>= 6.1.0) - rubocop (~> 1.69.2) + rubocop (~> 1.70.0) rubocop-capybara rubocop-factory_bot rubocop-rails (~> 2.28) diff --git a/app/actions/task_cancel.rb b/app/actions/task_cancel.rb index 33c0ecb51a7..6ae45066a1b 100644 --- a/app/actions/task_cancel.rb +++ b/app/actions/task_cancel.rb @@ -26,7 +26,7 @@ def cancel(task:, user_audit_info:) attr_reader :config def reject_invalid_states!(task) - return unless task.state == TaskModel::SUCCEEDED_STATE || task.state == TaskModel::FAILED_STATE + return unless [TaskModel::SUCCEEDED_STATE, TaskModel::FAILED_STATE].include?(task.state) raise InvalidCancel.new("Task state is #{task.state} and therefore cannot be canceled") end diff --git a/app/messages/app_manifest_message.rb b/app/messages/app_manifest_message.rb index 705ddb9fe00..a2fa25dc55e 100644 --- a/app/messages/app_manifest_message.rb +++ b/app/messages/app_manifest_message.rb @@ -347,7 +347,7 @@ def convert_to_bytes_per_second(human_readable_byte_value) end def validate_byte_format(human_readable_byte_value, attribute_name, allow_unlimited: false) - byte_converter.convert_to_mb(human_readable_byte_value) unless allow_unlimited && (human_readable_byte_value.to_s == '-1' || human_readable_byte_value.to_s == '0') + byte_converter.convert_to_mb(human_readable_byte_value) unless allow_unlimited && ['-1', '0'].include?(human_readable_byte_value.to_s) nil rescue ByteConverter::InvalidUnitsError diff --git a/lib/cloud_controller/diego/task_environment.rb b/lib/cloud_controller/diego/task_environment.rb index e4da6bff6fb..df7b9f1c3c4 100644 --- a/lib/cloud_controller/diego/task_environment.rb +++ b/lib/cloud_controller/diego/task_environment.rb @@ -23,9 +23,7 @@ def build task_env = task_env.merge('VCAP_PLATFORM_OPTIONS' => credhub_url) if credhub_url.present? && cred_interpolation_enabled? - if app.lifecycle_type == BuildpackLifecycleDataModel::LIFECYCLE_TYPE || app.lifecycle_type == CNBLifecycleDataModel::LIFECYCLE_TYPE - task_env = task_env.merge('LANG' => DEFAULT_LANG) - end + task_env = task_env.merge('LANG' => DEFAULT_LANG) if [BuildpackLifecycleDataModel::LIFECYCLE_TYPE, CNBLifecycleDataModel::LIFECYCLE_TYPE].include?(app.lifecycle_type) task_env = task_env.merge('DATABASE_URL' => app.database_uri) if app.database_uri task_env diff --git a/lib/cloud_controller/diego/tasks_sync.rb b/lib/cloud_controller/diego/tasks_sync.rb index 2533cc5fd46..0391086ed5d 100644 --- a/lib/cloud_controller/diego/tasks_sync.rb +++ b/lib/cloud_controller/diego/tasks_sync.rb @@ -91,7 +91,7 @@ def diego_task_missing?(task_guid) def task_finished_while_iterating?(task_guid) cc_task = TaskModel.find(guid: task_guid) - cc_task.state == TaskModel::FAILED_STATE || cc_task.state == TaskModel::SUCCEEDED_STATE + [TaskModel::FAILED_STATE, TaskModel::SUCCEEDED_STATE].include?(cc_task.state) end def batched_cc_tasks diff --git a/spec/unit/lib/vcap/rest_api/query_spec.rb b/spec/unit/lib/vcap/rest_api/query_spec.rb index 5c7bfaa60b3..086521ad645 100644 --- a/spec/unit/lib/vcap/rest_api/query_spec.rb +++ b/spec/unit/lib/vcap/rest_api/query_spec.rb @@ -447,7 +447,7 @@ class Subscriber < Sequel::Model @queryable_attributes, q:) expected = Author.all.select do |a| - a.str_val == 'str 1' || a.str_val == 'str 2' + ['str 1', 'str 2'].include?(a.str_val) end expect(ds.all).to match_array(expected)