Browse Source

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

Thorsten Eckel 4 years ago
parent
commit
4a48fe3bf6

+ 2 - 0
.rubocop/todo.rspec.yml

@@ -326,6 +326,8 @@ RSpec/FilePath:
     - 'spec/db/migrate/issue_*_spec.rb'
     - 'spec/db/migrate/issue_*_spec.rb'
     - 'spec/jobs/issue_*_spec.rb'
     - 'spec/jobs/issue_*_spec.rb'
     - 'spec/lib/import/base_factory_spec.rb'
     - 'spec/lib/import/base_factory_spec.rb'
+    - 'spec/models/knowledge_base/answer/translation/search_with_attachment_spec.rb'
+    - 'spec/models/trigger/sms_spec.rb'
 
 
 RSpec/InstanceVariable:
 RSpec/InstanceVariable:
   Exclude:
   Exclude:

+ 15 - 15
Gemfile.lock

@@ -108,7 +108,7 @@ GEM
     argon2 (2.0.2)
     argon2 (2.0.2)
       ffi (~> 1.9)
       ffi (~> 1.9)
       ffi-compiler (>= 0.1)
       ffi-compiler (>= 0.1)
-    ast (2.4.1)
+    ast (2.4.2)
     autoprefixer-rails (9.5.1)
     autoprefixer-rails (9.5.1)
       execjs
       execjs
     binding_of_caller (0.8.0)
     binding_of_caller (0.8.0)
@@ -150,7 +150,7 @@ GEM
       json
       json
     composite_primary_keys (11.2.0)
     composite_primary_keys (11.2.0)
       activerecord (~> 5.2.1)
       activerecord (~> 5.2.1)
-    concurrent-ruby (1.1.7)
+    concurrent-ruby (1.1.8)
     coveralls (0.8.23)
     coveralls (0.8.23)
       json (>= 1.8, < 3)
       json (>= 1.8, < 3)
       simplecov (~> 0.16.1)
       simplecov (~> 0.16.1)
@@ -248,7 +248,7 @@ GEM
     http-form_data (2.1.1)
     http-form_data (2.1.1)
     http_parser.rb (0.6.0)
     http_parser.rb (0.6.0)
     httpclient (2.8.3)
     httpclient (2.8.3)
-    i18n (1.8.5)
+    i18n (1.8.7)
       concurrent-ruby (~> 1.0)
       concurrent-ruby (~> 1.0)
     icalendar (2.5.3)
     icalendar (2.5.3)
       ice_cube (~> 0.16)
       ice_cube (~> 0.16)
@@ -291,7 +291,7 @@ GEM
     mini_portile2 (2.5.0)
     mini_portile2 (2.5.0)
     mini_racer (0.2.9)
     mini_racer (0.2.9)
       libv8 (>= 6.9.411)
       libv8 (>= 6.9.411)
-    minitest (5.14.2)
+    minitest (5.14.3)
     msgpack (1.2.4)
     msgpack (1.2.4)
     multi_json (1.15.0)
     multi_json (1.15.0)
     multi_xml (0.6.0)
     multi_xml (0.6.0)
@@ -359,7 +359,7 @@ GEM
       omniauth-oauth2 (>= 1.4.0)
       omniauth-oauth2 (>= 1.4.0)
     openssl (2.1.2)
     openssl (2.1.2)
     parallel (1.20.1)
     parallel (1.20.1)
-    parser (2.7.2.0)
+    parser (3.0.0.0)
       ast (~> 2.4.1)
       ast (~> 2.4.1)
     pg (0.21.0)
     pg (0.21.0)
     pluginator (1.5.0)
     pluginator (1.5.0)
@@ -454,28 +454,28 @@ GEM
       rspec-support (~> 3.9.0)
       rspec-support (~> 3.9.0)
     rspec-support (3.9.3)
     rspec-support (3.9.3)
     rszr (0.5.2)
     rszr (0.5.2)
-    rubocop (1.6.1)
+    rubocop (1.9.1)
       parallel (~> 1.10)
       parallel (~> 1.10)
-      parser (>= 2.7.1.5)
+      parser (>= 3.0.0.0)
       rainbow (>= 2.2.2, < 4.0)
       rainbow (>= 2.2.2, < 4.0)
       regexp_parser (>= 1.8, < 3.0)
       regexp_parser (>= 1.8, < 3.0)
       rexml
       rexml
       rubocop-ast (>= 1.2.0, < 2.0)
       rubocop-ast (>= 1.2.0, < 2.0)
       ruby-progressbar (~> 1.7)
       ruby-progressbar (~> 1.7)
-      unicode-display_width (>= 1.4.0, < 2.0)
-    rubocop-ast (1.3.0)
+      unicode-display_width (>= 1.4.0, < 3.0)
+    rubocop-ast (1.4.1)
       parser (>= 2.7.1.5)
       parser (>= 2.7.1.5)
-    rubocop-performance (1.9.1)
+    rubocop-performance (1.9.2)
       rubocop (>= 0.90.0, < 2.0)
       rubocop (>= 0.90.0, < 2.0)
       rubocop-ast (>= 0.4.0)
       rubocop-ast (>= 0.4.0)
