Browse Source

Maintenance: Update dependency rubocop to v1.70.0

renovatebot 1 month ago
parent
commit
a8cf760a5d

+ 1 - 1
Gemfile.lock

@@ -576,7 +576,7 @@ GEM
       rspec-core (> 3.3)
     rspec-support (3.13.2)
     rszr (1.5.0)
-    rubocop (1.69.2)
+    rubocop (1.70.0)
       json (~> 2.3)
       language_server-protocol (>= 3.17.0)
       parallel (~> 1.10)

+ 1 - 1
app/graphql/gql/queries/form_updater.rb

@@ -33,7 +33,7 @@ module Gql::Queries
     def self.authorize(_obj, ctx)
       # Per default the queries require a authenticated user.
       if !ctx[:current_arguments][:form_updater_id].requires_authentication
-        true
+        return true
       end
 
       super

+ 2 - 2
app/models/channel/driver/imap.rb

@@ -77,7 +77,7 @@ example
     setup_connection(options)
 
     keep_on_server = false
-    if options[:keep_on_server] == true || options[:keep_on_server] == 'true'
+    if [true, 'true'].include?(options[:keep_on_server])
       keep_on_server = true
     end
 
@@ -478,7 +478,7 @@ returns
     starttls       = false
     keep_on_server = false
     folder         = 'INBOX'
-    if options[:keep_on_server] == true || options[:keep_on_server] == 'true'
+    if [true, 'true'].include?(options[:keep_on_server])
       keep_on_server = true
     end
 

+ 1 - 1
app/models/channel/email_parser.rb

@@ -183,7 +183,7 @@ returns
     end
 
     # check ignore header
-    if mail[:'x-zammad-ignore'] == 'true' || mail[:'x-zammad-ignore'] == true
+    if ['true', true].include?(mail[:'x-zammad-ignore'])
       Rails.logger.info "ignored email with msgid '#{mail[:message_id]}' from '#{mail[:from]}' because of x-zammad-ignore header"
 
       return [{}, nil, nil, mail]

+ 2 - 2
app/models/transaction/notification.rb

@@ -164,7 +164,7 @@ class Transaction::Notification
     return if @item[:type] == 'update' && !article && changes.blank?
 
     # check if today already notified
-    if @item[:type] == 'reminder_reached' || @item[:type] == 'escalation' || @item[:type] == 'escalation_warning'
+    if %w[reminder_reached escalation escalation_warning].include?(@item[:type])
       identifier = user.email
       if !identifier || identifier == ''
         identifier = user.login
@@ -194,7 +194,7 @@ class Transaction::Notification
         created_by_id = 1
         OnlineNotification.remove_by_type('Ticket', ticket.id, @item[:type], user)
 
-      elsif @item[:type] == 'escalation' || @item[:type] == 'escalation_warning'
+      elsif %w[escalation escalation_warning].include?(@item[:type])
         seen = false
         created_by_id = 1
         OnlineNotification.remove_by_type('Ticket', ticket.id, 'escalation', user)

+ 1 - 1
db/migrate/20161117000002_ticket_number_generator_issue_427.rb

@@ -25,7 +25,7 @@ class TicketNumberGeneratorIssue427 < ActiveRecord::Migration[4.2]
     }
 
     # just to make sure that value is saved correctly - https://github.com/zammad/zammad/issues/413
-    if setting.state_current['value'] == true || setting.state_current['value'] == false
+    if [true, false].include?(setting.state_current['value'])
       setting.state_current['value'] = { 'checksum' => setting.state_current['value'] }
     end
     setting.save!

+ 1 - 1
lib/search_index_backend.rb

@@ -855,7 +855,7 @@ helper method for making HTTP calls and raising error if response was not succes
         result[:properties][key] = {
           type: 'integer',
         }
-      elsif value.type == :datetime || value.type == :date
+      elsif value.type == :datetime || value.type == :date # rubocop:disable Style/MultipleComparison
         result[:properties][key] = {
           type: 'date',
         }

+ 1 - 1
lib/sequencer/unit/import/freshdesk/sub_sequence/generic.rb

@@ -53,7 +53,7 @@ class Sequencer::Unit::Import::Freshdesk::SubSequence::Generic < Sequencer::Unit
   end
 
   def iteration_should_stop?
-    return true if result[:action] == :failed || result[:action] == :skipped
+    return true if %i[failed skipped].include?(result[:action])
     return true if result[:response].header['link'].blank?
 
     false

+ 1 - 1
spec/requests/error_spec.rb

@@ -16,7 +16,7 @@ RSpec.describe 'Error handling', type: :request do
       # a random error code that can be easily found in the logs by an
       # administrator. However, this makes it hard to check for the exact error
       # message. Therefore we only check for the substring in this particular case
-      if message == 'Please contact your administrator' || message == 'Mysql2::Error' || message == 'PG::ForeignKeyViolation'
+      if ['Please contact your administrator', 'Mysql2::Error', 'PG::ForeignKeyViolation'].include?(message)
         expect(json_response['error']).to include(message)
       else
         expect(json_response['error']).to eq(message)

+ 1 - 1
test/browser_test_helper.rb

@@ -2565,7 +2565,7 @@ wait untill text in selector disabppears
     await_empty_ajax_queue(params)
 
     # do not stay on tab
-    if params[:task_type] == 'closeTab' || params[:task_type] == 'closeNextInOverview'
+    if %w[closeTab closeNextInOverview].include?(params[:task_type])
       sleep 1
       return
     end