Maintenance: Bump rubocop from 1.20.0 to 1.21.0

This commit is contained in:
Martin Gruner 2021-09-14 09:46:08 +02:00
parent 53d68b12ae
commit 3e2ad0e19c
11 changed files with 12 additions and 19 deletions

View file

@ -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)

View file

@ -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

View file

@ -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}"

View file

@ -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

View file

@ -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

View file

@ -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:]].+?"

View file

@ -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,

View file

@ -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

View file

@ -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

View file

@ -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],

View file

@ -2183,7 +2183,7 @@ RSpec.describe Ticket, type: :model do
Store.add(
object: 'SomeObject',
o_id: 1,
data: 'a' * (1024**2 * 2.4), # with 2.4 mb
data: 'a' * ((1024**2) * 2.4), # with 2.4 mb
filename: 'test.TXT',
created_by_id: 1,
)
@ -2258,7 +2258,7 @@ RSpec.describe Ticket, type: :model do
Store.add(
object: 'Ticket::Article',
o_id: article1.id,
data: 'a' * (1024**2 * 2.4), # with 2.4 mb
data: 'a' * ((1024**2) * 2.4), # with 2.4 mb
filename: 'some_file.pdf',
preferences: {
'Content-Type' => 'image/pdf',
@ -2268,14 +2268,14 @@ RSpec.describe Ticket, type: :model do
Store.add(
object: 'Ticket::Article',
o_id: article1.id,
data: 'a' * (1024**2 * 5.8), # with 5,8 mb
data: 'a' * ((1024**2) * 5.8), # with 5,8 mb
filename: 'some_file.txt',
preferences: {
'Content-Type' => 'text/plain',
},
created_by_id: 1,
)
create(:ticket_article, ticket: ticket, body: 'a' * (1024**2 * 1.2)) # body with 1,2 mb
create(:ticket_article, ticket: ticket, body: 'a' * ((1024**2) * 1.2)) # body with 1,2 mb
create(:ticket_article, ticket: ticket)
ticket.search_index_attribute_lookup
end