-    rubocop-rails (2.9.0)
+    rubocop-rails (2.9.1)
       activesupport (>= 4.2.0)
       activesupport (>= 4.2.0)
       rack (>= 1.1)
       rack (>= 1.1)
       rubocop (>= 0.90.0, < 2.0)
       rubocop (>= 0.90.0, < 2.0)
-    rubocop-rspec (2.0.1)
+    rubocop-rspec (2.1.0)
       rubocop (~> 1.0)
       rubocop (~> 1.0)
       rubocop-ast (>= 1.1.0)
       rubocop-ast (>= 1.1.0)
-    ruby-progressbar (1.10.1)
+    ruby-progressbar (1.11.0)
     ruby-saml (1.10.2)
     ruby-saml (1.10.2)
       nokogiri (>= 1.5.10)
       nokogiri (>= 1.5.10)
     ruby_dep (1.5.0)
     ruby_dep (1.5.0)
@@ -536,14 +536,14 @@ GEM
       faraday (~> 0.9)
       faraday (~> 0.9)
       jwt (>= 1.5, <= 2.5)
       jwt (>= 1.5, <= 2.5)
       nokogiri (>= 1.6, < 2.0)
       nokogiri (>= 1.6, < 2.0)
-    tzinfo (1.2.8)
+    tzinfo (1.2.9)
       thread_safe (~> 0.1)
       thread_safe (~> 0.1)
     uglifier (4.1.20)
     uglifier (4.1.20)
       execjs (>= 0.3.0, < 3)
       execjs (>= 0.3.0, < 3)
     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.7.0)
+    unicode-display_width (2.0.0)
     unicorn (5.5.0)
     unicorn (5.5.0)
       kgio (~> 2.6)
       kgio (~> 2.6)
       raindrops (~> 0.7)
       raindrops (~> 0.7)

+ 4 - 4
app/models/ticket/search.rb

@@ -156,11 +156,11 @@ returns
         return [] if query_or.blank?
         return [] if query_or.blank?
 
 
         query_extension = {
         query_extension = {
-          'bool': {
-            'must': [
+          bool: {
+            must: [
               {
               {
-                'bool': {
-                  'should': query_or,
+                bool: {
+                  should: query_or,
                 },
                 },
               },
               },
             ],
             ],

+ 2 - 2
db/migrate/20170421000001_pretty_date_options_added.rb

@@ -17,8 +17,8 @@ class PrettyDateOptionsAdded < ActiveRecord::Migration[4.2]
             name:    'pretty_date_format',
             name:    'pretty_date_format',
             tag:     'select',
             tag:     'select',
             options: {
             options: {
-              'relative': 'relative - e. g. "2 hours ago" or "2 days and 15 minutes ago"',
-              'absolute': 'absolute - e. g. "Monday 09:30" or "Tuesday 23. Feb 14:20"',
+              relative: 'relative - e. g. "2 hours ago" or "2 days and 15 minutes ago"',
+              absolute: 'absolute - e. g. "Monday 09:30" or "Tuesday 23. Feb 14:20"',
             },
             },
           },
           },
         ],
         ],

+ 3 - 3
db/seeds/settings.rb

@@ -209,9 +209,9 @@ Setting.create_or_update(
         name:    'pretty_date_format',
         name:    'pretty_date_format',
         tag:     'select',
         tag:     'select',
         options: {
         options: {
-          'relative':  'relative - e. g. "2 hours ago" or "2 days and 15 minutes ago"',
-          'absolute':  'absolute - e. g. "Monday 09:30" or "Tuesday 23. Feb 14:20"',
-          'timestamp': 'timestamp - e. g. "2018-08-30 14:30"',
+          relative:  'relative - e. g. "2 hours ago" or "2 days and 15 minutes ago"',
+          absolute:  'absolute - e. g. "Monday 09:30" or "Tuesday 23. Feb 14:20"',
+          timestamp: 'timestamp - e. g. "2018-08-30 14:30"',
         },
         },
       },
       },
     ],
     ],

+ 2 - 2
lib/search_index_backend.rb

@@ -959,8 +959,8 @@ helper method for making HTTP calls and raising error if response was not succes
 
 
     # for elasticsearch 6.x and later
     # for elasticsearch 6.x and later
     string_type = 'text'
     string_type = 'text'
-    string_raw  = { 'type': 'keyword', 'ignore_above': 5012 }
-    boolean_raw = { 'type': 'boolean' }
+    string_raw  = { type: 'keyword', ignore_above: 5012 }
+    boolean_raw = { type: 'boolean' }
 
 
     object.columns_hash.each do |key, value|
     object.columns_hash.each do |key, value|
       if value.type == :string && value.limit && value.limit <= 5000 && store_columns.exclude?(key)
       if value.type == :string && value.limit && value.limit <= 5000 && store_columns.exclude?(key)

