Skip to content

Commit 6539eb4

Browse files
authored
Merge pull request #2008 from ksss/rbs-style-initialize_return_type
Allow RBS/Style/InitializeReturnType
2 parents a9ae829 + 4271b8e commit 6539eb4

File tree

12 files changed

+14
-12
lines changed

12 files changed

+14
-12
lines changed

.rubocop.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ RBS/Style:
3232
Exclude:
3333
- 'sig/**/*'
3434
- 'test/**/*'
35+
RBS/Style/InitializeReturnType:
36+
Enabled: true
3537

3638
Lint/DuplicateMethods:
3739
Enabled: true

core/basic_object.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ class BasicObject
256256
# -->
257257
# Returns a new BasicObject.
258258
#
259-
def initialize: () -> nil
259+
def initialize: () -> void
260260

261261
private
262262

core/dir.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class Dir
182182
# Dir.new('.').read.encoding # => #<Encoding:UTF-8>
183183
# Dir.new('.', encoding: 'US-ASCII').read.encoding # => #<Encoding:US-ASCII>
184184
#
185-
def initialize: (path dir, ?encoding: encoding?) -> self
185+
def initialize: (path dir, ?encoding: encoding?) -> void
186186

187187
# <!--
188188
# rdoc-file=dir.rb

core/errors.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ class SystemCallError < StandardError
597597
# SystemCallError object. The error number is subsequently available via the
598598
# #errno method.
599599
#
600-
def initialize: (string msg, Integer errno) -> SystemCallError
600+
def initialize: (string msg, Integer errno) -> void
601601

602602
# <!--
603603
# rdoc-file=error.c

core/exception.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ class Exception
250250
# -->
251251
# Construct a new Exception object, optionally passing in a message.
252252
#
253-
def initialize: (?string | _ToS message) -> self
253+
def initialize: (?string | _ToS message) -> void
254254

255255
# <!--
256256
# rdoc-file=error.c

core/file.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ class File < IO
875875
# * [Open Options](rdoc-ref:IO@Open+Options).
876876
# * [Encoding options](rdoc-ref:encodings.rdoc@Encoding+Options).
877877
#
878-
def initialize: (string | _ToPath | int file_name, ?string | int mode, ?int perm) -> File
878+
def initialize: (string | _ToPath | int file_name, ?string | int mode, ?int perm) -> void
879879

880880
# <!--
881881
# rdoc-file=file.c

core/module.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ class Module < Object
904904
# Assign the module to a constant (name starting uppercase) if you want to treat
905905
# it like a regular module.
906906
#
907-
def initialize: () -> Object
907+
def initialize: () -> void
908908
| () { (Module arg0) -> untyped } -> void
909909

910910
# <!--

core/regexp.rbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,8 +1596,8 @@ class Regexp
15961596
# r3 = Regexp.new(r, timeout: 3.14) # => /foo/m
15971597
# r3.timeout # => 3.14
15981598
#
1599-
def initialize: (Regexp regexp, ?timeout: _ToF?) -> self
1600-
| (string pattern, ?int | string | bool | nil options, ?timeout: _ToF?) -> self
1599+
def initialize: (Regexp regexp, ?timeout: _ToF?) -> void
1600+
| (string pattern, ?int | string | bool | nil options, ?timeout: _ToF?) -> void
16011601

16021602
def initialize_copy: (self object) -> self
16031603

stdlib/ipaddr/0/ipaddr.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class IPAddr
6363
# as &, |, include? and ==, accept a string, or a packed in_addr value instead
6464
# of an IPAddr object.
6565
#
66-
def initialize: (?String addr, ?untyped family) -> IPAddr
66+
def initialize: (?String addr, ?untyped family) -> void
6767

6868
# <!--
6969
# rdoc-file=lib/ipaddr.rb

stdlib/net-http/0/net-http.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2078,7 +2078,7 @@ module Net
20782078
# - new(m, reqbody, resbody, uri_or_path, initheader = nil)
20792079
# -->
20802080
#
2081-
def initialize: (String m, boolish reqbody, boolish resbody, URI::Generic | String uri_or_path, ?headers initheader) -> Net::HTTP
2081+
def initialize: (String m, boolish reqbody, boolish resbody, URI::Generic | String uri_or_path, ?headers initheader) -> void
20822082

20832083
# <!-- rdoc-file=lib/net/http/generic_request.rb -->
20842084
# Returns the string method name for the request:

0 commit comments

Comments
 (0)