brew vendor-gems: commit updates.

This commit is contained in:
BrewTestBot 2021-05-05 05:51:28 +00:00
parent 8a256b7896
commit 9c1af985a5
No known key found for this signature in database
GPG Key ID: 82D7D104050B0F0F
134 changed files with 473 additions and 54 deletions

View File

@ -4,7 +4,7 @@ ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'
ruby_version = RbConfig::CONFIG["ruby_version"] ruby_version = RbConfig::CONFIG["ruby_version"]
path = File.expand_path('..', __FILE__) path = File.expand_path('..', __FILE__)
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/concurrent-ruby-1.1.8/lib/concurrent-ruby" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/concurrent-ruby-1.1.8/lib/concurrent-ruby"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/i18n-1.8.9/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/i18n-1.8.10/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/minitest-5.14.4/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/minitest-5.14.4/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/tzinfo-2.0.4/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/tzinfo-2.0.4/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/zeitwerk-2.4.2/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/zeitwerk-2.4.2/lib"
@ -81,7 +81,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-progressbar-1.11
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unicode-display_width-2.0.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unicode-display_width-2.0.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-1.13.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-1.13.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.11.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.11.1/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rails-2.9.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rails-2.10.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-2.3.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-2.3.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-sorbet-0.6.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-sorbet-0.6.1/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-2.5.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-2.5.0/lib"

View File

@ -49,7 +49,7 @@ module I18n
catch(:exception) do catch(:exception) do
result = super(fallback, key, fallback_options) result = super(fallback, key, fallback_options)
unless result.nil? unless result.nil?
on_fallback(locale, fallback, key, options) if locale != fallback on_fallback(locale, fallback, key, options) if locale.to_s != fallback.to_s
return result return result
end end
end end

View File

@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
module I18n module I18n
VERSION = "1.8.9" VERSION = "1.8.10"
end end

View File

