Skip to content

Commit 226e714

Browse files
committed
Auto-fix Style/MethodDefParentheses violations
`$ bundle exec rubocop -a` after the configuration changes
1 parent 65f5d1e commit 226e714

File tree

100 files changed

+585
-585
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+585
-585
lines changed

lib/rdoc/code_object.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def force_documentation=(value)
236236
#
237237
# Set to +nil+ to clear RDoc's cached value
238238

239-
def full_name= full_name
239+
def full_name=(full_name)
240240
@full_name = full_name
241241
end
242242

@@ -316,7 +316,7 @@ def parent_name
316316
##
317317
# Records the RDoc::TopLevel (file) where this code object was defined
318318

319-
def record_location top_level
319+
def record_location(top_level)
320320
@ignored = false
321321
@suppressed = false
322322
@file = top_level
@@ -358,7 +358,7 @@ def stop_doc
358358
##
359359
# Sets the +store+ that contains this CodeObject
360360

361-
def store= store
361+
def store=(store)
362362
@store = store
363363

364364
return unless @track_visibility

lib/rdoc/code_object/any_method.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def initialize(text, name, singleton: false)
5252
##
5353
# Adds +an_alias+ as an alias for this method in +context+.
5454

55-
def add_alias an_alias, context = nil
55+
def add_alias(an_alias, context = nil)
5656
method = self.class.new an_alias.text, an_alias.new_name, singleton: singleton
5757

5858
method.record_location an_alias.file
@@ -104,7 +104,7 @@ def call_seq
104104
#
105105
# See also #param_seq
106106

107-
def call_seq= call_seq
107+
def call_seq=(call_seq)
108108
return if call_seq.nil? || call_seq.empty?
109109

110110
@call_seq = call_seq
@@ -176,7 +176,7 @@ def marshal_dump
176176
# * #full_name
177177
# * #parent_name
178178

179-
def marshal_load array
179+
def marshal_load(array)
180180
initialize_visibility
181181

182182
@dont_rename_initialize = nil
@@ -309,7 +309,7 @@ def skip_description?
309309
##
310310
# Sets the store for this method and its referenced code objects.
311311

312-
def store= store
312+
def store=(store)
313313
super
314314

315315
@file = @store.add_file @file.full_name if @file

lib/rdoc/code_object/attr.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def initialize(text, name, rw, comment, singleton: false)
3232
##
3333
# Attributes are equal when their names, singleton and rw are identical
3434

35-
def == other
35+
def ==(other)
3636
self.class == other.class and
3737
self.name == other.name and
3838
self.rw == other.rw and
@@ -118,7 +118,7 @@ def marshal_dump
118118
# * #full_name
119119
# * #parent_name
120120

121-
def marshal_load array
121+
def marshal_load(array)
122122
initialize_visibility
123123

124124
@aliases = []
@@ -145,7 +145,7 @@ def marshal_load array
145145
@parent_name ||= @full_name.split('#', 2).first
146146
end
147147

148-
def pretty_print q # :nodoc:
148+
def pretty_print(q) # :nodoc:
149149
q.group 2, "[#{self.class.name} #{full_name} #{rw} #{visibility}", "]" do
150150
unless comment.empty? then
151151
q.breakable

lib/rdoc/code_object/class_module.rb

+15-15
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class RDoc::ClassModule < RDoc::Context
4545
#--
4646
# TODO move to RDoc::NormalClass (I think)
4747

48-
def self.from_module class_type, mod
48+
def self.from_module(class_type, mod)
4949
klass = class_type.new mod.name
5050

5151
mod.comment_location.each do |comment, location|
@@ -120,7 +120,7 @@ def initialize(name, superclass = nil)
120120
# method is preferred over #comment= since it allows ri data to be updated
121121
# across multiple runs.
122122

123-
def add_comment comment, location
123+
def add_comment(comment, location)
124124
return unless document_self
125125

126126
original = comment
@@ -141,7 +141,7 @@ def add_comment comment, location
141141
self.comment = original
142142
end
143143

144-
def add_things my_things, other_things # :nodoc:
144+
def add_things(my_things, other_things) # :nodoc:
145145
other_things.each do |group, things|
146146
my_things[group].each { |thing| yield false, thing } if
147147
my_things.include? group
@@ -198,7 +198,7 @@ def clear_comment
198198
# Appends +comment+ to the current comment, but separated by a rule. Works
199199
# more like <tt>+=</tt>.
200200

201-
def comment= comment # :nodoc:
201+
def comment=(comment) # :nodoc:
202202
comment = case comment
203203
when RDoc::Comment then
204204
comment.normalize
@@ -216,7 +216,7 @@ def comment= comment # :nodoc:
216216
#
217217
# See RDoc::Store#complete
218218

