Updated rubocop(-* gems) to latest version (0.81.0).

This commit is contained in:
Thorsten Eckel 2020-04-14 10:14:14 +02:00
parent dd5ca52e18
commit 562c842c8a
6 changed files with 27 additions and 17 deletions

View file

@ -18,7 +18,9 @@ AllCops:
- 'bin/spring' - 'bin/spring'
- 'db/schema.rb' - 'db/schema.rb'
- 'vendor/**/*' - 'vendor/**/*'
- 'node_modules/**/*'
- 'public/assets/**/*' - 'public/assets/**/*'
- 'public/packs/**/*'
RSpec: RSpec:
Patterns: Patterns:
- '_spec.rb$' - '_spec.rb$'
@ -242,6 +244,15 @@ Lint/InterpolationCheck:
- "test/unit/ticket_trigger_test.rb" - "test/unit/ticket_trigger_test.rb"
- "test/unit/ticket_trigger_recursive_disabled_test.rb" - "test/unit/ticket_trigger_recursive_disabled_test.rb"
Lint/RaiseException:
Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
StyleGuide: "#raise-exception"
Enabled: true
Lint/StructNewOverride:
Description: "Disallow overriding the `Struct` built-in methods via `Struct.new`."
Enabled: true
# RSpec tests # RSpec tests
Style/NumericPredicate: Style/NumericPredicate:
Description: >- Description: >-

View file

@ -355,7 +355,7 @@ GEM
omniauth (~> 1.5) omniauth (~> 1.5)
omniauth-oauth2 (>= 1.4.0) omniauth-oauth2 (>= 1.4.0)
parallel (1.19.1) parallel (1.19.1)
parser (2.7.0.2) parser (2.7.1.0)
ast (~> 2.4.0) ast (~> 2.4.0)
pg (0.21.0) pg (0.21.0)
pluginator (1.5.0) pluginator (1.5.0)
@ -449,17 +449,18 @@ GEM
rspec-support (~> 3.8.0) rspec-support (~> 3.8.0)
rspec-support (3.8.0) rspec-support (3.8.0)
rszr (0.5.2) rszr (0.5.2)
rubocop (0.80.0) rubocop (0.81.0)
jaro_winkler (~> 1.5.1) jaro_winkler (~> 1.5.1)
parallel (~> 1.10) parallel (~> 1.10)
parser (>= 2.7.0.1) parser (>= 2.7.0.1)
rainbow (>= 2.2.2, < 4.0) rainbow (>= 2.2.2, < 4.0)
rexml rexml
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7) unicode-display_width (>= 1.4.0, < 2.0)
rubocop-performance (1.5.2) rubocop-performance (1.5.2)
rubocop (>= 0.71.0) rubocop (>= 0.71.0)
rubocop-rails (2.4.2) rubocop-rails (2.5.2)
activesupport
rack (>= 1.1) rack (>= 1.1)
rubocop (>= 0.72.0) rubocop (>= 0.72.0)
rubocop-rspec (1.38.1) rubocop-rspec (1.38.1)
@ -532,7 +533,7 @@ GEM
unf (0.1.4) unf (0.1.4)
unf_ext unf_ext
unf_ext (0.0.7.5) unf_ext (0.0.7.5)
unicode-display_width (1.6.1) unicode-display_width (1.7.0)
unicorn (5.5.0) unicorn (5.5.0)
kgio (~> 2.6) kgio (~> 2.6)
raindrops (~> 0.7) raindrops (~> 0.7)

View file

@ -517,7 +517,7 @@ process unprocessable_mails (tmp/unprocessable_mail/*.eml) again
end.to_h end.to_h
# imported_fields = mail.header.fields.map { |f| [f.name.downcase, f.to_utf8] }.to_h # imported_fields = mail.header.fields.map { |f| [f.name.downcase, f.to_utf8] }.to_h
raw_fields = mail.header.fields.map { |f| ["raw-#{f.name.downcase}", f] }.to_h raw_fields = mail.header.fields.index_by { |f| "raw-#{f.name.downcase}" }
custom_fields = {}.tap do |h| custom_fields = {}.tap do |h|
h.replace(imported_fields.slice(*RECIPIENT_FIELDS) h.replace(imported_fields.slice(*RECIPIENT_FIELDS)
.transform_values { |v| v.match?(EMAIL_REGEX) ? v : '' }) .transform_values { |v| v.match?(EMAIL_REGEX) ? v : '' })

View file

@ -207,7 +207,7 @@ class CreateBase < ActiveRecord::Migration[4.2]
t.references :user, null: false t.references :user, null: false
t.timestamps limit: 3, null: false t.timestamps limit: 3, null: false
end end
add_index :authorizations, %i[uid provider] add_index :authorizations, %i[uid provider], unique: true
add_index :authorizations, [:user_id] add_index :authorizations, [:user_id]
add_index :authorizations, [:username] add_index :authorizations, [:username]
add_foreign_key :authorizations, :users add_foreign_key :authorizations, :users

View file

@ -13,9 +13,7 @@ module Import
end end
def id_folder_map def id_folder_map
@id_folder_map ||= all.collect do |folder| @id_folder_map ||= all.index_by(&:id)
[folder.id, folder]
end.to_h
# duplicate object to avoid errors where keys get # duplicate object to avoid errors where keys get
# added via #get_folder while iterating over # added via #get_folder while iterating over

View file

@ -1,5 +1,5 @@
ENV['RAILS_ENV'] = 'test' ENV['RAILS_ENV'] = 'test'
# rubocop:disable Lint/SuppressedException, Lint/NonLocalExitFromIterator, Style/GuardClause, Lint/MissingCopEnableDirective # rubocop:disable Lint/NonLocalExitFromIterator, Style/GuardClause, Lint/MissingCopEnableDirective
require File.expand_path('../config/environment', __dir__) require File.expand_path('../config/environment', __dir__)
require 'selenium-webdriver' require 'selenium-webdriver'
require 'json' require 'json'
@ -1475,7 +1475,7 @@ set type of task (closeTab, closeNextInOverview, stayOnTab)
return true return true
end end
end end
rescue # rubocop:disable Lint/SuppressedException rescue
# try again # try again
end end
end end
@ -1537,7 +1537,7 @@ wait untill text in selector disabppears
sleep 1 sleep 1
return true return true
end end
rescue # rubocop:disable Lint/SuppressedException rescue
# try again # try again
end end
end end
@ -1700,7 +1700,7 @@ wait untill text in selector disabppears
else else
break break
end end
rescue # rubocop:disable Lint/SuppressedException rescue
# try again # try again
end end
end end
@ -2542,7 +2542,7 @@ wait untill text in selector disabppears
if text.match?(/(Discard your unsaved changes.|Verwerfen der)/) if text.match?(/(Discard your unsaved changes.|Verwerfen der)/)
found = true found = true
end end
rescue # rubocop:disable Lint/SuppressedException rescue
# try again # try again
end end
sleep 1 sleep 1
@ -2580,7 +2580,7 @@ wait untill text in selector disabppears
sleep 1 sleep 1
return true return true
end end
rescue # rubocop:disable Lint/SuppressedException rescue
# try again # try again
end end
sleep 1 sleep 1
@ -4485,7 +4485,7 @@ wait untill text in selector disabppears
puts "#{time}/#{log.level}: #{log.message}" puts "#{time}/#{log.level}: #{log.message}"
end end
end end
rescue # rubocop:disable Lint/SuppressedException rescue
# failed to get logs # failed to get logs
end end
return if !DEBUG return if !DEBUG