+ 1 - 1
spec/lib/core_ext/active_record/calculations/pluck_as_hash_spec.rb

@@ -2,7 +2,7 @@
 
 
 require 'rails_helper'
 require 'rails_helper'
 
 
-RSpec.describe ActiveRecord::Calculations do
+RSpec.describe ActiveRecord::Calculations do # rubocop:disable RSpec/FilePath
   describe '#pluck_as_hash' do
   describe '#pluck_as_hash' do
     let(:ticket) { create(:ticket) }
     let(:ticket) { create(:ticket) }
 
 

+ 13 - 13
spec/lib/external_credential/google_spec.rb

@@ -170,8 +170,8 @@ RSpec.describe ExternalCredential::Google do
         let(:response_status) { 404 }
         let(:response_status) { 404 }
         let(:response_payload) do
         let(:response_payload) do
           {
           {
-            "error":             'invalid_client',
-            "error_description": 'The OAuth client was not found.'
+            error:             'invalid_client',
+            error_description: 'The OAuth client was not found.'
           }
           }
         end
         end
         let(:exception_message) { 'Request failed! ERROR: invalid_client (The OAuth client was not found.)' }
         let(:exception_message) { 'Request failed! ERROR: invalid_client (The OAuth client was not found.)' }
@@ -295,8 +295,8 @@ RSpec.describe ExternalCredential::Google do
         let(:response_status) { 400 }
         let(:response_status) { 400 }
         let(:response_payload) do
         let(:response_payload) do
           {
           {
-            "error":             'invalid_client',
-            "error_description": 'The OAuth client was not found.'
+            error:             'invalid_client',
+            error_description: 'The OAuth client was not found.'
           }
           }
         end
         end
         let(:exception_message) { /The OAuth client was not found/ }
         let(:exception_message) { /The OAuth client was not found/ }
@@ -397,16 +397,16 @@ RSpec.describe ExternalCredential::Google do
         let(:response_status) { 401 }
         let(:response_status) { 401 }
         let(:response_payload) do
         let(:response_payload) do
           {
           {
-            "error": {
-              "code":    401,
-              "message": 'Invalid Credentials',
-              "errors":  [
+            error: {
+              code:    401,
+              message: 'Invalid Credentials',
+              errors:  [
                 {
                 {
-                  "locationType": 'header',
-                  "domain":       'global',
-                  "message":      'Invalid Credentials',
-                  "reason":       'authError',
-                  "location":     'Authorization'
+                  locationType: 'header',
+                  domain:       'global',
+                  message:      'Invalid Credentials',
+                  reason:       'authError',
+                  location:     'Authorization'
                 }
                 }
               ]
               ]
             }
             }

+ 4 - 4
spec/lib/external_credential/microsoft365_spec.rb

@@ -132,8 +132,8 @@ RSpec.describe ExternalCredential::Microsoft365 do
         let(:response_status) { 404 }
         let(:response_status) { 404 }
         let(:response_payload) do
         let(:response_payload) do
           {
           {
-            "error":             'invalid_client',
-            "error_description": 'The OAuth client was not found.'
+            error:             'invalid_client',
+            error_description: 'The OAuth client was not found.'
           }
           }
         end
         end
         let(:exception_message) { 'Request failed! ERROR: invalid_client (The OAuth client was not found.)' }
         let(:exception_message) { 'Request failed! ERROR: invalid_client (The OAuth client was not found.)' }
@@ -256,8 +256,8 @@ RSpec.describe ExternalCredential::Microsoft365 do
         let(:response_status) { 400 }
         let(:response_status) { 400 }
         let(:response_payload) do
         let(:response_payload) do
           {
           {
-            "error":             'invalid_client',
-            "error_description": 'The OAuth client was not found.'
+            error:             'invalid_client',
+            error_description: 'The OAuth client was not found.'
           }
           }
         end
         end
         let(:exception_message) { /The OAuth client was not found/ }
         let(:exception_message) { /The OAuth client was not found/ }

+ 6 - 6
spec/requests/admin/knowledge_base/public_menu_spec.rb

@@ -5,9 +5,9 @@ RSpec.describe 'Admin Knowledge Base Public Menu', type: :request, authenticated
   let(:params) do
   let(:params) do
     {
     {
       menu_items_sets: [{
       menu_items_sets: [{
-        "kb_locale_id": kb_locale.id,
-        "location":     location,
-        "menu_items":   menu_items
+        kb_locale_id: kb_locale.id,
+        location:     location,
+        menu_items:   menu_items
       }]
       }]
     }
     }
   end
   end
@@ -59,9 +59,9 @@ RSpec.describe 'Admin Knowledge Base Public Menu', type: :request, authenticated
   def build_params(menu_items)
   def build_params(menu_items)
     {
     {
       menu_items_sets: [{
       menu_items_sets: [{
-        "kb_locale_id": kb_locale.id,
-        "location":     location,
-        "menu_items":   menu_items
+        kb_locale_id: kb_locale.id,
+        location:     location,
+        menu_items:   menu_items
       }]
       }]
     }
     }
   end
   end

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