@ -17,6 +17,27 @@ AllCops:
# as the default. # as the default.
TargetRailsVersion: ~ TargetRailsVersion: ~
Lint/NumberConversion:
# Add Rails' duration methods to the ignore list for `Lint/NumberConversion`
# so that calling `to_i` on one of these does not register an offense.
# See: https://github.com/rubocop/rubocop/issues/8950
IgnoredMethods:
- ago
- from_now
- second
- seconds
- minute
- minutes
- hour
- hours
- day
- days
- week
- weeks
- fortnight
- fortnights
- in_milliseconds
Rails/ActionFilter: Rails/ActionFilter:
Description: 'Enforces consistent use of action filter methods.' Description: 'Enforces consistent use of action filter methods.'
Enabled: true Enabled: true
@ -128,8 +149,9 @@ Rails/BelongsTo:
Rails/Blank: Rails/Blank:
Description: 'Enforces use of `blank?`.' Description: 'Enforces use of `blank?`.'
Enabled: true Enabled: true
SafeAutoCorrect: false
VersionAdded: '0.48' VersionAdded: '0.48'
VersionChanged: '0.67' VersionChanged: '2.10'
# Convert usages of `nil? || empty?` to `blank?` # Convert usages of `nil? || empty?` to `blank?`
NilOrEmpty: true NilOrEmpty: true
# Convert usages of `!present?` to `blank?` # Convert usages of `!present?` to `blank?`
@ -207,8 +229,9 @@ Rails/DynamicFindBy:
Description: 'Use `find_by` instead of dynamic `find_by_*`.' Description: 'Use `find_by` instead of dynamic `find_by_*`.'
StyleGuide: 'https://rails.rubystyle.guide#find_by' StyleGuide: 'https://rails.rubystyle.guide#find_by'
Enabled: true Enabled: true
Safe: false
VersionAdded: '0.44' VersionAdded: '0.44'
VersionChanged: '2.6' VersionChanged: '2.10'
# The `Whitelist` has been deprecated, Please use `AllowedMethods` instead. # The `Whitelist` has been deprecated, Please use `AllowedMethods` instead.
Whitelist: Whitelist:
- find_by_sql - find_by_sql
@ -237,6 +260,18 @@ Rails/EnvironmentComparison:
Enabled: true Enabled: true
VersionAdded: '0.52' VersionAdded: '0.52'
Rails/EnvironmentVariableAccess:
Description: 'Do not access `ENV` directly after initialization.'
Enabled: pending
VersionAdded: '2.10'
Include:
- app/**/*.rb
- lib/**/*.rb
Exclude:
- lib/**/*.rake
AllowReads: false
AllowWrites: false
Rails/Exit: Rails/Exit:
Description: >- Description: >-
Favor `fail`, `break`, `return`, etc. over `exit` in Favor `fail`, `break`, `return`, etc. over `exit` in
@ -540,7 +575,9 @@ Rails/RedundantReceiverInWithOptions:
Rails/ReflectionClassName: Rails/ReflectionClassName:
Description: 'Use a string for `class_name` option value in the definition of a reflection.' Description: 'Use a string for `class_name` option value in the definition of a reflection.'
Enabled: true Enabled: true
Safe: false
VersionAdded: '0.64' VersionAdded: '0.64'
VersionChanged: '2.10'
Rails/RefuteMethods: Rails/RefuteMethods:
Description: 'Use `assert_not` methods instead of `refute` methods.' Description: 'Use `assert_not` methods instead of `refute` methods.'
@ -583,6 +620,12 @@ Rails/RequestReferer:
- referer - referer
- referrer - referrer
Rails/RequireDependency:
Description: 'Do not use `require_dependency` when running in Zeitwerk mode. `require_dependency` is for autoloading in classic mode.'
Reference: 'https://guides.rubyonrails.org/autoloading_and_reloading_constants.html'
Enabled: false
VersionAdded: '2.10'
Rails/ReversibleMigration: Rails/ReversibleMigration:
Description: 'Checks whether the change method of the migration file is reversible.' Description: 'Checks whether the change method of the migration file is reversible.'
StyleGuide: 'https://rails.rubystyle.guide#reversible-migration' StyleGuide: 'https://rails.rubystyle.guide#reversible-migration'
@ -592,6 +635,13 @@ Rails/ReversibleMigration:
Include: Include:
- db/migrate/*.rb - db/migrate/*.rb
Rails/ReversibleMigrationMethodDefinition:
Description: 'Checks whether the migration implements either a `change` method or both an `up` and a `down` method.'
Enabled: false
VersionAdded: '2.10'
include:
- db/migrate/*.rb
Rails/SafeNavigation: Rails/SafeNavigation:
Description: "Use Ruby's safe navigation operator (`&.`) instead of `try!`." Description: "Use Ruby's safe navigation operator (`&.`) instead of `try!`."
Enabled: true Enabled: true
@ -687,13 +737,24 @@ Rails/TimeZone:
Enabled: true Enabled: true
Safe: false Safe: false
VersionAdded: '0.30' VersionAdded: '0.30'
VersionChanged: '0.68' VersionChanged: '2.10'
# The value `strict` means that `Time` should be used with `zone`. # The value `strict` means that `Time` should be used with `zone`.
# The value `flexible` allows usage of `in_time_zone` instead of `zone`. # The value `flexible` allows usage of `in_time_zone` instead of `zone`.
EnforcedStyle: flexible EnforcedStyle: flexible
SupportedStyles: SupportedStyles:
- strict - strict
- flexible - flexible
Exclude:
- '**/*.gemspec'
Rails/TimeZoneAssignment:
Description: 'Prefer the usage of `Time.use_zone` instead of manually updating `Time.zone` value.'
Reference: 'https://thoughtbot.com/blog/its-about-time-zones'
Enabled: 'pending'
VersionAdded: '2.10'
Include:
- spec/**/*.rb
- test/**/*.rb
Rails/UniqBeforePluck: Rails/UniqBeforePluck:
Description: 'Prefer the use of uniq or distinct before pluck.' Description: 'Prefer the use of uniq or distinct before pluck.'
@ -735,17 +796,20 @@ Rails/WhereEquals:
Description: 'Pass conditions to `where` as a hash instead of manually constructing SQL.' Description: 'Pass conditions to `where` as a hash instead of manually constructing SQL.'
StyleGuide: 'https://rails.rubystyle.guide/#hash-conditions' StyleGuide: 'https://rails.rubystyle.guide/#hash-conditions'
Enabled: 'pending' Enabled: 'pending'
SafeAutoCorrect: false
VersionAdded: '2.9' VersionAdded: '2.9'
VersionChanged: '2.10'
Rails/WhereExists: Rails/WhereExists:
Description: 'Prefer `exists?(...)` over `where(...).exists?`.' Description: 'Prefer `exists?(...)` over `where(...).exists?`.'
Enabled: 'pending' Enabled: 'pending'
SafeAutoCorrect: false
EnforcedStyle: exists EnforcedStyle: exists
SupportedStyles: SupportedStyles:
- exists - exists
- where - where
VersionAdded: '2.7' VersionAdded: '2.7'
VersionChanged: '2.8' VersionChanged: '2.10'
Rails/WhereNot: Rails/WhereNot:
Description: 'Use `where.not(...)` instead of manually constructing negated SQL in `where`.' Description: 'Use `where.not(...)` instead of manually constructing negated SQL in `where`.'

