Browse Source

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

Thorsten Eckel 4 years ago
parent
commit
85573432c0

+ 4 - 4
.rubocop/default.yml

@@ -23,10 +23,10 @@ AllCops:
     - 'node_modules/**/*'
     - 'public/assets/**/*'
     - 'public/packs/**/*'
-  RSpec:
-    Patterns:
-      - '_spec.rb$'
-      - '_examples.rb$'
+RSpec:
+  Include:
+    - "**/*_spec.rb"
+    - "**/*_examples.rb"
 
 Rails:
   Enabled: true

+ 1 - 1
Gemfile

@@ -185,7 +185,7 @@ group :development, :test do
   gem 'rubocop'
   gem 'rubocop-performance'
   gem 'rubocop-rails'
-  gem 'rubocop-rspec', '2.0.0.pre' # see: https://github.com/rubocop-hq/rubocop-rspec/issues/1051
+  gem 'rubocop-rspec'
 
   # changelog generation
   gem 'github_changelog_generator'

+ 7 - 6
Gemfile.lock

@@ -357,7 +357,7 @@ GEM
       omniauth (~> 1.5)
       omniauth-oauth2 (>= 1.4.0)
     openssl (2.1.2)
-    parallel (1.20.0)
+    parallel (1.20.1)
     parser (2.7.2.0)
       ast (~> 2.4.1)
     pg (0.21.0)
@@ -452,7 +452,7 @@ GEM
       rspec-support (~> 3.9.0)
     rspec-support (3.9.3)
     rszr (0.5.2)
-    rubocop (1.3.0)
+    rubocop (1.4.1)
       parallel (~> 1.10)
       parser (>= 2.7.1.5)
       rainbow (>= 2.2.2, < 4.0)
@@ -463,15 +463,16 @@ GEM
       unicode-display_width (>= 1.4.0, < 2.0)
     rubocop-ast (1.1.1)
       parser (>= 2.7.1.5)
-    rubocop-performance (1.8.1)
-      rubocop (>= 0.87.0)
+    rubocop-performance (1.9.0)
+      rubocop (>= 0.90.0, < 2.0)
       rubocop-ast (>= 0.4.0)
     rubocop-rails (2.8.1)
       activesupport (>= 4.2.0)
       rack (>= 1.1)
       rubocop (>= 0.87.0)
-    rubocop-rspec (2.0.0.pre)
+    rubocop-rspec (2.0.0)
       rubocop (~> 1.0)
+      rubocop-ast (>= 1.1.0)
     ruby-progressbar (1.10.1)
     ruby-saml (1.10.2)
       nokogiri (>= 1.5.10)
@@ -655,7 +656,7 @@ DEPENDENCIES
   rubocop
   rubocop-performance
   rubocop-rails
-  rubocop-rspec (= 2.0.0.pre)
+  rubocop-rspec
   rubyntlm!
   sassc-rails
   selenium-webdriver

+ 1 - 1
app/jobs/issue_2715_fix_broken_twitter_urls_job.rb

@@ -7,7 +7,7 @@ class Issue2715FixBrokenTwitterUrlsJob < ApplicationJob
                    .where(ticket_article_types: { name: ['twitter status', 'twitter direct-message'] })
                    .order(created_at: :desc)
                    .limit(10_000)
-                   .find_each(&method(:fix_broken_links))
+                   .find_each { |article| fix_broken_links(article) }
   end
 
   private

+ 1 - 1
app/models/token.rb

@@ -116,7 +116,7 @@ cleanup old token
   def with_context(user:, &block)
     @effective_user = user
 
-    instance_eval(&block) if block_given?
+    instance_eval(&block) if block
   ensure
     @effective_user = nil
   end

+ 1 - 0
db/migrate/20170905140038_cti_log_preferences_migration.rb

@@ -19,6 +19,7 @@ module ActiveRecord
     end
   end
 end
+
 module ActiveRecord
   module ConnectionAdapters
     module PostgreSQL

+ 1 - 1
lib/core_ext/string.rb

@@ -95,7 +95,7 @@ class String
       end
       c
     end
-             .join('')
+             .join
   end
 
 =begin

+ 1 - 0
lib/exceptions.rb

@@ -1,6 +1,7 @@
 module Exceptions
 
   class NotAuthorized < StandardError; end
+
   class UnprocessableEntity < StandardError; end
 
 end

+ 1 - 1
lib/html_sanitizer.rb

@@ -103,7 +103,7 @@ satinize html string based on whiltelist
 
         # clean class / only use allowed classes
         if node['class']
-          classes = node['class'].gsub(/\t|\n|\r/, '').split(' ')
+          classes = node['class'].gsub(/\t|\n|\r/, '').split
           class_new = ''
           classes.each do |local_class|
             next if classes_whitelist.exclude?(local_class.to_s.strip)

+ 1 - 1
lib/import/exchange/folder.rb

@@ -33,7 +33,7 @@ module Import
       def children(*parents)
         return [] if parents.empty?
 
-        direct_descendants = parents.map(&method(:request_children))
+        direct_descendants = parents.map { |parent| request_children(parent) }
                                     .flatten.uniq.compact
 
         direct_descendants | children(*direct_descendants)

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