From 57f36412b71ecc0c6bd82ec25d2ee38aec97920d Mon Sep 17 00:00:00 2001 From: tompng Date: Sat, 14 Feb 2026 22:23:28 +0900 Subject: [PATCH] rubocop --autocorrect Apply autocorrect with the latest rubocop. Old rubocop missed some "Style/MethodDefParentheses" offences that has splat or kwarg splat. --- lib/rdoc/generator/darkfish.rb | 2 +- lib/rdoc/generator/json_index.rb | 2 +- lib/rdoc/markup/document.rb | 4 ++-- lib/rdoc/markup/formatter.rb | 2 +- lib/rdoc/markup/indented_paragraph.rb | 2 +- lib/rdoc/markup/list.rb | 4 ++-- lib/rdoc/markup/list_item.rb | 4 ++-- lib/rdoc/markup/verbatim.rb | 2 +- lib/rdoc/ri/paths.rb | 2 +- lib/rdoc/servlet.rb | 2 +- test/rdoc/support/test_case.rb | 14 +++++++------- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/rdoc/generator/darkfish.rb b/lib/rdoc/generator/darkfish.rb index b31c1e4b7d..9a81b74688 100644 --- a/lib/rdoc/generator/darkfish.rb +++ b/lib/rdoc/generator/darkfish.rb @@ -173,7 +173,7 @@ def initialize(store, options) ## # Output progress information if debugging is enabled - def debug_msg *msg + def debug_msg(*msg) return unless $DEBUG_RDOC $stderr.puts(*msg) end diff --git a/lib/rdoc/generator/json_index.rb b/lib/rdoc/generator/json_index.rb index 065caa47ea..c61391d630 100644 --- a/lib/rdoc/generator/json_index.rb +++ b/lib/rdoc/generator/json_index.rb @@ -118,7 +118,7 @@ def build_index ## # Output progress information if debugging is enabled - def debug_msg *msg + def debug_msg(*msg) return unless $DEBUG_RDOC $stderr.puts(*msg) end diff --git a/lib/rdoc/markup/document.rb b/lib/rdoc/markup/document.rb index 399cfe8e3e..d713160ad8 100644 --- a/lib/rdoc/markup/document.rb +++ b/lib/rdoc/markup/document.rb @@ -26,7 +26,7 @@ class RDoc::Markup::Document ## # Creates a new Document with +parts+ - def initialize *parts + def initialize(*parts) @parts = [] @parts.concat parts @@ -148,7 +148,7 @@ def pretty_print(q) # :nodoc: ## # Appends +parts+ to the document - def push *parts + def push(*parts) self.parts.concat parts end diff --git a/lib/rdoc/markup/formatter.rb b/lib/rdoc/markup/formatter.rb index cb3b9b823e..e858aa3e74 100644 --- a/lib/rdoc/markup/formatter.rb +++ b/lib/rdoc/markup/formatter.rb @@ -252,7 +252,7 @@ def convert_string(string) # # alias accept_raw ignore - def ignore *node + def ignore(*node) end ## diff --git a/lib/rdoc/markup/indented_paragraph.rb b/lib/rdoc/markup/indented_paragraph.rb index c218501ce6..95995cf286 100644 --- a/lib/rdoc/markup/indented_paragraph.rb +++ b/lib/rdoc/markup/indented_paragraph.rb @@ -13,7 +13,7 @@ class RDoc::Markup::IndentedParagraph < RDoc::Markup::Raw # Creates a new IndentedParagraph containing +parts+ indented with +indent+ # spaces - def initialize indent, *parts + def initialize(indent, *parts) @indent = indent super(*parts) diff --git a/lib/rdoc/markup/list.rb b/lib/rdoc/markup/list.rb index 4a1066f2d6..9196904d5e 100644 --- a/lib/rdoc/markup/list.rb +++ b/lib/rdoc/markup/list.rb @@ -37,7 +37,7 @@ class RDoc::Markup::List # Creates a new list of +type+ with +items+. Valid list types are: # +:BULLET+, +:LABEL+, +:LALPHA+, +:NOTE+, +:NUMBER+, +:UALPHA+ - def initialize type = nil, *items + def initialize(type = nil, *items) @type = type @items = [] @items.concat items @@ -94,7 +94,7 @@ def pretty_print(q) # :nodoc: ## # Appends +items+ to the list - def push *items + def push(*items) @items.concat items end diff --git a/lib/rdoc/markup/list_item.rb b/lib/rdoc/markup/list_item.rb index 68193e0de5..54a52f7a5e 100644 --- a/lib/rdoc/markup/list_item.rb +++ b/lib/rdoc/markup/list_item.rb @@ -24,7 +24,7 @@ class RDoc::Markup::ListItem ## # Creates a new ListItem with an optional +label+ containing +parts+ - def initialize label = nil, *parts + def initialize(label = nil, *parts) @label = label @parts = [] @parts.concat parts @@ -92,7 +92,7 @@ def pretty_print(q) # :nodoc: ## # Adds +parts+ to the ListItem - def push *parts + def push(*parts) @parts.concat parts end diff --git a/lib/rdoc/markup/verbatim.rb b/lib/rdoc/markup/verbatim.rb index 185cd7a42c..2cf66bc093 100644 --- a/lib/rdoc/markup/verbatim.rb +++ b/lib/rdoc/markup/verbatim.rb @@ -9,7 +9,7 @@ class RDoc::Markup::Verbatim < RDoc::Markup::Raw attr_accessor :format - def initialize *parts # :nodoc: + def initialize(*parts) # :nodoc: super @format = nil diff --git a/lib/rdoc/ri/paths.rb b/lib/rdoc/ri/paths.rb index 8d33c5b7e5..266f342b0d 100644 --- a/lib/rdoc/ri/paths.rb +++ b/lib/rdoc/ri/paths.rb @@ -30,7 +30,7 @@ module RDoc::RI::Paths # :extra:: ri data directory from the command line. Yielded for each # entry in +extra_dirs+ - def self.each system = true, site = true, home = true, gems = :latest, *extra_dirs # :yields: directory, type + def self.each(system = true, site = true, home = true, gems = :latest, *extra_dirs) # :yields: directory, type return enum_for __method__, system, site, home, gems, *extra_dirs unless block_given? diff --git a/lib/rdoc/servlet.rb b/lib/rdoc/servlet.rb index fbb5bb0258..257e32cead 100644 --- a/lib/rdoc/servlet.rb +++ b/lib/rdoc/servlet.rb @@ -50,7 +50,7 @@ class RDoc::Servlet < WEBrick::HTTPServlet::AbstractServlet # Creates an instance of this servlet that shares cached data between # requests. - def self.get_instance server, *options # :nodoc: + def self.get_instance(server, *options) # :nodoc: stores = @server_stores[server] new server, stores, @cache, *options diff --git a/test/rdoc/support/test_case.rb b/test/rdoc/support/test_case.rb index cb1a3bddd9..99af043991 100644 --- a/test/rdoc/support/test_case.rb +++ b/test/rdoc/support/test_case.rb @@ -103,7 +103,7 @@ def blank_line ## # Shortcut for RDoc::Markup::BlockQuote.new with +contents+ - def block *contents + def block(*contents) @RM::BlockQuote.new(*contents) end @@ -119,7 +119,7 @@ def comment(text, top_level = @top_level, language = nil) ## # Shortcut for RDoc::Markup::Document.new with +contents+ - def doc *contents + def doc(*contents) @RM::Document.new(*contents) end @@ -140,14 +140,14 @@ def head(level, text) ## # Shortcut for RDoc::Markup::ListItem.new with +label+ and +parts+ - def item label = nil, *parts + def item(label = nil, *parts) @RM::ListItem.new label, *parts end ## # Shortcut for RDoc::Markup::List.new with +type+ and +items+ - def list type = nil, *items + def list(type = nil, *items) @RM::List.new type, *items end @@ -163,7 +163,7 @@ def mu_pp(obj) # :nodoc: ## # Shortcut for RDoc::Markup::Paragraph.new with +contents+ - def para *a + def para(*a) @RM::Paragraph.new(*a) end @@ -177,7 +177,7 @@ def rule(weight) ## # Shortcut for RDoc::Markup::Raw.new with +contents+ - def raw *contents + def raw(*contents) @RM::Raw.new(*contents) end @@ -198,7 +198,7 @@ def temp_dir ## # Shortcut for RDoc::Markup::Verbatim.new with +parts+ - def verb *parts + def verb(*parts) @RM::Verbatim.new(*parts) end