Merge pull request #13894 from Homebrew/dependabot/bundler/Library/Homebrew/rubocop-rails-2.16.1
build(deps): bump rubocop-rails from 2.16.0 to 2.16.1 in /Library/Homebrew
This commit is contained in:
commit
ef3b44e67a
@ -139,7 +139,7 @@ GEM
|
||||
rubocop-performance (1.15.0)
|
||||
rubocop (>= 1.7.0, < 2.0)
|
||||
rubocop-ast (>= 0.4.0)
|
||||
rubocop-rails (2.16.0)
|
||||
rubocop-rails (2.16.1)
|
||||
activesupport (>= 4.2.0)
|
||||
rack (>= 1.1)
|
||||
rubocop (>= 1.33.0, < 2.0)
|
||||
|
||||
@ -1728,8 +1728,10 @@ RuboCop::Cop::Rails::RootJoinChain::MSG = T.let(T.unsafe(nil), String)
|
||||
RuboCop::Cop::Rails::RootJoinChain::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set)
|
||||
|
||||
class RuboCop::Cop::Rails::RootPathnameMethods < ::RuboCop::Cop::Base
|
||||
include ::RuboCop::Cop::RangeHelp
|
||||
extend ::RuboCop::Cop::AutoCorrector
|
||||
|
||||
def dir_glob?(param0 = T.unsafe(nil)); end
|
||||
def on_send(node); end
|
||||
def pathname_method(param0 = T.unsafe(nil)); end
|
||||
def rails_root?(param0 = T.unsafe(nil)); end
|
||||
@ -1737,7 +1739,10 @@ class RuboCop::Cop::Rails::RootPathnameMethods < ::RuboCop::Cop::Base
|
||||
|
||||
private
|
||||
|
||||
def build_path_glob(path, method); end
|
||||
def evidence(node); end
|
||||
def include_interpolation?(arguments); end
|
||||
def join_arguments(arguments); end
|
||||
end
|
||||
|
||||
RuboCop::Cop::Rails::RootPathnameMethods::DIR_METHODS = T.let(T.unsafe(nil), Set)
|
||||
@ -88,7 +88,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-progressbar-1.11
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unicode-display_width-2.3.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-1.35.1/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.15.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rails-2.16.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rails-2.16.1/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-2.13.1/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-sorbet-0.6.11/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-3.0.0/lib"
|
||||
|
||||
@ -845,6 +845,7 @@ Rails/RootJoinChain:
|
||||
Rails/RootPathnameMethods:
|
||||
Description: 'Use `Rails.root` IO methods instead of passing it to `File`.'
|
||||
Enabled: pending
|
||||
SafeAutocorrect: false
|
||||
VersionAdded: '2.16'
|
||||
|
||||
Rails/RootPublicPath:
|
||||
@ -43,10 +43,15 @@ module RuboCop
|
||||
PATTERN
|
||||
|
||||
def on_send(node)
|
||||
child_node, method_name = *node.first_argument.children
|
||||
child_node, method_name, time_argument = *node.first_argument.children
|
||||
return if time_argument || !child_node
|
||||
return unless current_time?(child_node, method_name) || current_time_with_convert?(child_node, method_name)
|
||||
|
||||
add_offense(node) { |corrector| corrector.replace(node, 'freeze_time') }
|
||||
add_offense(node) do |corrector|
|
||||
last_argument = node.last_argument
|
||||
freeze_time_method = last_argument.block_pass_type? ? "freeze_time(#{last_argument.source})" : 'freeze_time'
|
||||
corrector.replace(node, freeze_time_method)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user