Maintenance: Updated rubocop(-* gems) to latest version (1.15.0).

This commit is contained in:
Martin Gruner 2021-05-28 13:25:36 +02:00 committed by Thorsten Eckel
parent 8ca12c1685
commit 205c717f4d
7 changed files with 29 additions and 17 deletions

View file

@ -274,8 +274,18 @@ Style/StringConcatenation:
- "config/routes/**/*"
Style/RegexpLiteral:
Description: 'This cop enforces using // or %r around regular expressions.'
EnforcedStyle: percent_r
Style/RedundantBegin:
Description: 'This cop checks for redundant `begin` blocks.'
Enabled: false
Rails/EnvironmentVariableAccess:
Description: 'This cop looks for direct access to environment variables through the ENV variable within the application code.'
Enabled: true
AllowReads: true
# RSpec tests
Style/NumericPredicate:
Description: >-

View file

@ -362,7 +362,7 @@ GEM
omniauth-oauth2 (>= 1.4.0)
openssl (2.1.2)
parallel (1.20.1)
parser (3.0.0.0)
parser (3.0.1.1)
ast (~> 2.4.1)
pg (0.21.0)
pluginator (1.5.0)
@ -456,25 +456,25 @@ GEM
rspec-support (~> 3.9.0)
rspec-support (3.9.3)
rszr (0.5.2)
rubocop (1.11.0)
rubocop (1.15.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.2.0, < 2.0)
rubocop-ast (>= 1.5.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.4.1)
parser (>= 2.7.1.5)
rubocop-performance (1.10.0)
rubocop (>= 0.90.0, < 2.0)
rubocop-ast (1.6.0)
parser (>= 3.0.1.1)
rubocop-performance (1.11.3)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rails (2.9.1)
rubocop-rails (2.10.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 0.90.0, < 2.0)
rubocop-rspec (2.2.0)
rubocop (>= 1.7.0, < 2.0)
rubocop-rspec (2.3.0)
rubocop (~> 1.0)
rubocop-ast (>= 1.1.0)
ruby-progressbar (1.11.0)

View file

@ -16,7 +16,7 @@ module Ticket::Number::Base
chksum = 0
mult = 1
number.to_s.split('').map(&:to_i).each do |digit|
number.to_s.chars.map(&:to_i).each do |digit|
chksum += digit * mult
mult = (mult % 3) + 1
end

View file

@ -40,7 +40,7 @@ class Sequencer
# model__name
# model_name_
# model_name
downcased.split('').map { |char| char.match?(%r{[a-z0-9_]}) ? char : '_' }.join
downcased.chars.map { |char| char.match?(%r{[a-z0-9_]}) ? char : '_' }.join
end
def downcased

View file

@ -3,17 +3,19 @@ require 'rails_helper'
RSpec.describe Issue2019FixDoubleDomainLinksInTriggerEmails, type: :db_migration do
subject { create(:trigger, perform: { 'notification.email' => { 'body' => faulty_link, 'recipient' => 'customer', 'subject' => 'some subject' } }) }
# rubocop:disable Lint/InterpolationCheck
let(:faulty_link) do
'<a href="https://example.com/#{config.http_type}://#{config.fqdn}/#ticket/zoom/#{ticket.id}">' \
'View ticket' \
'View ticket' \
'</a>'
end
let(:fixed_link) do
'<a href="#{config.http_type}://#{config.fqdn}/#ticket/zoom/#{ticket.id}">' \
'View ticket' \
'View ticket' \
'</a>'
end
# rubocop:enable Lint/InterpolationCheck
it "removes duplicate domains from Trigger records' notification.email bodies" do
expect { migrate }.to change { subject.reload.perform['notification.email']['body'] }

View file

@ -61,7 +61,7 @@ RSpec.describe 'inserting Knowledge Base answer', type: :system, authenticated_a
def insert_kb_answer(translation, target_field)
target_field.send_keys('??')
translation.title.slice(0, 3).split('').each { |letter| target_field.send_keys(letter) }
translation.title.slice(0, 3).chars.each { |letter| target_field.send_keys(letter) }
find(:text_module, translation.id).click
end

View file

@ -786,7 +786,7 @@ class TestCase < ActiveSupport::TestCase
begin
if params[:slow]
element.send_keys('')
keys = params[:value].to_s.split('')
keys = params[:value].to_s.chars
keys.each do |key|
instance.action.send_keys(key).perform
end
@ -803,7 +803,7 @@ class TestCase < ActiveSupport::TestCase
if params[:slow]
element.send_keys('')
keys = params[:value].to_s.split('')
keys = params[:value].to_s.chars
keys.each do |key|
instance.action.send_keys(key).perform
end