From 86e18abd0021eb2c0de123a457a5cb819fe4c037 Mon Sep 17 00:00:00 2001 From: Martin Gruner Date: Fri, 13 Aug 2021 08:03:57 +0200 Subject: [PATCH] Maintenance: Bump rubocop from 1.18.4 to 1.19.0 --- Gemfile.lock | 6 +++--- app/models/activity_stream.rb | 2 +- app/models/object_manager/element/backend.rb | 2 +- .../connection_adapters/postgresql/schema_statements.rb | 2 +- lib/search_knowledge_base_backend.rb | 2 ++ spec/models/ticket/state_spec.rb | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index f39837d38..5320f9e02 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -497,16 +497,16 @@ GEM rspec-support (~> 3.10) rspec-support (3.10.2) rszr (0.5.2) - rubocop (1.18.4) + rubocop (1.19.0) parallel (~> 1.10) parser (>= 3.0.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml - rubocop-ast (>= 1.8.0, < 2.0) + rubocop-ast (>= 1.9.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.8.0) + rubocop-ast (1.10.0) parser (>= 3.0.1.1) rubocop-faker (1.1.0) faker (>= 2.12.0) diff --git a/app/models/activity_stream.rb b/app/models/activity_stream.rb index f35d513a5..afc597254 100644 --- a/app/models/activity_stream.rb +++ b/app/models/activity_stream.rb @@ -56,7 +56,7 @@ add a new activity entry for an object # check newest entry - is needed result = ActivityStream.where( o_id: data[:o_id], - #:activity_stream_type_id => type_id, + # :activity_stream_type_id => type_id, permission_id: permission_id, activity_stream_object_id: object_id, created_by_id: data[:created_by_id] diff --git a/app/models/object_manager/element/backend.rb b/app/models/object_manager/element/backend.rb index ab5a2307d..9851f14f4 100644 --- a/app/models/object_manager/element/backend.rb +++ b/app/models/object_manager/element/backend.rb @@ -38,7 +38,7 @@ class ObjectManager::Element::Backend name: attribute.name, display: attribute.display, tag: attribute.data_type, - #:null => attribute.null, + # :null => attribute.null, } end diff --git a/lib/core_ext/active_record/connection_adapters/postgresql/schema_statements.rb b/lib/core_ext/active_record/connection_adapters/postgresql/schema_statements.rb index 53540192a..a9537aa29 100644 --- a/lib/core_ext/active_record/connection_adapters/postgresql/schema_statements.rb +++ b/lib/core_ext/active_record/connection_adapters/postgresql/schema_statements.rb @@ -8,7 +8,7 @@ module ActiveRecord module SchemaStatements # on postgres create lower indices to support case-insensitive where conditions - def add_index(table_name, column_name, options = {}) #:nodoc: + def add_index(table_name, column_name, options = {}) # :nodoc: index_name, index_type, index_columns, index_options, index_algorithm, index_using = add_index_options(table_name, column_name, **options) column_names = index_columns.split ', ' diff --git a/lib/search_knowledge_base_backend.rb b/lib/search_knowledge_base_backend.rb index 9efa02727..b3e179768 100644 --- a/lib/search_knowledge_base_backend.rb +++ b/lib/search_knowledge_base_backend.rb @@ -84,6 +84,7 @@ class SearchKnowledgeBaseBackend .joins(:category) .where(knowledge_base_categories: { knowledge_base_id: knowledge_bases }) + # rubocop:disable Style/RedundantSelfAssignmentBranch scope = if user&.permissions?('knowledge_base.editor') scope elsif user&.permissions?('knowledge_base.reader') && flavor == :agent @@ -91,6 +92,7 @@ class SearchKnowledgeBaseBackend else scope.published end + # rubocop:enable Style/RedundantSelfAssignmentBranch flatten_translation_ids(scope) end diff --git a/spec/models/ticket/state_spec.rb b/spec/models/ticket/state_spec.rb index 40bec0571..106527deb 100644 --- a/spec/models/ticket/state_spec.rb +++ b/spec/models/ticket/state_spec.rb @@ -16,7 +16,7 @@ RSpec.describe Ticket::State, type: :model do describe 'of whole table:' do it 'has seven records' do expect(described_class.pluck(:name)) - .to match_array(%w[closed merged new open pending\ close pending\ reminder removed]) + .to match_array(['closed', 'merged', 'new', 'open', 'pending close', 'pending reminder', 'removed']) end end