Browse Source

Maintenance: Bump rubocop from 1.20.0 to 1.21.0

Martin Gruner 3 years ago
parent
commit
3e2ad0e19c

+ 2 - 2
Gemfile.lock

@@ -397,7 +397,7 @@ GEM
       childprocess (>= 0.6.3, < 5)
       iniparse (~> 1.4)
       rexml (~> 3.2)
-    parallel (1.20.1)
+    parallel (1.21.0)
     parser (3.0.2.0)
       ast (~> 2.4.1)
     pg (0.21.0)
@@ -499,7 +499,7 @@ GEM
       rspec-support (~> 3.10)
     rspec-support (3.10.2)
     rszr (0.5.2)
-    rubocop (1.20.0)
+    rubocop (1.21.0)
       parallel (~> 1.10)
       parser (>= 3.0.0.0)
       rainbow (>= 2.2.2, < 4.0)

+ 1 - 1
app/controllers/form_controller.rb

@@ -192,7 +192,7 @@ class FormController < ApplicationController
       Rails.logger.info "Invalid token for form (invalid fingerprint found #{fingerprint_local} != #{fingerprint})!"
       raise Exceptions::NotAuthorized
     end
-    if parts[1].to_i < (Time.zone.now.to_i - 60 * 60 * 24)
+    if parts[1].to_i < (Time.zone.now.to_i - (60 * 60 * 24))
       Rails.logger.info 'Invalid token for form (token expired})!'
       raise Exceptions::NotAuthorized
     end

+ 1 - 1
app/models/knowledge_base.rb

@@ -91,7 +91,7 @@ class KnowledgeBase < ApplicationModel
   def custom_address_prefix(request)
     host        = custom_address_uri.host || request.headers.env['SERVER_NAME']
     port        = request.headers.env['SERVER_PORT']
-    port_silent = request.ssl? && port == '443' || !request.ssl? && port == '80'
+    port_silent = (request.ssl? && port == '443') || (!request.ssl? && port == '80')
     port_string = port_silent ? '' : ":#{port}"
 
     "#{custom_address_uri.scheme}://#{host}#{port_string}"

+ 1 - 1
db/migrate/20200205000001_chat_add_allow_website.rb

@@ -6,6 +6,6 @@ class ChatAddAllowWebsite < ActiveRecord::Migration[5.1]
     # return if it's a new setup
     return if !Setting.exists?(name: 'system_init_done')
 
-    add_column :chats, :whitelisted_websites, :string, limit: 5000, null: true # rubocop:disable Naming/InclusiveLanguage
+    add_column :chats, :whitelisted_websites, :string, limit: 5000, null: true
   end
 end

+ 1 - 1
db/migrate/20210712101116_inclusive_wording.rb

@@ -6,7 +6,7 @@ class InclusiveWording < ActiveRecord::Migration[6.0]
     # return if it's a new setup
     return if !Setting.exists?(name: 'system_init_done')
 
-    rename_column :chats, :whitelisted_websites, :allowed_websites # rubocop:disable Naming/InclusiveLanguage
+    rename_column :chats, :whitelisted_websites, :allowed_websites
     Chat.reset_column_information
   end
 end

+ 0 - 3
lib/core_ext/string.rb

@@ -417,7 +417,6 @@ class String
     map['otrs-en-de'] = '^.{6,10}[[:space:]].{3,10}[[:space:]]-[[:space:]].{1,250}[[:space:]](wrote|schrieb):'
 
     # Ms
-    # rubocop:disable Style/AsciiComments
     # From: Martin Edenhofer via Znuny Support [mailto:support@znuny.inc]
     # Send: Donnerstag, 2. April 2015 10:00
     # To/Cc/Bcc: xxx
@@ -432,8 +431,6 @@ class String
     # À/?/?: xxx
     # Envoyé : mercredi 29 avril 2015 17:31
     # Objet : xxx
-    # rubocop:enable Style/AsciiComments
-
     # en/de/fr | sometimes ms adds a space to "xx : value"
     map['ms-en-de-fr_from'] = '^(Von|From|De|от|Z|Od|Ze|Fra|Van|Mistä|Από|Dal|から|Из|од|iz|Från|จาก|з|Từ)( ?):[[:space:]].+?'
     map['ms-en-de-fr_from_html'] = "\n######b######(From|Von|De)([[:space:]]?):([[:space:]]?)(######\/b######)[[:space:]].+?"

+ 1 - 1
lib/import/otrs.rb

@@ -82,7 +82,7 @@ module Import
             # get the offset for the current thread and loop count
             thread_offset_base = (Thread.current[:thread_no] - 1) * limit
             thread_step        = thread_count * limit
-            offset             = Thread.current[:loop_count] * thread_step + thread_offset_base + start_offset_base
+            offset             = (Thread.current[:loop_count] * thread_step) + thread_offset_base + start_offset_base
 
             break if !imported?(
               remote_object: remote_object,

+ 0 - 2
lib/sequencer/unit/import/common/object_attribute/sanitized_name.rb

@@ -74,9 +74,7 @@ class Sequencer
               # Model Name
               # Model::Name
               # Model Name?
-              # rubocop:disable Style/AsciiComments
               # Mödel Nâmé
-              # rubocop:enable Style/AsciiComments
               raise 'Missing implementation for unsanitized_name method'
             end
           end

+ 1 - 1
lib/stats/ticket_waiting_time.rb

@@ -33,7 +33,7 @@ class Stats::TicketWaitingTime
                 percent = (handling_time.to_f - 60) / (60 * 3)
                 'good'
               elsif handling_time <= 60 * 8
-                percent = (handling_time.to_f - 60 * 4) / (60 * 4)
+                percent = (handling_time.to_f - (60 * 4)) / (60 * 4)
                 'ok'
               else
                 percent = 1.00

+ 0 - 2
lib/twitter_sync.rb

@@ -501,11 +501,9 @@ create a tweet or direct message from an article
 
       Rails.logger.debug { 'Create tweet from article...' }
 
-      # rubocop:disable Style/AsciiComments
       # workaround for https://github.com/sferik/twitter/issues/677
       # https://github.com/zammad/zammad/issues/2873 - unable to post
       # tweets with * - replace `*` with the wide-asterisk `*`.
-      # rubocop:enable Style/AsciiComments
       article[:body].tr!('*', '*') if article[:body].present?
       tweet = @client.update(
         article[:body],

Some files were not shown because too many files changed in this diff