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

Introduce rubocop check to activesupport #759

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
22 changes: 11 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ GEM
fileutils (1.7.2)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
json (2.7.4)
json (2.9.1)
language_server-protocol (3.17.0.3)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.6.1)
logger (1.6.4)
minitest (5.25.1)
parallel (1.26.3)
parser (3.3.5.0)
parser (3.3.6.0)
ast (~> 2.4.1)
racc
racc (1.8.1)
Expand All @@ -42,20 +42,20 @@ GEM
ffi (~> 1.0)
rbs (3.6.1)
logger
regexp_parser (2.9.2)
rubocop (1.67.0)
regexp_parser (2.10.0)
rubocop (1.69.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.4, < 3.0)
rubocop-ast (>= 1.32.2, < 2.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.36.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.32.3)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.37.0)
parser (>= 3.3.1.0)
rubocop-on-rbs (1.1.0)
rubocop-on-rbs (1.3.0)
rbs (~> 3.5)
rubocop (~> 1.61)
zlib
Expand Down Expand Up @@ -84,7 +84,7 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.6.0)
zlib (3.1.1)
zlib (3.2.1)

PLATFORMS
ruby
Expand Down
8 changes: 8 additions & 0 deletions gems/activesupport/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
inherit_from: ../../.rubocop.yml

RBS/Layout:
Enabled: true
RBS/Lint:
Enabled: true
RBS/Style:
Enabled: true
74 changes: 32 additions & 42 deletions gems/activesupport/6.0/activesupport-generated.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ module ActiveSupport
def initialize: (untyped cache_path, ?untyped? options) -> untyped

# Advertise cache versioning support.
def self.supports_cache_versioning?: () -> ::TrueClass
def self.supports_cache_versioning?: () -> true

# Deletes all items from the cache. In this case it deletes all the entries in the specified
# file store directory except for .keep or .gitkeep. Be careful which directory is specified in your
Expand All @@ -245,7 +245,7 @@ module ActiveSupport

def read_entry: (untyped key, **untyped options) -> untyped

def write_entry: (untyped key, untyped entry, **untyped options) -> (::FalseClass | ::TrueClass)
def write_entry: (untyped key, untyped entry, **untyped options) -> bool

def delete_entry: (untyped key, **untyped options) -> untyped

Expand Down Expand Up @@ -295,7 +295,7 @@ module ActiveSupport
end

# Advertise cache versioning support.
def self.supports_cache_versioning?: () -> ::TrueClass
def self.supports_cache_versioning?: () -> true

ESCAPE_KEY_CHARS: untyped

Expand Down Expand Up @@ -375,7 +375,7 @@ module ActiveSupport
def initialize: (?untyped? options) -> untyped

# Advertise cache versioning support.
def self.supports_cache_versioning?: () -> ::TrueClass
def self.supports_cache_versioning?: () -> true

# Delete all data stored in a given cache store.
def clear: (?untyped? options) -> untyped
Expand Down Expand Up @@ -411,7 +411,7 @@ module ActiveSupport

def read_entry: (untyped key, **untyped options) -> untyped

def write_entry: (untyped key, untyped entry, **untyped options) -> (::FalseClass | untyped)
def write_entry: (untyped key, untyped entry, **untyped options) -> (false | untyped)

def delete_entry: (untyped key, **untyped options) -> untyped

Expand All @@ -431,7 +431,7 @@ module ActiveSupport
# ActiveSupport::Cache::Strategy::LocalCache for more details.
class NullStore < Store
# Advertise cache versioning support.
def self.supports_cache_versioning?: () -> ::TrueClass
def self.supports_cache_versioning?: () -> true

def clear: (?untyped? options) -> nil

Expand All @@ -447,9 +447,9 @@ module ActiveSupport

def read_entry: (untyped key, **untyped options) -> nil

def write_entry: (untyped key, untyped entry, **untyped options) -> ::TrueClass
def write_entry: (untyped key, untyped entry, **untyped options) -> true