View File

@ -0,0 +1,7 @@
#
# Configuration for obsoletion.
#
# See: https://docs.rubocop.org/rubocop/extensions.html#config-obsoletions
#
extracted:
Rails/*: ~

View File

@ -8,6 +8,13 @@ module RuboCop
WHERE_METHODS = %i[where rewhere].freeze WHERE_METHODS = %i[where rewhere].freeze
def_node_matcher :active_record?, <<~PATTERN
{
(const nil? :ApplicationRecord)
(const (const nil? :ActiveRecord) :Base)
}
PATTERN
def_node_search :find_set_table_name, <<~PATTERN def_node_search :find_set_table_name, <<~PATTERN
(send self :table_name= {str sym}) (send self :table_name= {str sym})
PATTERN PATTERN
@ -16,6 +23,10 @@ module RuboCop
(send nil? :belongs_to {str sym} ...) (send nil? :belongs_to {str sym} ...)
PATTERN PATTERN
def inherit_active_record_base?(node)
node.each_ancestor(:class).any? { |class_node| active_record?(class_node.parent_class) }
end
def external_dependency_checksum def external_dependency_checksum
return @external_dependency_checksum if defined?(@external_dependency_checksum) return @external_dependency_checksum if defined?(@external_dependency_checksum)

View File

@ -75,7 +75,7 @@ module RuboCop
def on_send(node) def on_send(node)
default_attribute(node) do |attribute| default_attribute(node) do |attribute|
value = attribute.children.last value = attribute.children.last
return unless TYPE_OFFENDERS.any? { |type| value.type == type } return unless TYPE_OFFENDERS.any?(value.type)
add_offense(value) do |corrector| add_offense(value) do |corrector|
expression = default_attribute(node).children.last expression = default_attribute(node).children.last

View File

@ -68,7 +68,7 @@ module RuboCop
RESTRICT_ON_SEND = %i[belongs_to].freeze RESTRICT_ON_SEND = %i[belongs_to].freeze
def_node_matcher :match_belongs_to_with_options, <<~PATTERN def_node_matcher :match_belongs_to_with_options, <<~PATTERN
(send _ :belongs_to _ (send _ :belongs_to ...
(hash <$(pair (sym :required) ${true false}) ...>) (hash <$(pair (sym :required) ${true false}) ...>)
) )
PATTERN PATTERN

View File

@ -6,6 +6,10 @@ module RuboCop
# This cop checks for code that can be written with simpler conditionals # This cop checks for code that can be written with simpler conditionals
# using `Object#blank?` defined by Active Support. # using `Object#blank?` defined by Active Support.
# #
# This cop is marked as unsafe auto-correction, because `' '.empty?` returns false,
# but `' '.blank?` returns true. Therefore, auto-correction is not compatible
# if the receiver is a non-empty blank string, tab, or newline meta characters.
#
# Interaction with `Style/UnlessElse`: # Interaction with `Style/UnlessElse`:
# The configuration of `NotPresent` will not produce an offense in the # The configuration of `NotPresent` will not produce an offense in the
# context of `unless else` if `Style/UnlessElse` is inabled. This is # context of `unless else` if `Style/UnlessElse` is inabled. This is

View File

@ -28,19 +28,34 @@ module RuboCop
MSG = 'Use `tag` instead of `content_tag`.' MSG = 'Use `tag` instead of `content_tag`.'
RESTRICT_ON_SEND = %i[content_tag].freeze RESTRICT_ON_SEND = %i[content_tag].freeze
def on_new_investigation
@corrected_nodes = nil
end
def on_send(node) def on_send(node)
first_argument = node.first_argument first_argument = node.first_argument
return unless first_argument return if !first_argument ||
allowed_argument?(first_argument) ||
return if first_argument.variable? || first_argument.send_type? || first_argument.const_type? corrected_ancestor?(node)
add_offense(node) do |corrector| add_offense(node) do |corrector|
autocorrect(corrector, node) autocorrect(corrector, node)
@corrected_nodes ||= Set.new.compare_by_identity
@corrected_nodes.add(node)
end end
end end
private private
def corrected_ancestor?(node)
node.each_ancestor(:send).any? { |ancestor| @corrected_nodes&.include?(ancestor) }
end
def allowed_argument?(argument)
argument.variable? || argument.send_type? || argument.const_type? || argument.splat_type?
end
def autocorrect(corrector, node) def autocorrect(corrector, node)
if method_name?(node.first_argument) if method_name?(node.first_argument)
range = correction_range(node) range = correction_range(node)

View File

@ -32,13 +32,14 @@ module RuboCop
# # good # # good
# Gem::Specification.find_by_name('backend').gem_dir # Gem::Specification.find_by_name('backend').gem_dir
class DynamicFindBy < Base class DynamicFindBy < Base
include ActiveRecordHelper
extend AutoCorrector extend AutoCorrector
MSG = 'Use `%<static_name>s` instead of dynamic `%<method>s`.' MSG = 'Use `%<static_name>s` instead of dynamic `%<method>s`.'
METHOD_PATTERN = /^find_by_(.+?)(!)?$/.freeze METHOD_PATTERN = /^find_by_(.+?)(!)?$/.freeze
def on_send(node) def on_send(node)
return if allowed_invocation?(node) return if node.receiver.nil? && !inherit_active_record_base?(node) || allowed_invocation?(node)
method_name = node.method_name method_name = node.method_name
static_name = static_method_name(method_name) static_name = static_method_name(method_name)

View File

@ -0,0 +1,67 @@
# frozen_string_literal: true
module RuboCop
module Cop
module Rails
# This cop looks for direct access to environment variables through the
# `ENV` variable within the application code. This can lead to runtime
# errors due to misconfiguration that could have been discovered at boot
# time if the environment variables were loaded as part of initialization
# and copied into the application's configuration or secrets. The cop can
# be configured to allow either reads or writes if required.
#
# @example
# # good
# Rails.application.config.foo
# Rails.application.config.x.foo.bar
# Rails.application.secrets.foo
# Rails.application.config.foo = "bar"
#
# @example AllowReads: false (default)
# # bad
# ENV["FOO"]
# ENV.fetch("FOO")
#
# @example AllowReads: true
# # good
# ENV["FOO"]
# ENV.fetch("FOO")
#
# @example AllowWrites: false (default)
# # bad
# ENV["FOO"] = "bar"
#
# @example AllowWrites: true
# # good
# ENV["FOO"] = "bar"
class EnvironmentVariableAccess < Base
READ_MSG = 'Do not read from `ENV` directly post initialization.'
WRITE_MSG = 'Do not write to `ENV` directly post initialization.'
def on_const(node)
add_offense(node, message: READ_MSG) if env_read?(node) && !allow_reads?
add_offense(node, message: WRITE_MSG) if env_write?(node) && !allow_writes?
end
def_node_search :env_read?, <<~PATTERN
^(send (const {cbase nil?} :ENV) !:[]= ...)
PATTERN
def_node_search :env_write?, <<~PATTERN
{^(indexasgn (const {cbase nil?} :ENV) ...)
^(send (const {cbase nil?} :ENV) :[]= ...)}
PATTERN
private
def allow_reads?
cop_config['AllowReads'] == true
end
def allow_writes?
cop_config['AllowWrites'] == true
end
end
end
end
end

View File

@ -29,10 +29,8 @@ module RuboCop
include ConfigurableEnforcedStyle include ConfigurableEnforcedStyle
include RangeHelp include RangeHelp
MSG_SLASHES = 'Please use `Rails.root.join(\'path/to\')` ' \ MSG_SLASHES = 'Prefer `Rails.root.join(\'path/to\')`.'
'instead.' MSG_ARGUMENTS = 'Prefer `Rails.root.join(\'path\', \'to\')`.'
MSG_ARGUMENTS = 'Please use `Rails.root.join(\'path\', \'to\')` ' \
'instead.'
RESTRICT_ON_SEND = %i[join].freeze RESTRICT_ON_SEND = %i[join].freeze
def_node_matcher :file_join_nodes?, <<~PATTERN def_node_matcher :file_join_nodes?, <<~PATTERN

View File

@ -17,6 +17,7 @@ module RuboCop
# # good # # good
# User.order(:foo).each # User.order(:foo).each
class FindEach < Base class FindEach < Base
include ActiveRecordHelper
extend AutoCorrector extend AutoCorrector
MSG = 'Use `find_each` instead of `each`.' MSG = 'Use `find_each` instead of `each`.'
@ -30,6 +31,7 @@ module RuboCop
def on_send(node) def on_send(node)
return unless node.receiver&.send_type? return unless node.receiver&.send_type?
return unless SCOPE_METHODS.include?(node.receiver.method_name) return unless SCOPE_METHODS.include?(node.receiver.method_name)
return if node.receiver.receiver.nil? && !inherit_active_record_base?(node)
return if ignored?(node) return if ignored?(node)
range = node.loc.selector range = node.loc.selector

View File

@ -5,7 +5,9 @@ module RuboCop
module Rails module Rails
# This cop looks for `has_many` or `has_one` associations that don't # This cop looks for `has_many` or `has_one` associations that don't
# specify a `:dependent` option. # specify a `:dependent` option.
# It doesn't register an offense if `:through` option was specified. #
# It doesn't register an offense if `:through` or `dependent: nil`
# is specified, or if the model is read-only.
# #
# @example # @example
# # bad # # bad
@ -18,8 +20,18 @@ module RuboCop
# class User < ActiveRecord::Base # class User < ActiveRecord::Base
# has_many :comments, dependent: :restrict_with_exception # has_many :comments, dependent: :restrict_with_exception
# has_one :avatar, dependent: :destroy # has_one :avatar, dependent: :destroy
# has_many :articles, dependent: nil
# has_many :patients, through: :appointments # has_many :patients, through: :appointments
# end # end
#
# class User < ActiveRecord::Base
# has_many :comments
# has_one :avatar
#
# def readonly?
# true
# end
# end
class HasManyOrHasOneDependent < Base class HasManyOrHasOneDependent < Base
MSG = 'Specify a `:dependent` option.' MSG = 'Specify a `:dependent` option.'
RESTRICT_ON_SEND = %i[has_many has_one].freeze RESTRICT_ON_SEND = %i[has_many has_one].freeze
@ -37,7 +49,7 @@ module RuboCop
PATTERN PATTERN
def_node_matcher :dependent_option?, <<~PATTERN def_node_matcher :dependent_option?, <<~PATTERN
(pair (sym :dependent) !nil) (pair (sym :dependent) {!nil (nil)})
PATTERN PATTERN
def_node_matcher :present_option?, <<~PATTERN def_node_matcher :present_option?, <<~PATTERN
@ -51,8 +63,20 @@ module RuboCop
(args) ...) (args) ...)
PATTERN PATTERN
def_node_matcher :association_extension_block?, <<~PATTERN
(block
(send nil? :has_many _)
(args) ...)
PATTERN
def_node_matcher :readonly?, <<~PATTERN
(def :readonly?
(args)
(true))
PATTERN
def on_send(node) def on_send(node)
return if active_resource?(node.parent) return if active_resource?(node.parent) || readonly_model?(node)
return if !association_without_options?(node) && valid_options?(association_with_options?(node)) return if !association_without_options?(node) && valid_options?(association_with_options?(node))
return if valid_options_in_with_options_block?(node) return if valid_options_in_with_options_block?(node)
@ -61,10 +85,16 @@ module RuboCop
private private
def readonly_model?(node)
return false unless (parent = node.parent)
parent.each_descendant(:def).any? { |def_node| readonly?(def_node) }
end
def valid_options_in_with_options_block?(node) def valid_options_in_with_options_block?(node)
return true unless node.parent return true unless node.parent
n = node.parent.begin_type? ? node.parent.parent : node.parent n = node.parent.begin_type? || association_extension_block?(node.parent) ? node.parent.parent : node.parent
contain_valid_options_in_with_options_block?(n) contain_valid_options_in_with_options_block?(n)
end end

View File

@ -18,6 +18,7 @@ module RuboCop
# get :new, params: { user_id: 1 } # get :new, params: { user_id: 1 }
# get :new, **options # get :new, **options
class HttpPositionalArguments < Base class HttpPositionalArguments < Base
include RangeHelp
extend AutoCorrector extend AutoCorrector
extend TargetRailsVersion extend TargetRailsVersion
@ -44,7 +45,7 @@ module RuboCop
message = format(MSG, verb: node.method_name) message = format(MSG, verb: node.method_name)
add_offense(node.loc.selector, message: message) do |corrector| add_offense(highlight_range(node), message: message) do |corrector|
# given a pre Rails 5 method: get :new, {user_id: @user.id}, {} # given a pre Rails 5 method: get :new, {user_id: @user.id}, {}
# #
# @return lambda of auto correct procedure # @return lambda of auto correct procedure
@ -80,6 +81,12 @@ module RuboCop
node.sym_type? && node.value == :format node.sym_type? && node.value == :format
end end
def highlight_range(node)
_http_path, *data = *node.arguments
range_between(data.first.source_range.begin_pos, data.last.source_range.end_pos)
end
def convert_hash_data(data, type) def convert_hash_data(data, type)
return '' if data.hash_type? && data.empty? return '' if data.hash_type? && data.empty?

View File

@ -79,7 +79,11 @@ module RuboCop
opening_quote = offence_node.children.last.source[0] opening_quote = offence_node.children.last.source[0]
closing_quote = opening_quote == ':' ? '' : opening_quote closing_quote = opening_quote == ':' ? '' : opening_quote
new_rel_exp = ", rel: #{opening_quote}noopener#{closing_quote}" new_rel_exp = ", rel: #{opening_quote}noopener#{closing_quote}"
range = send_node.arguments.last.source_range range = if (last_argument = send_node.last_argument).hash_type?
last_argument.pairs.last.source_range
else
last_argument.source_range
end
corrector.insert_after(range, new_rel_exp) corrector.insert_after(range, new_rel_exp)
end end

Some files were not shown because too many files have changed in this diff Show More