diff --git a/Library/Homebrew/vendor/bundle/bundler/setup.rb b/Library/Homebrew/vendor/bundle/bundler/setup.rb index db252bec8a..a472c2526d 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -4,7 +4,7 @@ ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby' ruby_version = RbConfig::CONFIG["ruby_version"] 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/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/tzinfo-2.0.4/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/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-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-sorbet-0.6.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-2.5.0/lib" diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/base.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/base.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/base.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/base.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/cache.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/cache.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/cache.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/cache.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/cache_file.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/cache_file.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/cache_file.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/cache_file.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/cascade.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/cascade.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/cascade.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/cascade.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/chain.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/chain.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/chain.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/chain.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/fallbacks.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/fallbacks.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/fallbacks.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/fallbacks.rb index 7688c13df8..1acdbd68f8 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/fallbacks.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/fallbacks.rb @@ -49,7 +49,7 @@ module I18n catch(:exception) do result = super(fallback, key, fallback_options) 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 end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/flatten.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/flatten.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/flatten.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/flatten.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/gettext.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/gettext.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/gettext.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/gettext.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/interpolation_compiler.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/interpolation_compiler.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/interpolation_compiler.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/interpolation_compiler.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/key_value.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/key_value.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/key_value.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/key_value.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/memoize.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/memoize.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/memoize.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/memoize.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/metadata.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/metadata.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/metadata.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/metadata.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/pluralization.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/pluralization.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/pluralization.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/pluralization.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/simple.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/simple.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/simple.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/simple.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/transliterator.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/transliterator.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/backend/transliterator.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/transliterator.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/config.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/config.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/config.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/config.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/core_ext/hash.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/core_ext/hash.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/core_ext/hash.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/core_ext/hash.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/exceptions.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/exceptions.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/exceptions.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/exceptions.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/gettext.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/gettext.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/gettext.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/gettext.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/gettext/helpers.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/gettext/helpers.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/gettext/helpers.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/gettext/helpers.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/gettext/po_parser.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/gettext/po_parser.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/gettext/po_parser.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/gettext/po_parser.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/interpolate/ruby.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/interpolate/ruby.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/interpolate/ruby.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/interpolate/ruby.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/locale.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/locale.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/locale.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/locale.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/locale/fallbacks.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/locale/fallbacks.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/locale/fallbacks.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/locale/fallbacks.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/locale/tag.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/locale/tag.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/locale/tag.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/locale/tag.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/locale/tag/parents.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/locale/tag/parents.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/locale/tag/parents.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/locale/tag/parents.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/locale/tag/rfc4646.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/locale/tag/rfc4646.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/locale/tag/rfc4646.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/locale/tag/rfc4646.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/locale/tag/simple.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/locale/tag/simple.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/locale/tag/simple.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/locale/tag/simple.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/middleware.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/middleware.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/middleware.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/middleware.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/version.rb similarity index 69% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/version.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/version.rb index 77c13e585f..de6b026c1d 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.9/lib/i18n/version.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.10/lib/i18n/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module I18n - VERSION = "1.8.9" + VERSION = "1.8.10" end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/config/default.yml b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/config/default.yml similarity index 92% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/config/default.yml rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/config/default.yml index 7d2fe4fd5f..bb11205699 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/config/default.yml +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/config/default.yml @@ -17,6 +17,27 @@ AllCops: # as the default. 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: Description: 'Enforces consistent use of action filter methods.' Enabled: true @@ -128,8 +149,9 @@ Rails/BelongsTo: Rails/Blank: Description: 'Enforces use of `blank?`.' Enabled: true + SafeAutoCorrect: false VersionAdded: '0.48' - VersionChanged: '0.67' + VersionChanged: '2.10' # Convert usages of `nil? || empty?` to `blank?` NilOrEmpty: true # Convert usages of `!present?` to `blank?` @@ -207,8 +229,9 @@ Rails/DynamicFindBy: Description: 'Use `find_by` instead of dynamic `find_by_*`.' StyleGuide: 'https://rails.rubystyle.guide#find_by' Enabled: true + Safe: false VersionAdded: '0.44' - VersionChanged: '2.6' + VersionChanged: '2.10' # The `Whitelist` has been deprecated, Please use `AllowedMethods` instead. Whitelist: - find_by_sql @@ -237,6 +260,18 @@ Rails/EnvironmentComparison: Enabled: true 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: Description: >- Favor `fail`, `break`, `return`, etc. over `exit` in @@ -540,7 +575,9 @@ Rails/RedundantReceiverInWithOptions: Rails/ReflectionClassName: Description: 'Use a string for `class_name` option value in the definition of a reflection.' Enabled: true + Safe: false VersionAdded: '0.64' + VersionChanged: '2.10' Rails/RefuteMethods: Description: 'Use `assert_not` methods instead of `refute` methods.' @@ -583,6 +620,12 @@ Rails/RequestReferer: - referer - 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: Description: 'Checks whether the change method of the migration file is reversible.' StyleGuide: 'https://rails.rubystyle.guide#reversible-migration' @@ -592,6 +635,13 @@ Rails/ReversibleMigration: Include: - 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: Description: "Use Ruby's safe navigation operator (`&.`) instead of `try!`." Enabled: true @@ -687,13 +737,24 @@ Rails/TimeZone: Enabled: true Safe: false VersionAdded: '0.30' - VersionChanged: '0.68' + VersionChanged: '2.10' # The value `strict` means that `Time` should be used with `zone`. # The value `flexible` allows usage of `in_time_zone` instead of `zone`. EnforcedStyle: flexible SupportedStyles: - strict - 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: 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.' StyleGuide: 'https://rails.rubystyle.guide/#hash-conditions' Enabled: 'pending' + SafeAutoCorrect: false VersionAdded: '2.9' + VersionChanged: '2.10' Rails/WhereExists: Description: 'Prefer `exists?(...)` over `where(...).exists?`.' Enabled: 'pending' + SafeAutoCorrect: false EnforcedStyle: exists SupportedStyles: - exists - where VersionAdded: '2.7' - VersionChanged: '2.8' + VersionChanged: '2.10' Rails/WhereNot: Description: 'Use `where.not(...)` instead of manually constructing negated SQL in `where`.' diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/config/obsoletion.yml b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/config/obsoletion.yml new file mode 100644 index 0000000000..9cfb451ff7 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/config/obsoletion.yml @@ -0,0 +1,7 @@ +# +# Configuration for obsoletion. +# +# See: https://docs.rubocop.org/rubocop/extensions.html#config-obsoletions +# +extracted: + Rails/*: ~ diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop-rails.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop-rails.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop-rails.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop-rails.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/mixin/active_record_helper.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/mixin/active_record_helper.rb similarity index 89% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/mixin/active_record_helper.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/mixin/active_record_helper.rb index 0d263842f3..aaa9467856 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/mixin/active_record_helper.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/mixin/active_record_helper.rb @@ -8,6 +8,13 @@ module RuboCop 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 (send self :table_name= {str sym}) PATTERN @@ -16,6 +23,10 @@ module RuboCop (send nil? :belongs_to {str sym} ...) 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 return @external_dependency_checksum if defined?(@external_dependency_checksum) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/mixin/enforce_superclass.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/mixin/enforce_superclass.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/mixin/enforce_superclass.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/mixin/enforce_superclass.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/mixin/index_method.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/mixin/index_method.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/mixin/index_method.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/mixin/index_method.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/mixin/target_rails_version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/mixin/target_rails_version.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/mixin/target_rails_version.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/mixin/target_rails_version.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/action_filter.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/action_filter.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/action_filter.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/action_filter.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/active_record_aliases.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/active_record_aliases.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/active_record_aliases.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/active_record_aliases.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/active_record_callbacks_order.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/active_record_callbacks_order.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/active_record_callbacks_order.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/active_record_callbacks_order.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/active_record_override.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/active_record_override.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/active_record_override.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/active_record_override.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/active_support_aliases.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/active_support_aliases.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/active_support_aliases.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/active_support_aliases.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/after_commit_override.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/after_commit_override.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/after_commit_override.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/after_commit_override.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/application_controller.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/application_controller.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/application_controller.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/application_controller.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/application_job.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/application_job.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/application_job.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/application_job.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/application_mailer.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/application_mailer.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/application_mailer.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/application_mailer.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/application_record.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/application_record.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/application_record.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/application_record.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/arel_star.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/arel_star.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/arel_star.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/arel_star.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/assert_not.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/assert_not.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/assert_not.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/assert_not.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/attribute_default_block_value.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/attribute_default_block_value.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/attribute_default_block_value.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/attribute_default_block_value.rb index 617af042bb..2651f981b8 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/attribute_default_block_value.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/attribute_default_block_value.rb @@ -75,7 +75,7 @@ module RuboCop def on_send(node) default_attribute(node) do |attribute| 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| expression = default_attribute(node).children.last diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/belongs_to.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/belongs_to.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/belongs_to.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/belongs_to.rb index 807214074c..e6cb7ac06e 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/belongs_to.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/belongs_to.rb @@ -68,7 +68,7 @@ module RuboCop RESTRICT_ON_SEND = %i[belongs_to].freeze def_node_matcher :match_belongs_to_with_options, <<~PATTERN - (send _ :belongs_to _ + (send _ :belongs_to ... (hash <$(pair (sym :required) ${true false}) ...>) ) PATTERN diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/blank.rb similarity index 94% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/blank.rb index 8b530abb6d..40ba2a615c 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/blank.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/blank.rb @@ -6,6 +6,10 @@ module RuboCop # This cop checks for code that can be written with simpler conditionals # 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`: # The configuration of `NotPresent` will not produce an offense in the # context of `unless else` if `Style/UnlessElse` is inabled. This is diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/bulk_change_table.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/bulk_change_table.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/bulk_change_table.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/bulk_change_table.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/content_tag.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/content_tag.rb similarity index 74% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/content_tag.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/content_tag.rb index 483a90ee72..47f519ffee 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/content_tag.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/content_tag.rb @@ -28,19 +28,34 @@ module RuboCop MSG = 'Use `tag` instead of `content_tag`.' RESTRICT_ON_SEND = %i[content_tag].freeze + def on_new_investigation + @corrected_nodes = nil + end + def on_send(node) first_argument = node.first_argument - return unless first_argument - - return if first_argument.variable? || first_argument.send_type? || first_argument.const_type? + return if !first_argument || + allowed_argument?(first_argument) || + corrected_ancestor?(node) add_offense(node) do |corrector| autocorrect(corrector, node) + + @corrected_nodes ||= Set.new.compare_by_identity + @corrected_nodes.add(node) end end 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) if method_name?(node.first_argument) range = correction_range(node) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/create_table_with_timestamps.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/create_table_with_timestamps.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/create_table_with_timestamps.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/create_table_with_timestamps.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/date.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/date.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/date.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/date.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/default_scope.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/default_scope.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/default_scope.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/default_scope.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/delegate.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/delegate.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/delegate.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/delegate.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/delegate_allow_blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/delegate_allow_blank.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/delegate_allow_blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/delegate_allow_blank.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/dynamic_find_by.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/dynamic_find_by.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/dynamic_find_by.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/dynamic_find_by.rb index 089baf254c..87a06c4ad6 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/dynamic_find_by.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/dynamic_find_by.rb @@ -32,13 +32,14 @@ module RuboCop # # good # Gem::Specification.find_by_name('backend').gem_dir class DynamicFindBy < Base + include ActiveRecordHelper extend AutoCorrector MSG = 'Use `%s` instead of dynamic `%s`.' METHOD_PATTERN = /^find_by_(.+?)(!)?$/.freeze 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 static_name = static_method_name(method_name) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/enum_hash.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/enum_hash.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/enum_hash.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/enum_hash.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/enum_uniqueness.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/enum_uniqueness.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/enum_uniqueness.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/enum_uniqueness.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/environment_comparison.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/environment_comparison.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/environment_comparison.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/environment_comparison.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/environment_variable_access.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/environment_variable_access.rb new file mode 100644 index 0000000000..00d6aee077 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/environment_variable_access.rb @@ -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 diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/exit.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/exit.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/exit.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/exit.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/file_path.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/file_path.rb similarity index 94% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/file_path.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/file_path.rb index a47abd3f9f..e8258537e4 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/file_path.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/file_path.rb @@ -29,10 +29,8 @@ module RuboCop include ConfigurableEnforcedStyle include RangeHelp - MSG_SLASHES = 'Please use `Rails.root.join(\'path/to\')` ' \ - 'instead.' - MSG_ARGUMENTS = 'Please use `Rails.root.join(\'path\', \'to\')` ' \ - 'instead.' + MSG_SLASHES = 'Prefer `Rails.root.join(\'path/to\')`.' + MSG_ARGUMENTS = 'Prefer `Rails.root.join(\'path\', \'to\')`.' RESTRICT_ON_SEND = %i[join].freeze def_node_matcher :file_join_nodes?, <<~PATTERN diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/find_by.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/find_by.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/find_by.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/find_by.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/find_by_id.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/find_by_id.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/find_by_id.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/find_by_id.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/find_each.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/find_each.rb similarity index 91% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/find_each.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/find_each.rb index c5ef88a785..328d98c0d2 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/find_each.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/find_each.rb @@ -17,6 +17,7 @@ module RuboCop # # good # User.order(:foo).each class FindEach < Base + include ActiveRecordHelper extend AutoCorrector MSG = 'Use `find_each` instead of `each`.' @@ -30,6 +31,7 @@ module RuboCop def on_send(node) return unless node.receiver&.send_type? return unless SCOPE_METHODS.include?(node.receiver.method_name) + return if node.receiver.receiver.nil? && !inherit_active_record_base?(node) return if ignored?(node) range = node.loc.selector diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/has_and_belongs_to_many.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/has_and_belongs_to_many.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/has_and_belongs_to_many.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/has_and_belongs_to_many.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb similarity index 71% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb index a4153389a0..47b9dd8423 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb @@ -5,7 +5,9 @@ module RuboCop module Rails # This cop looks for `has_many` or `has_one` associations that don't # 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 # # bad @@ -18,8 +20,18 @@ module RuboCop # class User < ActiveRecord::Base # has_many :comments, dependent: :restrict_with_exception # has_one :avatar, dependent: :destroy + # has_many :articles, dependent: nil # has_many :patients, through: :appointments # end + # + # class User < ActiveRecord::Base + # has_many :comments + # has_one :avatar + # + # def readonly? + # true + # end + # end class HasManyOrHasOneDependent < Base MSG = 'Specify a `:dependent` option.' RESTRICT_ON_SEND = %i[has_many has_one].freeze @@ -37,7 +49,7 @@ module RuboCop PATTERN def_node_matcher :dependent_option?, <<~PATTERN - (pair (sym :dependent) !nil) + (pair (sym :dependent) {!nil (nil)}) PATTERN def_node_matcher :present_option?, <<~PATTERN @@ -51,8 +63,20 @@ module RuboCop (args) ...) 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) - 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 valid_options_in_with_options_block?(node) @@ -61,10 +85,16 @@ module RuboCop 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) 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) end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/helper_instance_variable.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/helper_instance_variable.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/helper_instance_variable.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/helper_instance_variable.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/http_positional_arguments.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/http_positional_arguments.rb similarity index 93% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/http_positional_arguments.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/http_positional_arguments.rb index 357e770dba..a775a2024a 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/http_positional_arguments.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/http_positional_arguments.rb @@ -18,6 +18,7 @@ module RuboCop # get :new, params: { user_id: 1 } # get :new, **options class HttpPositionalArguments < Base + include RangeHelp extend AutoCorrector extend TargetRailsVersion @@ -44,7 +45,7 @@ module RuboCop 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}, {} # # @return lambda of auto correct procedure @@ -80,6 +81,12 @@ module RuboCop node.sym_type? && node.value == :format 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) return '' if data.hash_type? && data.empty? diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/http_status.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/http_status.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/http_status.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/http_status.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/ignored_skip_action_filter_option.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/ignored_skip_action_filter_option.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/ignored_skip_action_filter_option.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/ignored_skip_action_filter_option.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/index_by.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/index_by.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/index_by.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/index_by.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/index_with.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/index_with.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/index_with.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/index_with.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/inquiry.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/inquiry.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/inquiry.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/inquiry.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/inverse_of.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/inverse_of.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/inverse_of.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/inverse_of.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/lexically_scoped_action_filter.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/lexically_scoped_action_filter.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/lexically_scoped_action_filter.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/lexically_scoped_action_filter.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/link_to_blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/link_to_blank.rb similarity index 93% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/link_to_blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/link_to_blank.rb index 24f35b4e9a..558532681c 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/link_to_blank.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/link_to_blank.rb @@ -79,7 +79,11 @@ module RuboCop opening_quote = offence_node.children.last.source[0] closing_quote = opening_quote == ':' ? '' : opening_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) end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/mailer_name.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/mailer_name.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/mailer_name.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/mailer_name.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/match_route.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/match_route.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/match_route.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/match_route.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/negate_include.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/negate_include.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/negate_include.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/negate_include.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/not_null_column.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/not_null_column.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/not_null_column.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/not_null_column.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/order_by_id.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/order_by_id.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/order_by_id.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/order_by_id.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/output.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/output.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/output.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/output.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/output_safety.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/output_safety.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/output_safety.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/output_safety.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/pick.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/pick.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/pick.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/pick.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/pluck.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/pluck.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/pluck.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/pluck.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/pluck_id.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/pluck_id.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/pluck_id.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/pluck_id.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/pluck_in_where.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/pluck_in_where.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/pluck_in_where.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/pluck_in_where.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/pluralization_grammar.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/pluralization_grammar.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/pluralization_grammar.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/pluralization_grammar.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/presence.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/presence.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/presence.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/presence.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/present.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/present.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/present.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/present.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/rake_environment.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/rake_environment.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/rake_environment.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/rake_environment.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/read_write_attribute.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/read_write_attribute.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/read_write_attribute.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/read_write_attribute.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/redundant_allow_nil.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/redundant_allow_nil.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/redundant_allow_nil.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/redundant_allow_nil.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/redundant_foreign_key.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/redundant_foreign_key.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/redundant_foreign_key.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/redundant_foreign_key.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/reflection_class_name.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/reflection_class_name.rb similarity index 65% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/reflection_class_name.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/reflection_class_name.rb index 3e70b17b2d..4c1e2bfcf0 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/reflection_class_name.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/reflection_class_name.rb @@ -5,6 +5,8 @@ module RuboCop module Rails # This cop checks if the value of the option `class_name`, in # the definition of a reflection is a string. + # It is marked as unsafe because it cannot be determined whether + # constant or method return value specified to `class_name` is a string. # # @example # # bad @@ -16,6 +18,7 @@ module RuboCop class ReflectionClassName < Base MSG = 'Use a string value for `class_name`.' RESTRICT_ON_SEND = %i[has_many has_one belongs_to].freeze + ALLOWED_REFLECTION_CLASS_TYPES = %i[dstr str sym].freeze def_node_matcher :association_with_reflection, <<~PATTERN (send nil? {:has_many :has_one :belongs_to} _ _ ? @@ -24,7 +27,7 @@ module RuboCop PATTERN def_node_matcher :reflection_class_name, <<~PATTERN - (pair (sym :class_name) [!dstr !str !sym]) + (pair (sym :class_name) #reflection_class_value?) PATTERN def on_send(node) @@ -32,6 +35,16 @@ module RuboCop add_offense(reflection_class_name.loc.expression) end end + + private + + def reflection_class_value?(class_value) + if class_value.send_type? + !class_value.method?(:to_s) || class_value.receiver.const_type? + else + !ALLOWED_REFLECTION_CLASS_TYPES.include?(class_value.type) + end + end end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/refute_methods.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/refute_methods.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/refute_methods.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/refute_methods.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/relative_date_constant.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/relative_date_constant.rb similarity index 71% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/relative_date_constant.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/relative_date_constant.rb index 3debfbb976..6e00fe1fde 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/relative_date_constant.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/relative_date_constant.rb @@ -31,13 +31,18 @@ module RuboCop include RangeHelp extend AutoCorrector - MSG = 'Do not assign %s to constants as it ' \ + MSG = 'Do not assign `%s` to constants as it ' \ 'will be evaluated only once.' + RELATIVE_DATE_METHODS = %i[since from_now after ago until before yesterday tomorrow].freeze def on_casgn(node) - relative_date_assignment?(node) do |method_name| - add_offense(node, message: message(method_name)) do |corrector| - autocorrect(corrector, node) + return if node.children[2]&.block_type? + + node.each_descendant(:send) do |send_node| + relative_date?(send_node) do |method_name| + add_offense(node, message: message(method_name)) do |corrector| + autocorrect(corrector, node) + end end end end @@ -88,23 +93,19 @@ module RuboCop range_between(name.loc.expression.begin_pos, value.loc.expression.end_pos) end - def_node_matcher :relative_date_assignment?, <<~PATTERN - { - (casgn _ _ (send _ ${:since :from_now :after :ago :until :before})) - (casgn _ _ ({erange irange} _ (send _ ${:since :from_now :after :ago :until :before}))) - (casgn _ _ ({erange irange} (send _ ${:since :from_now :after :ago :until :before}) _)) - } - PATTERN + def relative_date_method?(method_name) + RELATIVE_DATE_METHODS.include?(method_name) + end def_node_matcher :relative_date_or_assignment?, <<~PATTERN - (:or_asgn (casgn _ _) (send _ ${:since :from_now :after :ago :until :before})) + (:or_asgn (casgn _ _) (send _ $#relative_date_method?)) PATTERN def_node_matcher :relative_date?, <<~PATTERN { - ({erange irange} _ (send _ ${:since :from_now :after :ago :until :before})) - ({erange irange} (send _ ${:since :from_now :after :ago :until :before}) _) - (send _ ${:since :from_now :after :ago :until :before}) + ({erange irange} _ (send _ $#relative_date_method?)) + ({erange irange} (send _ $#relative_date_method?) _) + (send _ $#relative_date_method?) } PATTERN end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/render_inline.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/render_inline.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/render_inline.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/render_inline.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/render_plain_text.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/render_plain_text.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/render_plain_text.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/render_plain_text.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/request_referer.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/request_referer.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/request_referer.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/request_referer.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/require_dependency.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/require_dependency.rb new file mode 100644 index 0000000000..a72771d810 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/require_dependency.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module Rails + # This cop checks for the usage of `require_dependency`. + # + # `require_dependency` is an obsolete method for Rails applications running in Zeitwerk mode. + # In Zeitwerk mode, the semantics should match Ruby's and no need to be defensive with load order, + # just refer to classes and modules normally. + # If the constant name is dynamic, camelize if needed, and constantize. + # + # Applications running in Zeitwerk mode should not use `require_dependency`. + # + # NOTE: This cop is disabled by default. Please enable it if you are using Zeitwerk mode. + # + # @example + # # bad + # require_dependency 'some_lib' + class RequireDependency < Base + extend TargetRailsVersion + + minimum_target_rails_version 6.0 + + MSG = 'Do not use `require_dependency` with Zeitwerk mode.' + RESTRICT_ON_SEND = %i[require_dependency].freeze + + def_node_matcher :require_dependency_call?, <<~PATTERN + (send {nil? (const _ :Kernel)} :require_dependency _) + PATTERN + + def on_send(node) + require_dependency_call?(node) { add_offense(node) } + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/reversible_migration.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/reversible_migration.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/reversible_migration.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/reversible_migration.rb index 7c12cea115..36f5f05117 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/reversible_migration.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/reversible_migration.rb @@ -237,7 +237,7 @@ module RuboCop def check_drop_table_node(node) drop_table_call(node) do - unless node.parent.block_type? + unless node.parent.block_type? || node.last_argument.block_pass_type? add_offense( node, message: format(MSG, action: 'drop_table(without block)') diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/reversible_migration_method_definition.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/reversible_migration_method_definition.rb new file mode 100644 index 0000000000..4a2b90d1ba --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/reversible_migration_method_definition.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module Rails + # This cop checks whether the migration implements + # either a `change` method or both an `up` and a `down` + # method. + # + # @example + # # bad + # class SomeMigration < ActiveRecord::Migration[6.0] + # def up + # # up migration + # end + # + # # <----- missing down method + # end + # + # class SomeMigration < ActiveRecord::Migration[6.0] + # # <----- missing up method + # + # def down + # # down migration + # end + # end + # + # # good + # class SomeMigration < ActiveRecord::Migration[6.0] + # def change + # # reversible migration + # end + # end + # + # # good + # class SomeMigration < ActiveRecord::Migration[6.0] + # def up + # # up migration + # end + # + # def down + # # down migration + # end + # end + class ReversibleMigrationMethodDefinition < Base + MSG = 'Migrations must contain either a `change` method, or ' \ + 'both an `up` and a `down` method.' + + def_node_matcher :migration_class?, <<~PATTERN + (class + (const nil? _) + (send + (const (const nil? :ActiveRecord) :Migration) + :[] + (float _)) + _) + PATTERN + + def_node_matcher :change_method?, <<~PATTERN + [ #migration_class? `(def :change (args) _) ] + PATTERN + + def_node_matcher :up_and_down_methods?, <<~PATTERN + [ #migration_class? `(def :up (args) _) `(def :down (args) _) ] + PATTERN + + def on_class(node) + return if change_method?(node) || up_and_down_methods?(node) + + add_offense(node) + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/safe_navigation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/safe_navigation.rb similarity index 75% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/safe_navigation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/safe_navigation.rb index 50254a3ca2..b5e67e4d74 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/safe_navigation.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/safe_navigation.rb @@ -44,9 +44,22 @@ module RuboCop RESTRICT_ON_SEND = %i[try try!].freeze def_node_matcher :try_call, <<~PATTERN - (send !nil? ${:try :try!} $_ ...) + (send _ ${:try :try!} $_ ...) PATTERN + # Monkey patching for `Style/RedundantSelf` of RuboCop core. + # rubocop:disable Style/ClassAndModuleChildren + class Style::RedundantSelf + def self.autocorrect_incompatible_with + [Rails::SafeNavigation] + end + end + # rubocop:enable Style/ClassAndModuleChildren + + def self.autocorrect_incompatible_with + [Style::RedundantSelf] + end + def on_send(node) try_call(node) do |try_method, dispatch| return if try_method == :try && !cop_config['ConvertTry'] @@ -64,7 +77,12 @@ module RuboCop method_node, *params = *node.arguments method = method_node.source[1..-1] - range = range_between(node.loc.dot.begin_pos, node.loc.expression.end_pos) + range = if node.receiver + range_between(node.loc.dot.begin_pos, node.loc.expression.end_pos) + else + corrector.insert_before(node, 'self') + node + end corrector.replace(range, replacement(method, params)) end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/safe_navigation_with_blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/safe_navigation_with_blank.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/safe_navigation_with_blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/safe_navigation_with_blank.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/save_bang.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/save_bang.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/save_bang.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/save_bang.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/scope_args.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/scope_args.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/scope_args.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/scope_args.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/short_i18n.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/short_i18n.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/short_i18n.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/short_i18n.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/skips_model_validations.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/skips_model_validations.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/skips_model_validations.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/skips_model_validations.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/squished_sql_heredocs.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/squished_sql_heredocs.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/squished_sql_heredocs.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/squished_sql_heredocs.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/time_zone.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/time_zone.rb similarity index 93% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/time_zone.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/time_zone.rb index 4a3fa258c3..4182aa562d 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/time_zone.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/time_zone.rb @@ -19,7 +19,7 @@ module RuboCop # # # bad # Time.now - # Time.parse('2015-03-02 19:05:37') + # Time.parse('2015-03-02T19:05:37') # # # bad # Time.current @@ -27,18 +27,19 @@ module RuboCop # # # good # Time.zone.now - # Time.zone.parse('2015-03-02 19:05:37') + # Time.zone.parse('2015-03-02T19:05:37') + # Time.zone.parse('2015-03-02T19:05:37Z') # Respect ISO 8601 format with timezone specifier. # # @example EnforcedStyle: flexible (default) # # `flexible` allows usage of `in_time_zone` instead of `zone`. # # # bad # Time.now - # Time.parse('2015-03-02 19:05:37') + # Time.parse('2015-03-02T19:05:37') # # # good # Time.zone.now - # Time.zone.parse('2015-03-02 19:05:37') + # Time.zone.parse('2015-03-02T19:05:37') # # # good # Time.current @@ -63,6 +64,8 @@ module RuboCop ACCEPTED_METHODS = %i[in_time_zone utc getlocal xmlschema iso8601 jisx0301 rfc3339 httpdate to_i to_f].freeze + TIMEZONE_SPECIFIER = /[A-z]/.freeze + def on_const(node) mod, klass = *node # we should only check core classes @@ -116,9 +119,10 @@ module RuboCop end def check_time_node(klass, node) + return if attach_timezone_specifier?(node.first_argument) + chain = extract_method_chain(node) return if not_danger_chain?(chain) - return check_localtime(node) if need_check_localtime?(chain) method_name = (chain & DANGEROUS_METHODS).join('.') @@ -132,6 +136,10 @@ module RuboCop end end + def attach_timezone_specifier?(date) + date.respond_to?(:value) && TIMEZONE_SPECIFIER.match?(date.value.to_s[-1]) + end + def build_message(klass, method_name, node) if flexible? format( diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/time_zone_assignment.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/time_zone_assignment.rb new file mode 100644 index 0000000000..b3a78ef58c --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/time_zone_assignment.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module Rails + # This cop checks for the use of `Time.zone=` method. + # + # The `zone` attribute persists for the rest of the Ruby runtime, potentially causing + # unexpected behaviour at a later time. + # Using `Time.use_zone` ensures the code passed in block is the only place Time.zone is affected. + # It eliminates the possibility of a `zone` sticking around longer than intended. + # + # @example + # # bad + # Time.zone = 'EST' + # + # # good + # Time.use_zone('EST') do + # end + # + class TimeZoneAssignment < Base + MSG = 'Use `Time.use_zone` with blocks instead of `Time.zone=`.' + RESTRICT_ON_SEND = %i[zone=].freeze + + def_node_matcher :time_zone_assignement?, <<~PATTERN + (send (const nil? :Time) :zone= ...) + PATTERN + + def on_send(node) + return unless time_zone_assignement?(node) + + add_offense(node) + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/uniq_before_pluck.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/uniq_before_pluck.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/uniq_before_pluck.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/uniq_before_pluck.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/unique_validation_without_index.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/unique_validation_without_index.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/unique_validation_without_index.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/unique_validation_without_index.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/unknown_env.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/unknown_env.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/unknown_env.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/unknown_env.rb index 56d42cf645..0cf5ff2bf8 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/unknown_env.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/unknown_env.rb @@ -62,7 +62,7 @@ module RuboCop # DidYouMean::SpellChecker is not available in all versions of Ruby, # and even on versions where it *is* available (>= 2.3), it is not # always required correctly. So we do a feature check first. See: - # https://github.com/rubocop-hq/rubocop/issues/7979 + # https://github.com/rubocop/rubocop/issues/7979 similar_names = if defined?(DidYouMean::SpellChecker) spell_checker = DidYouMean::SpellChecker.new(dictionary: environments) spell_checker.correct(name) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/validation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/validation.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/validation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/validation.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/where_equals.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/where_equals.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/where_equals.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/where_equals.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/where_exists.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/where_exists.rb similarity index 88% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/where_exists.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/where_exists.rb index 2c40e2312a..fb4146430c 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/where_exists.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/where_exists.rb @@ -11,6 +11,17 @@ module RuboCop # When EnforcedStyle is 'where' then the cop enforces # `where(...).exists?` over `exists?(...)`. # + # This cop is unsafe for auto-correction because the behavior may change on the following case: + # + # [source,ruby] + # ---- + # Author.includes(:articles).where(articles: {id: id}).exists? + # #=> Perform `eager_load` behavior (`LEFT JOIN` query) and get result. + # + # Author.includes(:articles).exists?(articles: {id: id}) + # #=> Perform `preload` behavior and `ActiveRecord::StatementInvalid` error occurs. + # ---- + # # @example EnforcedStyle: exists (default) # # bad # User.where(name: 'john').exists? diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/where_not.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/where_not.rb similarity index 93% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/where_not.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/where_not.rb index 998618bed2..f50f4c01a4 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails/where_not.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails/where_not.rb @@ -15,11 +15,13 @@ module RuboCop # User.where('name IS NOT NULL') # User.where('name NOT IN (?)', ['john', 'jane']) # User.where('name NOT IN (:names)', names: ['john', 'jane']) + # User.where('users.name != :name', name: 'Gabe') # # # good # User.where.not(name: 'Gabe') # User.where.not(name: nil) # User.where.not(name: ['john', 'jane']) + # User.where.not(users: { name: 'Gabe' }) # class WhereNot < Base include RangeHelp @@ -86,7 +88,9 @@ module RuboCop def build_good_method(column, value) if column.include?('.') - "where.not('#{column}' => #{value})" + table, column = column.split('.') + + "where.not(#{table}: { #{column}: #{value} })" else "where.not(#{column}: #{value})" end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails_cops.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails_cops.rb similarity index 94% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails_cops.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails_cops.rb index c8302a37ea..5c07a66421 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/cop/rails_cops.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/cop/rails_cops.rb @@ -31,6 +31,7 @@ require_relative 'rails/dynamic_find_by' require_relative 'rails/enum_hash' require_relative 'rails/enum_uniqueness' require_relative 'rails/environment_comparison' +require_relative 'rails/environment_variable_access' require_relative 'rails/exit' require_relative 'rails/file_path' require_relative 'rails/find_by' @@ -73,7 +74,9 @@ require_relative 'rails/relative_date_constant' require_relative 'rails/render_inline' require_relative 'rails/render_plain_text' require_relative 'rails/request_referer' +require_relative 'rails/require_dependency' require_relative 'rails/reversible_migration' +require_relative 'rails/reversible_migration_method_definition' require_relative 'rails/safe_navigation' require_relative 'rails/safe_navigation_with_blank' require_relative 'rails/save_bang' @@ -82,6 +85,7 @@ require_relative 'rails/short_i18n' require_relative 'rails/skips_model_validations' require_relative 'rails/squished_sql_heredocs' require_relative 'rails/time_zone' +require_relative 'rails/time_zone_assignment' require_relative 'rails/uniq_before_pluck' require_relative 'rails/unique_validation_without_index' require_relative 'rails/unknown_env' diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/rails.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/rails.rb similarity index 80% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/rails.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/rails.rb index fdc6d8b477..f94bb9658d 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/rails.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/rails.rb @@ -8,5 +8,7 @@ module RuboCop CONFIG = YAML.safe_load(CONFIG_DEFAULT.read).freeze private_constant(:CONFIG_DEFAULT, :PROJECT_ROOT) + + ::RuboCop::ConfigObsoletion.files << PROJECT_ROOT.join('config', 'obsoletion.yml') end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/rails/inject.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/rails/inject.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/rails/inject.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/rails/inject.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/rails/schema_loader.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/rails/schema_loader.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/rails/schema_loader.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/rails/schema_loader.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/rails/schema_loader/schema.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/rails/schema_loader/schema.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/rails/schema_loader/schema.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/rails/schema_loader/schema.rb index 313225bec3..c641a0ebd8 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/rails/schema_loader/schema.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/rails/schema_loader/schema.rb @@ -128,9 +128,7 @@ module RuboCop return unless pairs.hash_type? pairs.each_pair do |k, v| - if k.value == :null - @not_null = v.true_type? ? false : true - end + @not_null = !v.true_type? if k.value == :null end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/rails/version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/rails/version.rb similarity index 90% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/rails/version.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/rails/version.rb index 11c1f2eef3..675c149fa0 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.9.1/lib/rubocop/rails/version.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.0/lib/rubocop/rails/version.rb @@ -4,7 +4,7 @@ module RuboCop module Rails # This module holds the RuboCop Rails version information. module Version - STRING = '2.9.1' + STRING = '2.10.0' def self.document_version STRING.match('\d+\.\d+').to_s