def delete_entry: (untyped key, **untyped options) -> ::FalseClass
def delete_entry: (untyped key, **untyped options) -> false
end
end
end
Expand Down Expand Up @@ -488,7 +488,7 @@ module ActiveSupport
SCAN_BATCH_SIZE: ::Integer

# Advertise cache versioning support.
def self.supports_cache_versioning?: () -> ::TrueClass
def self.supports_cache_versioning?: () -> true

module LocalCacheWithRaw
private
Expand Down Expand Up @@ -667,7 +667,7 @@ module ActiveSupport

def read_multi_entries: (untyped keys, **untyped options) -> untyped

def write_entry: (untyped key, untyped value, **untyped options) -> ::TrueClass
def write_entry: (untyped key, untyped value, **untyped options) -> true

def delete_entry: (untyped key, **untyped options) -> untyped

Expand Down Expand Up @@ -792,16 +792,12 @@ module ActiveSupport
# The +key+ argument can also respond to +cache_key+ or +to_param+.
def self.expand_cache_key: (untyped key, ?untyped? namespace) -> untyped

private

def self.retrieve_cache_key: (untyped key) -> untyped

# Obtains the specified cache store class, given the name of the +store+.
# Raises an error when the store class cannot be found.
def self.retrieve_store_class: (untyped store) -> untyped

public

# An abstract cache store class. There are multiple cache store
# implementations, each having its own additional features. See the classes
# under the ActiveSupport::Cache module, e.g.
Expand Down Expand Up @@ -2170,7 +2166,7 @@ end

class Date
# Duck-types as a Date-like class. See Object#acts_like?.
def acts_like_date?: () -> ::TrueClass
def acts_like_date?: () -> true
end

class Date
Expand All @@ -2180,7 +2176,7 @@ class Date
# Date.today.blank? # => false
#
# @return [false]
def blank?: () -> ::FalseClass
def blank?: () -> false
end

class Date
Expand Down Expand Up @@ -2591,10 +2587,10 @@ end

class DateTime
# Duck-types as a Date-like class. See Object#acts_like?.
def acts_like_date?: () -> ::TrueClass
def acts_like_date?: () -> true

# Duck-types as a Time-like class. See Object#acts_like?.
def acts_like_time?: () -> ::TrueClass
def acts_like_time?: () -> true
end

class DateTime
Expand All @@ -2604,7 +2600,7 @@ class DateTime
# DateTime.now.blank? # => false
#
# @return [false]
def blank?: () -> ::FalseClass
def blank?: () -> false
end

class DateTime
Expand Down Expand Up @@ -4294,23 +4290,23 @@ class Object
#
# False for method objects;
# true otherwise.
def duplicable?: () -> ::TrueClass
def duplicable?: () -> true
end

class Method
# Methods are not duplicable:
#
# method(:puts).duplicable? # => false
# method(:puts).dup # => TypeError: allocator undefined for Method
def duplicable?: () -> ::FalseClass
def duplicable?: () -> false
end

class UnboundMethod
# Unbound methods are not duplicable:
#
# method(:puts).unbind.duplicable? # => false
# method(:puts).unbind.dup # => TypeError: allocator undefined for UnboundMethod
def duplicable?: () -> ::FalseClass
def duplicable?: () -> false
end

class Object
Expand Down Expand Up @@ -4765,7 +4761,7 @@ end

class String
# Enables more predictable duck-typing on String-like classes. See <tt>Object#acts_like?</tt>.
def acts_like_string?: () -> ::TrueClass
def acts_like_string?: () -> true
end

class String
Expand Down Expand Up @@ -5078,11 +5074,11 @@ class ERB
end

class Object
def html_safe?: () -> ::FalseClass
def html_safe?: () -> false
end

class Numeric
def html_safe?: () -> ::TrueClass
def html_safe?: () -> true
end

module ActiveSupport
Expand Down Expand Up @@ -5189,7 +5185,7 @@ end

