Browse Source

Maintenance: Update dependency rubocop to v1.56.0

renovatebot 1 year ago
parent
commit
5938a7ef19

+ 2 - 1
.rubocop/cop/zammad/exists_date_time_precision.rb

@@ -50,7 +50,8 @@ and check if there are :datetime or :timestamps column which do not have the lim
 
         def on_send(node)
           return add_offense(node) if invalid_column?(node)
-          return add_offense(node) if invalid_table?(node)
+
+          add_offense(node) if invalid_table?(node)
         end
 
         def invalid_table?(node)

+ 3 - 1
Gemfile.lock

@@ -105,6 +105,7 @@ GEM
     autoprefixer-rails (10.4.13.0)
       execjs (~> 2)
     awrence (1.2.1)
+    base64 (0.1.1)
     bindata (2.4.15)
     binding_of_caller (1.0.0)
       debug_inspector (>= 0.0.1)
@@ -486,7 +487,8 @@ GEM
       rspec-core (> 3.3)
     rspec-support (3.12.1)
     rszr (1.3.0)
-    rubocop (1.55.1)
+    rubocop (1.56.0)
+      base64 (~> 0.1.1)
       json (~> 2.3)
       language_server-protocol (>= 3.17.0)
       parallel (~> 1.10)

+ 2 - 1
app/jobs/session_timeout_job/session.rb

@@ -14,7 +14,8 @@ class SessionTimeoutJob::Session
 
   def active?
     return true if timeout < 1
-    return true if session.data['ping'] > timeout.seconds.ago
+
+    true if session.data['ping'] > timeout.seconds.ago
   end
 
   def frontend_timeout

+ 2 - 1
app/models/knowledge_base/category.rb

@@ -53,7 +53,8 @@ class KnowledgeBase::Category < ApplicationModel
 
   def self_parent?(candidate)
     return true if candidate == parent
-    return true if parent&.self_parent?(candidate)
+
+    true if parent&.self_parent?(candidate)
   end
 
   def self_with_children

+ 2 - 2
app/models/token.rb

@@ -60,7 +60,7 @@ returns
 
     return if !token
 
-    return token.user if token.check?(data)
+    token.user if token.check?(data)
   end
 
   # Check token instance validity
@@ -141,7 +141,7 @@ cleanup old token
   def self.fetch(action_name, user_id = UserInfo.current_user_id)
     token = where(action: action_name, user_id: user_id).first
 
-    return token if token&.check?
+    token if token&.check?
   end
 
   # creates or returns existing token

+ 2 - 1
lib/ldap/group.rb

@@ -132,7 +132,8 @@ class Ldap
     def group_user_dns(entry)
       return entry[:member] if entry[:member].present?
       return group_user_dns_memberuid(entry) if entry[:memberuid].present?
-      return entry[:uniquemember] if entry[:uniquemember].present?
+
+      entry[:uniquemember].presence
     end
 
     def group_user_dns_memberuid(entry)

+ 2 - 1
spec/support/capybara/form_helpers.rb

@@ -807,7 +807,8 @@ class ZammadFormFieldCapybaraElementDelegator < SimpleDelegator
     return form_context.form_gql_number(:customer) if type_customer?
     return form_context.form_gql_number(:organization) if type_organization?
     return form_context.form_gql_number(:recipient) if type_recipient?
-    return form_context.form_gql_number(:tags) if type_tags?
+
+    form_context.form_gql_number(:tags) if type_tags?
   end
 
   def triggers_form_updater?