]> source.dussan.org Git - redmine.git/commitdiff
Fix RuboCop offense Lint/MissingSuper (#36919).
authorGo MAEDA <maeda@farend.jp>
Fri, 24 Mar 2023 09:34:40 +0000 (09:34 +0000)
committerGo MAEDA <maeda@farend.jp>
Fri, 24 Mar 2023 09:34:40 +0000 (09:34 +0000)
git-svn-id: https://svn.redmine.org/redmine/trunk@22147 e93f8b46-1217-0410-a6f0-8f06a7374b81

12 files changed:
app/models/query.rb
lib/redmine/diff_table.rb
lib/redmine/scm/adapters/abstract_adapter.rb
lib/redmine/scm/adapters/bazaar_adapter.rb
lib/redmine/scm/adapters/cvs_adapter.rb
lib/redmine/scm/adapters/filesystem_adapter.rb
lib/redmine/scm/adapters/git_adapter.rb
lib/redmine/scm/adapters/mercurial_adapter.rb
lib/redmine/syntax_highlighting.rb
lib/redmine/twofa/base.rb
lib/redmine/unified_diff.rb
lib/redmine/wiki_formatting/html_parser.rb

index bd670205b869de4283fa0bdac7d9385eae88483d..4a0aeb4fd6024b241e4ce7ce8cf16d14bd70b981 100644 (file)
@@ -126,10 +126,13 @@ end
 
 class QueryCustomFieldColumn < QueryColumn
   def initialize(custom_field, options={})
-    self.name = "cf_#{custom_field.id}".to_sym
-    self.sortable = custom_field.order_statement || false
-    self.totalable = options.key?(:totalable) ? !!options[:totalable] : custom_field.totalable?
-    @inline = custom_field.full_width_layout? ? false : true
+    name = "cf_#{custom_field.id}".to_sym
+    super(
+      name,
+      :sortable => custom_field.order_statement || false,
+      :totalable =>  options.key?(:totalable) ? !!options[:totalable] : custom_field.totalable?,
+      :inline => custom_field.full_width_layout? ? false : true
+    )
     @cf = custom_field
   end
 
index b783bb3d87ee749bdb08c50b43104d56edf58c8d..989e51c32d9a52454ac6bca0ca844f516fc55e84 100644 (file)
@@ -25,6 +25,7 @@ module Redmine
     # Initialize with a Diff file and the type of Diff View
     # The type view must be inline or sbs (side_by_side)
     def initialize(type="inline", style=nil)
+      super()
       @parsing = false
       @added = 0
       @removed = 0
index ebd00d55f2950ad09fc494df2582a72f108a59a5..087f62e4c1d30227cc6ecb36c8b255434120405e 100644 (file)
@@ -75,6 +75,7 @@ module Redmine
           @login = login if login && !login.empty?
           @password = (password || "") if @login
           @root_url = root_url.blank? ? retrieve_root_url : root_url
+          @path_encoding = path_encoding.presence || 'UTF-8'
         end
 
         def adapter_name
index e35f876fbf06ecd1dee7e6abcbf6ccd98530277f..048b6b59fa6177a7ff5287fb7648bb662a708636 100644 (file)
@@ -56,10 +56,7 @@ module Redmine
         end
 
         def initialize(url, root_url=nil, login=nil, password=nil, path_encoding=nil)
-          @url = url
-          @root_url = url
-          @path_encoding = 'UTF-8'
-          # do not call *super* for non ASCII repository path
+          super(url, url, nil, nil, 'UTF-8')
         end
 
         def bzr_path_encodig=(encoding)
index 9436562f746376abcd686c06fa426185002aacb7..9fdc2a307189090ba8935d14af890cb137789e2d 100644 (file)
@@ -63,16 +63,10 @@ module Redmine
         #  password -> unnecessary too
         def initialize(url, root_url=nil, login=nil, password=nil,
                        path_encoding=nil)
-          @path_encoding = path_encoding.presence || 'UTF-8'
-          @url      = url
           # TODO: better Exception here (IllegalArgumentException)
           raise CommandFailed if root_url.blank?
 
-          @root_url  = root_url
-
-          # These are unused.
-          @login    = login if login && !login.empty?
-          @password = (password || "") if @login
+          super
         end
 
         def path_encoding
index dcc3c1ae6b597c1e9a19817311bcd2892f5f2d9f..a99d0c2ffb30ed5a283e3c6c1f67029029524624 100644 (file)
@@ -35,8 +35,7 @@ module Redmine
 
         def initialize(url, root_url=nil, login=nil, password=nil,
                        path_encoding=nil)
-          @url = with_trailing_slash(url)
-          @path_encoding = path_encoding.blank? ? 'UTF-8' : path_encoding
+          super(with_trailing_slash(url), nil, nil, nil, path_encoding)
         end
 
         def path_encoding
index 489397ef2b60fa2bda9b0d28666372905a93f894..0c916c2832730cca28c92504cf68c1d66778d897 100644 (file)
@@ -62,11 +62,6 @@ module Redmine
           end
         end
 
-        def initialize(url, root_url=nil, login=nil, password=nil, path_encoding=nil)
-          super
-          @path_encoding = path_encoding.blank? ? 'UTF-8' : path_encoding
-        end
-
         def path_encoding
           @path_encoding
         end
index df7e622bc6d4f74cc50964d119316b3465824cf7..3651f1b982d00253cd0f66317b811ec5cc399ac5 100644 (file)
@@ -76,11 +76,6 @@ module Redmine
           end
         end
 
-        def initialize(url, root_url=nil, login=nil, password=nil, path_encoding=nil)
-          super
-          @path_encoding = path_encoding.blank? ? 'UTF-8' : path_encoding
-        end
-
         def path_encoding
           @path_encoding
         end
index 68578f67438c9cbf5009d68be5dbe0153ac44ee3..5b1d30f04a84c661e03d77c73182614020aee28c 100644 (file)
@@ -68,6 +68,7 @@ module Redmine
       # Syntax highlighting is completed within each line.
       class CustomHTMLLinewise < ::Rouge::Formatter
         def initialize(formatter)
+          super()
           @formatter = formatter
         end
 
index 7f2023ec3f5283fbca370421c374b947fe18293e..81f90e95af164182ca551f92af218b4a31c24375 100644 (file)
@@ -21,6 +21,7 @@ module Redmine
   module Twofa
     class Base
       def self.inherited(child)
+        super
         # require-ing a Base subclass will register it as a 2FA scheme
         Redmine::Twofa.register_scheme(scheme_name(child), child)
       end
index 4c3f3afd3a04cc31e6539a0053890fdd993aaa81..62fe3e5fc29f491fd32faa142a2966d1943e259c 100644 (file)
@@ -23,6 +23,7 @@ module Redmine
     attr_reader :diff_type, :diff_style
 
     def initialize(diff, options={})
+      super()
       options.assert_valid_keys(:type, :style, :max_lines)
       diff = diff.split("\n") if diff.is_a?(String)
       @diff_type = options[:type] || 'inline'
index b7fff8e704875a3b734ac2e40d116cd5b5b4247d..3763c95db54eb5912eb2792434d982de8957860a 100644 (file)
@@ -41,7 +41,7 @@ module Redmine
 
       class WikiTags < ::Loofah::Scrubber
         def initialize(tags_to_text)
-          @direction = :bottom_up
+          super(:direction => :bottom_up)
           @tags_to_text = tags_to_text || {}
         end