class Time
# Duck-types as a Time-like class. See Object#acts_like?.
def acts_like_time?: () -> ::TrueClass
def acts_like_time?: () -> true
end

class Time
Expand Down Expand Up @@ -5723,8 +5719,6 @@ module ActiveSupport

def self.take_over: (enable_reloading: untyped enable_reloading) -> untyped

private

def self.setup_autoloaders: (untyped enable_reloading) -> untyped

def self.autoload_once?: (untyped autoload_path) -> untyped
Expand Down Expand Up @@ -5967,7 +5961,7 @@ module ActiveSupport
def safe_constantize: (untyped name) -> untyped

# Determine if the given constant has been automatically loaded.
def autoloaded?: (untyped desc) -> (::FalseClass | untyped)
def autoloaded?: (untyped desc) -> (false | untyped)

# Will the provided constant descriptor be unloaded?
def will_unload?: (untyped const_desc) -> untyped
Expand Down Expand Up @@ -6485,7 +6479,7 @@ module ActiveSupport
def raise_parsing_error: (?untyped? reason) -> untyped

# Checks for various semantic errors as stated in ISO 8601 standard.
def validate!: () -> ::TrueClass
def validate!: () -> true
end
end
end
Expand Down Expand Up @@ -7096,7 +7090,7 @@ module ActiveSupport
class HashWithIndifferentAccess[T, U] < Hash[T, U]
# Returns +true+ so that <tt>Array#extract_options!</tt> finds members of
# this class.
def extractable_options?: () -> ::TrueClass
def extractable_options?: () -> true

def with_indifferent_access: () -> untyped

Expand Down Expand Up @@ -7908,8 +7902,6 @@ module ActiveSupport
# end
def self.parse_error: () -> untyped

private

def self.convert_dates_from: (untyped data) -> untyped
end
end
Expand Down Expand Up @@ -9000,9 +8992,9 @@ module ActiveSupport

def publish: (untyped name, *untyped args) -> untyped

def subscribed_to?: (untyped name) -> ::TrueClass
def subscribed_to?: (untyped name) -> true

def unsubscribe!: () -> ::FalseClass
def unsubscribe!: () -> false

alias matches? ===
end
Expand Down Expand Up @@ -9910,7 +9902,7 @@ module ActiveSupport
def nested_under_indifferent_access: () -> untyped

# Returns true to make sure that this hash is extractable via <tt>Array#extract_options!</tt>
def extractable_options?: () -> ::TrueClass
def extractable_options?: () -> true
end
end

Expand Down Expand Up @@ -11154,15 +11146,15 @@ module ActiveSupport
alias tv_sec to_i

# So that +self+ <tt>acts_like?(:time)</tt>.
def acts_like_time?: () -> ::TrueClass
def acts_like_time?: () -> true

# Say we're a Time to thwart type checking.
def is_a?: (untyped klass) -> untyped

alias kind_of? is_a?

# An instance of ActiveSupport::TimeWithZone is never blank
def blank?: () -> ::FalseClass
def blank?: () -> false

def freeze: () -> untyped

Expand All @@ -11172,11 +11164,11 @@ module ActiveSupport

# respond_to_missing? is not called in some cases, such as when type conversion is
# performed with Kernel#String
def respond_to?: (untyped sym, ?bool include_priv) -> (::FalseClass | untyped)
def respond_to?: (untyped sym, ?bool include_priv) -> (false | untyped)

# Ensure proxy class responds to all methods that underlying time instance
# responds to.
def respond_to_missing?: (untyped sym, untyped include_priv) -> (::FalseClass | untyped)
def respond_to_missing?: (untyped sym, untyped include_priv) -> (false | untyped)

# Send the missing method to +time+ instance, and wrap result in a new
# TimeWithZone with the existing +time_zone+.
Expand Down Expand Up @@ -11803,7 +11795,5 @@ class Object
# # => 0.074
def self.ms: () { () -> untyped } -> untyped

public

def unescape: (untyped str, ?untyped escaped) -> untyped
end
Loading
Loading