Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow RBS/Style/InitializeReturnType #2008

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ RBS/Style:
Exclude:
- 'sig/**/*'
- 'test/**/*'
RBS/Style/InitializeReturnType:
Enabled: true

Lint/DuplicateMethods:
Enabled: true
Expand Down
2 changes: 1 addition & 1 deletion core/basic_object.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ class BasicObject
# -->
# Returns a new BasicObject.
#
def initialize: () -> nil
def initialize: () -> void

private

Expand Down
2 changes: 1 addition & 1 deletion core/dir.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class Dir
# Dir.new('.').read.encoding # => #<Encoding:UTF-8>
# Dir.new('.', encoding: 'US-ASCII').read.encoding # => #<Encoding:US-ASCII>
#
def initialize: (path dir, ?encoding: encoding?) -> self
def initialize: (path dir, ?encoding: encoding?) -> void

# <!--
# rdoc-file=dir.rb
Expand Down
2 changes: 1 addition & 1 deletion core/errors.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ class SystemCallError < StandardError
# SystemCallError object. The error number is subsequently available via the
# #errno method.
#
def initialize: (string msg, Integer errno) -> SystemCallError
def initialize: (string msg, Integer errno) -> void

# <!--
# rdoc-file=error.c
Expand Down
2 changes: 1 addition & 1 deletion core/exception.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class Exception
# -->
# Construct a new Exception object, optionally passing in a message.
#
def initialize: (?string | _ToS message) -> self
def initialize: (?string | _ToS message) -> void

# <!--
# rdoc-file=error.c
Expand Down
2 changes: 1 addition & 1 deletion core/file.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ class File < IO
# * [Open Options](rdoc-ref:IO@Open+Options).
# * [Encoding options](rdoc-ref:encodings.rdoc@Encoding+Options).
#
def initialize: (string | _ToPath | int file_name, ?string | int mode, ?int perm) -> File
def initialize: (string | _ToPath | int file_name, ?string | int mode, ?int perm) -> void

# <!--
# rdoc-file=file.c
Expand Down
2 changes: 1 addition & 1 deletion core/module.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ class Module < Object
# Assign the module to a constant (name starting uppercase) if you want to treat
# it like a regular module.
#
def initialize: () -> Object
def initialize: () -> void
| () { (Module arg0) -> untyped } -> void

# <!--
Expand Down
4 changes: 2 additions & 2 deletions core/regexp.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -1596,8 +1596,8 @@ class Regexp
# r3 = Regexp.new(r, timeout: 3.14) # => /foo/m
# r3.timeout # => 3.14
#
def initialize: (Regexp regexp, ?timeout: _ToF?) -> self
| (string pattern, ?int | string | bool | nil options, ?timeout: _ToF?) -> self
def initialize: (Regexp regexp, ?timeout: _ToF?) -> void
| (string pattern, ?int | string | bool | nil options, ?timeout: _ToF?) -> void

def initialize_copy: (self object) -> self

Expand Down
2 changes: 1 addition & 1 deletion stdlib/ipaddr/0/ipaddr.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class IPAddr
# as &, |, include? and ==, accept a string, or a packed in_addr value instead
# of an IPAddr object.
#
def initialize: (?String addr, ?untyped family) -> IPAddr
def initialize: (?String addr, ?untyped family) -> void

# <!--
# rdoc-file=lib/ipaddr.rb
Expand Down
2 changes: 1 addition & 1 deletion stdlib/net-http/0/net-http.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -2078,7 +2078,7 @@ module Net
# - new(m, reqbody, resbody, uri_or_path, initheader = nil)
# -->
#
def initialize: (String m, boolish reqbody, boolish resbody, URI::Generic | String uri_or_path, ?headers initheader) -> Net::HTTP
def initialize: (String m, boolish reqbody, boolish resbody, URI::Generic | String uri_or_path, ?headers initheader) -> void

# <!-- rdoc-file=lib/net/http/generic_request.rb -->
# Returns the string method name for the request:
Expand Down
2 changes: 1 addition & 1 deletion stdlib/psych/0/store.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Psych::Store < ::PStore
# Options passed in through `yaml_opts` will be used when converting the store
# to YAML via Hash#to_yaml().
#
def initialize: (*untyped o) -> Psych::Store
def initialize: (*untyped o) -> void

def dump: (untyped table) -> String

Expand Down
2 changes: 1 addition & 1 deletion stdlib/uri/0/ldap.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ module URI
#
# See also URI::Generic.new.
#
def initialize: (String schema, String? userinfo, String host, Integer? port, String? registry, String? path, String? opaque, String query, String? fragment) -> URI::LDAP
def initialize: (String schema, String? userinfo, String host, Integer? port, String? registry, String? path, String? opaque, String query, String? fragment) -> void

# <!--
# rdoc-file=lib/uri/ldap.rb
Expand Down