Просмотр исходного кода

Maintenance: Activated rubocop Layout/SpaceInsideParens.

Thorsten Eckel 3 лет назад
Родитель
Сommit
916bb77066

+ 0 - 5
.rubocop/default.yml

@@ -81,11 +81,6 @@ Style/RescueStandardError:
   Enabled: true
   EnforcedStyle: implicit
 
-Layout/SpaceInsideParens:
-  Description: 'No spaces after ( or before ).'
-  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
-  Enabled: false
-
 Layout/LeadingCommentSpace:
   Description: 'Comments should start with a space.'
   StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space'

+ 1 - 1
app/controllers/channels_google_controller.rb

@@ -76,7 +76,7 @@ class ChannelsGoogleController < ApplicationController
     channel.refresh_xoauth2!(force: true)
 
     result = EmailHelper::Probe.inbound(channel.options[:inbound])
-    raise Exceptions::UnprocessableEntity, ( result[:message_human] || result[:message] ) if result[:result] == 'invalid'
+    raise Exceptions::UnprocessableEntity, (result[:message_human] || result[:message]) if result[:result] == 'invalid'
 
     channel.status_in    = 'ok'
     channel.status_out   = 'ok'

+ 1 - 1
app/controllers/channels_microsoft365_controller.rb

@@ -76,7 +76,7 @@ class ChannelsMicrosoft365Controller < ApplicationController
     channel.refresh_xoauth2!(force: true)
 
     result = EmailHelper::Probe.inbound(channel.options[:inbound])
-    raise Exceptions::UnprocessableEntity, ( result[:message_human] || result[:message] ) if result[:result] == 'invalid'
+    raise Exceptions::UnprocessableEntity, (result[:message_human] || result[:message]) if result[:result] == 'invalid'
 
     channel.status_in    = 'ok'
     channel.status_out   = 'ok'

+ 1 - 1
app/controllers/user_devices_controller.rb

@@ -37,7 +37,7 @@ class UserDevicesController < ApplicationController
         next if !session.data['user_device_id']
         next if session.data['user_device_id'] != user_device.id
 
-        SessionHelper.destroy( session.id )
+        SessionHelper.destroy(session.id)
       end
       user_device.destroy
     end

+ 1 - 1
app/models/activity_stream.rb

@@ -65,7 +65,7 @@ add a new activity entry for an object
     # return if old entry is really fresh
     if result
       activity_record_delay = 90.seconds
-      return result if result.created_at.to_i >= ( data[:created_at].to_i - activity_record_delay )
+      return result if result.created_at.to_i >= (data[:created_at].to_i - activity_record_delay)
     end
 
     # create history

+ 1 - 1
app/models/application_model/can_associations.rb

@@ -146,7 +146,7 @@ returns
 
       if keys.size > 1
         values = ids.transpose.map(&:compact).map(&:uniq)
-        attributes.merge!( keys.zip( values ).to_h )
+        attributes.merge!(keys.zip(values).to_h)
       else
         attributes[ keys.first ] = ids.compact
       end

+ 1 - 1
app/models/channel/filter/follow_up_check.rb

@@ -55,7 +55,7 @@ module Channel::Filter::FollowUpCheck
     end
 
     # get ticket# from references
-    return true if ( setting.include?('references') || (mail[:'x-zammad-is-auto-response'] == true || Setting.get('ticket_hook_position') == 'none') ) && follow_up_by_md5(mail)
+    return true if (setting.include?('references') || (mail[:'x-zammad-is-auto-response'] == true || Setting.get('ticket_hook_position') == 'none')) && follow_up_by_md5(mail)
 
     # get ticket# from references current email has same subject as initial article
     if mail[:subject].present?

+ 1 - 1
app/models/concerns/has_groups.rb

@@ -320,7 +320,7 @@ module HasGroups
 
       # check direct access
       instances = joins(group_through.name)
-                  .where( group_through.table_name => { group_id: group_id, access: access }, active: true )
+                  .where(group_through.table_name => { group_id: group_id, access: access }, active: true)
 
       if method_defined?(:permissions?)
         permissions = Permission.with_parents('ticket.agent')

+ 1 - 1
app/models/knowledge_base/menu_item.rb

@@ -10,7 +10,7 @@ class KnowledgeBase::MenuItem < ApplicationModel
   acts_as_list scope: %i[kb_locale_id location], top_of_list: 0
 
   scope :sorted,       ->           { order(position: :asc) }
-  scope :using_locale, ->(locale)   { locale.present? ? joins(:kb_locale).where(knowledge_base_locales: { system_locale_id: locale.id } ) : none }
+  scope :using_locale, ->(locale)   { locale.present? ? joins(:kb_locale).where(knowledge_base_locales: { system_locale_id: locale.id }) : none }
   scope :location,     ->(location) { sorted.where(location: location) }
 
   scope :location_header, -> { location(:header) }

+ 5 - 5
app/models/link.rb

@@ -23,7 +23,7 @@ class Link < ApplicationModel
 =end
 
   def self.list(data)
-    linkobject = link_object_get( name: data[:link_object] )
+    linkobject = link_object_get(name: data[:link_object])
     return if !linkobject
 
     items = []
@@ -35,8 +35,8 @@ class Link < ApplicationModel
 
     list.each do |item|
       link = {}
-      link['link_type']         = @map[ Link::Type.find( item.link_type_id ).name ]
-      link['link_object']       = Link::Object.find( item.link_object_target_id ).name
+      link['link_type']         = @map[ Link::Type.find(item.link_type_id).name ]
+      link['link_object']       = Link::Object.find(item.link_object_target_id).name
       link['link_object_value'] = item.link_object_target_value
       items.push link
     end
@@ -47,8 +47,8 @@ class Link < ApplicationModel
     )
     list.each do |item|
       link = {}
-      link['link_type']         = Link::Type.find( item.link_type_id ).name
-      link['link_object']       = Link::Object.find( item.link_object_source_id ).name
+      link['link_type']         = Link::Type.find(item.link_type_id).name
+      link['link_object']       = Link::Object.find(item.link_object_source_id).name
       link['link_object_value'] = item.link_object_source_value
       items.push link
     end

Некоторые файлы не были показаны из-за большого количества измененных файлов