219-
def complete min_visibility
219+
def complete(min_visibility)
220220
update_aliases
221221
remove_nodoc_children
222222
embed_mixins
@@ -259,7 +259,7 @@ def each_ancestor # :yields: module
259259
##
260260
# Looks for a symbol in the #ancestors. See Context#find_local_symbol.
261261

262-
def find_ancestor_local_symbol symbol
262+
def find_ancestor_local_symbol(symbol)
263263
each_ancestor do |m|
264264
res = m.find_local_symbol(symbol)
265265
return res if res
@@ -271,7 +271,7 @@ def find_ancestor_local_symbol symbol
271271
##
272272
# Finds a class or module with +name+ in this namespace or its descendants
273273

274-
def find_class_named name
274+
def find_class_named(name)
275275
return self if full_name == name
276276
return self if @name == name
277277

@@ -360,7 +360,7 @@ def marshal_dump # :nodoc:
360360
]
361361
end
362362

363-
def marshal_load array # :nodoc:
363+
def marshal_load(array) # :nodoc:
364364
initialize_visibility
365365
initialize_methods_etc
366366
@current_section = nil
@@ -450,7 +450,7 @@ def marshal_load array # :nodoc:
450450
#
451451
# The data in +class_module+ is preferred over the receiver.
452452

453-
def merge class_module
453+
def merge(class_module)
454454
@parent = class_module.parent
455455
@parent_name = class_module.parent_name
456456

@@ -535,7 +535,7 @@ def merge class_module
535535
# end
536536
# end
537537

538-
def merge_collections mine, other, other_files, &block # :nodoc:
538+
def merge_collections(mine, other, other_files, &block) # :nodoc:
539539
my_things = mine. group_by { |thing| thing.file }
540540
other_things = other.group_by { |thing| thing.file }
541541

@@ -547,7 +547,7 @@ def merge_collections mine, other, other_files, &block # :nodoc:
547547
# Merges the comments in this ClassModule with the comments in the other
548548
# ClassModule +cm+.
549549

550-
def merge_sections cm # :nodoc:
550+
def merge_sections(cm) # :nodoc:
551551
my_sections = sections.group_by { |section| section.title }
552552
other_sections = cm.sections.group_by { |section| section.title }
553553

@@ -595,15 +595,15 @@ def module?
595595
#
596596
# Used for modules and classes that are constant aliases.
597597

598-
def name= new_name
598+
def name=(new_name)
599599
@name = new_name
600600
end
601601

602602
##
603603
# Parses +comment_location+ into an RDoc::Markup::Document composed of
604604
# multiple RDoc::Markup::Documents with their file set.
605605

606-
def parse comment_location
606+
def parse(comment_location)
607607
case comment_location
608608
when String then
609609
super
@@ -675,7 +675,7 @@ def remove_nodoc_children
675675
end
676676
end
677677

678-
def remove_things my_things, other_files # :nodoc:
678+
def remove_things(my_things, other_files) # :nodoc:
679679
my_things.delete_if do |file, things|
680680
next false unless other_files.include? file
681681

@@ -705,7 +705,7 @@ def search_record
705705
##
706706
# Sets the store for this class or module and its contained code objects.
707707

708-
def store= store
708+
def store=(store)
709709
super
710710

711711
@attributes .each do |attr| attr.store = store end

lib/rdoc/code_object/constant.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def initialize(name, value, comment)
4444
##
4545
# Constants are ordered by name
4646

47-
def <=> other
47+
def <=>(other)
4848
return unless self.class === other
4949

5050
[parent_name, name] <=> [other.parent_name, other.name]
@@ -53,7 +53,7 @@ def <=> other
5353
##
5454
# Constants are equal when their #parent and #name is the same
5555

56-
def == other
56+
def ==(other)
5757
self.class == other.class and
5858
@parent == other.parent and
5959
@name == other.name
@@ -132,7 +132,7 @@ def marshal_dump
132132
# * #full_name
133133
# * #parent_name
134134

135-
def marshal_load array
135+
def marshal_load(array)
136136
initialize array[1], nil, RDoc::Comment.from_document(array[5])
137137

138138
@full_name = array[2]
@@ -154,7 +154,7 @@ def path
154154
"#{@parent.path}##{@name}"
155155
end
156156

157-
def pretty_print q # :nodoc:
157+
def pretty_print(q) # :nodoc:
158158
q.group 2, "[#{self.class.name} #{full_name}", "]" do
159159
unless comment.empty? then
160160
q.breakable
@@ -168,7 +168,7 @@ def pretty_print q # :nodoc:
168168
##
169169
# Sets the store for this class or module and its contained code objects.
170170

171-
def store= store
171+
def store=(store)
172172
super
173173

174174
@file = @store.add_file @file.full_name if @file

0 commit comments

Comments
 (0)