From c1e35b7f8b5c4f0b8750ed979a942e716be73e78 Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Mon, 21 Jun 2021 18:05:23 +0000 Subject: [PATCH] brew vendor-gems: commit updates. --- .../Homebrew/vendor/bundle/bundler/setup.rb | 2 +- .../config/default.yml | 46 +++++++++- .../config/obsoletion.yml | 0 .../lib/rubocop-rails.rb | 0 .../rubocop/cop/mixin/active_record_helper.rb | 0 .../rubocop/cop/mixin/enforce_superclass.rb | 0 .../lib/rubocop/cop/mixin/index_method.rb | 0 .../rubocop/cop/mixin/target_rails_version.rb | 0 .../lib/rubocop/cop/rails/action_filter.rb | 0 .../cop/rails/active_record_aliases.rb | 0 .../rails/active_record_callbacks_order.rb | 0 .../cop/rails/active_record_override.rb | 0 .../cop/rails/active_support_aliases.rb | 0 .../lib/rubocop/cop/rails/add_column_index.rb | 64 ++++++++++++++ .../cop/rails/after_commit_override.rb | 0 .../cop/rails/application_controller.rb | 0 .../lib/rubocop/cop/rails/application_job.rb | 0 .../rubocop/cop/rails/application_mailer.rb | 0 .../rubocop/cop/rails/application_record.rb | 0 .../lib/rubocop/cop/rails/arel_star.rb | 0 .../lib/rubocop/cop/rails/assert_not.rb | 0 .../rails/attribute_default_block_value.rb | 0 .../lib/rubocop/cop/rails/belongs_to.rb | 0 .../lib/rubocop/cop/rails/blank.rb | 0 .../rubocop/cop/rails/bulk_change_table.rb | 0 .../lib/rubocop/cop/rails/content_tag.rb | 0 .../cop/rails/create_table_with_timestamps.rb | 0 .../lib/rubocop/cop/rails/date.rb | 23 +++-- .../lib/rubocop/cop/rails/default_scope.rb | 0 .../lib/rubocop/cop/rails/delegate.rb | 0 .../rubocop/cop/rails/delegate_allow_blank.rb | 0 .../lib/rubocop/cop/rails/dynamic_find_by.rb | 3 +- .../cop/rails/eager_evaluation_log_message.rb | 78 +++++++++++++++++ .../lib/rubocop/cop/rails/enum_hash.rb | 0 .../lib/rubocop/cop/rails/enum_uniqueness.rb | 0 .../cop/rails/environment_comparison.rb | 0 .../cop/rails/environment_variable_access.rb | 0 .../lib/rubocop/cop/rails/exit.rb | 0 .../rubocop/cop/rails/expanded_date_range.rb | 86 +++++++++++++++++++ .../lib/rubocop/cop/rails/file_path.rb | 0 .../lib/rubocop/cop/rails/find_by.rb | 30 ++++--- .../lib/rubocop/cop/rails/find_by_id.rb | 0 .../lib/rubocop/cop/rails/find_each.rb | 0 .../cop/rails/has_and_belongs_to_many.rb | 0 .../rails/has_many_or_has_one_dependent.rb | 0 .../cop/rails/helper_instance_variable.rb | 0 .../cop/rails/http_positional_arguments.rb | 0 .../lib/rubocop/cop/rails/http_status.rb | 15 +++- .../cop/rails/i18n_locale_assignment.rb | 37 ++++++++ .../ignored_skip_action_filter_option.rb | 0 .../lib/rubocop/cop/rails/index_by.rb | 0 .../lib/rubocop/cop/rails/index_with.rb | 0 .../lib/rubocop/cop/rails/inquiry.rb | 0 .../lib/rubocop/cop/rails/inverse_of.rb | 0 .../rails/lexically_scoped_action_filter.rb | 0 .../lib/rubocop/cop/rails/link_to_blank.rb | 0 .../lib/rubocop/cop/rails/mailer_name.rb | 0 .../lib/rubocop/cop/rails/match_route.rb | 0 .../lib/rubocop/cop/rails/negate_include.rb | 0 .../lib/rubocop/cop/rails/not_null_column.rb | 0 .../lib/rubocop/cop/rails/order_by_id.rb | 0 .../lib/rubocop/cop/rails/output.rb | 0 .../lib/rubocop/cop/rails/output_safety.rb | 0 .../lib/rubocop/cop/rails/pick.rb | 0 .../lib/rubocop/cop/rails/pluck.rb | 0 .../lib/rubocop/cop/rails/pluck_id.rb | 0 .../lib/rubocop/cop/rails/pluck_in_where.rb | 0 .../cop/rails/pluralization_grammar.rb | 0 .../lib/rubocop/cop/rails/presence.rb | 0 .../lib/rubocop/cop/rails/present.rb | 0 .../lib/rubocop/cop/rails/rake_environment.rb | 0 .../rubocop/cop/rails/read_write_attribute.rb | 0 .../rubocop/cop/rails/redundant_allow_nil.rb | 0 .../cop/rails/redundant_foreign_key.rb | 0 .../redundant_receiver_in_with_options.rb | 0 .../cop/rails/reflection_class_name.rb | 0 .../lib/rubocop/cop/rails/refute_methods.rb | 0 .../cop/rails/relative_date_constant.rb | 38 ++++---- .../lib/rubocop/cop/rails/render_inline.rb | 0 .../rubocop/cop/rails/render_plain_text.rb | 0 .../lib/rubocop/cop/rails/request_referer.rb | 0 .../rubocop/cop/rails/require_dependency.rb | 0 .../rubocop/cop/rails/reversible_migration.rb | 0 .../reversible_migration_method_definition.rb | 2 +- .../lib/rubocop/cop/rails/safe_navigation.rb | 0 .../cop/rails/safe_navigation_with_blank.rb | 0 .../lib/rubocop/cop/rails/save_bang.rb | 0 .../lib/rubocop/cop/rails/scope_args.rb | 0 .../lib/rubocop/cop/rails/short_i18n.rb | 0 .../cop/rails/skips_model_validations.rb | 0 .../cop/rails/squished_sql_heredocs.rb | 0 .../lib/rubocop/cop/rails/time_zone.rb | 38 ++++---- .../rubocop/cop/rails/time_zone_assignment.rb | 6 +- .../rubocop/cop/rails/uniq_before_pluck.rb | 0 .../rails/unique_validation_without_index.rb | 0 .../lib/rubocop/cop/rails/unknown_env.rb | 0 .../cop/rails/unused_ignored_columns.rb | 69 +++++++++++++++ .../lib/rubocop/cop/rails/validation.rb | 0 .../lib/rubocop/cop/rails/where_equals.rb | 0 .../lib/rubocop/cop/rails/where_exists.rb | 0 .../lib/rubocop/cop/rails/where_not.rb | 0 .../lib/rubocop/cop/rails_cops.rb | 5 ++ .../lib/rubocop/rails.rb | 0 .../lib/rubocop/rails/inject.rb | 0 .../lib/rubocop/rails/schema_loader.rb | 0 .../lib/rubocop/rails/schema_loader/schema.rb | 2 +- .../lib/rubocop/rails/version.rb | 2 +- 107 files changed, 473 insertions(+), 73 deletions(-) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/config/default.yml (94%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/config/obsoletion.yml (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop-rails.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/mixin/active_record_helper.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/mixin/enforce_superclass.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/mixin/index_method.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/mixin/target_rails_version.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/action_filter.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/active_record_aliases.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/active_record_callbacks_order.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/active_record_override.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/active_support_aliases.rb (100%) create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/add_column_index.rb rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/after_commit_override.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/application_controller.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/application_job.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/application_mailer.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/application_record.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/arel_star.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/assert_not.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/attribute_default_block_value.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/belongs_to.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/blank.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/bulk_change_table.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/content_tag.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/create_table_with_timestamps.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/date.rb (88%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/default_scope.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/delegate.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/delegate_allow_blank.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/dynamic_find_by.rb (95%) create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/eager_evaluation_log_message.rb rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/enum_hash.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/enum_uniqueness.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/environment_comparison.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/environment_variable_access.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/exit.rb (100%) create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/expanded_date_range.rb rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/file_path.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/find_by.rb (61%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/find_by_id.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/find_each.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/has_and_belongs_to_many.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/helper_instance_variable.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/http_positional_arguments.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/http_status.rb (89%) create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/i18n_locale_assignment.rb rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/ignored_skip_action_filter_option.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/index_by.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/index_with.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/inquiry.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/inverse_of.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/lexically_scoped_action_filter.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/link_to_blank.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/mailer_name.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/match_route.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/negate_include.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/not_null_column.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/order_by_id.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/output.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/output_safety.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/pick.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/pluck.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/pluck_id.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/pluck_in_where.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/pluralization_grammar.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/presence.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/present.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/rake_environment.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/read_write_attribute.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/redundant_allow_nil.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/redundant_foreign_key.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/reflection_class_name.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/refute_methods.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/relative_date_constant.rb (71%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/render_inline.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/render_plain_text.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/request_referer.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/require_dependency.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/reversible_migration.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/reversible_migration_method_definition.rb (96%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/safe_navigation.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/safe_navigation_with_blank.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/save_bang.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/scope_args.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/short_i18n.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/skips_model_validations.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/squished_sql_heredocs.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/time_zone.rb (94%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/time_zone_assignment.rb (78%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/uniq_before_pluck.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/unique_validation_without_index.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/unknown_env.rb (100%) create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/unused_ignored_columns.rb rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/validation.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/where_equals.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/where_exists.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails/where_not.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/cop/rails_cops.rb (94%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/rails.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/rails/inject.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/rails/schema_loader.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/rails/schema_loader/schema.rb (98%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.10.1 => rubocop-rails-2.11.0}/lib/rubocop/rails/version.rb (90%) diff --git a/Library/Homebrew/vendor/bundle/bundler/setup.rb b/Library/Homebrew/vendor/bundle/bundler/setup.rb index 8ed22cd5e7..f333d921be 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -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.17.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.11.3/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rails-2.10.1/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rails-2.11.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-2.4.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-sorbet-0.6.2/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-2.5.1/lib" diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/config/default.yml b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/config/default.yml similarity index 94% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/config/default.yml rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/config/default.yml index 82881fcdb4..27e926b27d 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/config/default.yml +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/config/default.yml @@ -83,6 +83,16 @@ Rails/ActiveSupportAliases: Enabled: true VersionAdded: '0.48' +Rails/AddColumnIndex: + Description: >- + Rails migrations don't make use of a given `index` key, but also + doesn't given an error when it's used, so it makes it seem like an + index might be used. + Enabled: pending + VersionAdded: '2.11' + Include: + - db/migrate/*.rb + Rails/AfterCommitOverride: Description: >- This cop enforces that there is only one call to `after_commit` @@ -193,7 +203,7 @@ Rails/Date: such as Date.today, Date.current etc. Enabled: true VersionAdded: '0.30' - VersionChanged: '0.33' + VersionChanged: '2.11' # The value `strict` disallows usage of `Date.today`, `Date.current`, # `Date#to_time` etc. # The value `flexible` allows usage of `Date.current`, `Date.yesterday`, etc @@ -203,6 +213,7 @@ Rails/Date: SupportedStyles: - strict - flexible + AllowToTime: true Rails/DefaultScope: Description: 'Avoid use of `default_scope`.' @@ -240,6 +251,12 @@ Rails/DynamicFindBy: AllowedReceivers: - Gem::Specification +Rails/EagerEvaluationLogMessage: + Description: 'Checks that blocks are used for interpolated strings passed to `Rails.logger.debug`.' + Reference: 'https://guides.rubyonrails.org/debugging_rails_applications.html#impact-of-logs-on-performance' + Enabled: pending + VersionAdded: '2.11' + Rails/EnumHash: Description: 'Prefer hash syntax over array syntax when defining enums.' StyleGuide: 'https://rails.rubystyle.guide#enums' @@ -262,8 +279,10 @@ Rails/EnvironmentComparison: Rails/EnvironmentVariableAccess: Description: 'Do not access `ENV` directly after initialization.' - Enabled: pending + # TODO: Set to `pending` status in RuboCop Rails 2 series when migration doc will be written. + Enabled: false VersionAdded: '2.10' + VersionChanged: '2.11' Include: - app/**/*.rb - lib/**/*.rb @@ -286,6 +305,11 @@ Rails/Exit: Exclude: - lib/**/*.rake +Rails/ExpandedDateRange: + Description: 'Checks for expanded date range.' + Enabled: pending + VersionAdded: '2.11' + Rails/FilePath: Description: 'Use `Rails.root.join` for file path joining.' Enabled: true @@ -301,6 +325,8 @@ Rails/FindBy: StyleGuide: 'https://rails.rubystyle.guide#find_by' Enabled: true VersionAdded: '0.30' + VersionChanged: '2.11' + IgnoreWhereFirst: true Include: - app/models/**/*.rb @@ -362,11 +388,20 @@ Rails/HttpStatus: Description: 'Enforces use of symbolic or numeric value to define HTTP status.' Enabled: true VersionAdded: '0.54' + VersionChanged: '2.11' EnforcedStyle: symbolic SupportedStyles: - numeric - symbolic +Rails/I18nLocaleAssignment: + Description: 'Prefer the usage of `I18n.with_locale` instead of manually updating `I18n.locale` value.' + Enabled: 'pending' + VersionAdded: '2.11' + Include: + - spec/**/*.rb + - test/**/*.rb + Rails/IgnoredSkipActionFilterOption: Description: 'Checks that `if` and `only` (or `except`) are not used together as options of `skip_*` action filter.' Reference: 'https://api.rubyonrails.org/classes/AbstractController/Callbacks/ClassMethods.html#method-i-_normalize_callback_options' @@ -784,6 +819,13 @@ Rails/UnknownEnv: - test - production +Rails/UnusedIgnoredColumns: + Description: 'Remove a column that does not exist from `ignored_columns`.' + Enabled: pending + VersionAdded: '2.11' + Include: + - app/models/**/*.rb + Rails/Validation: Description: 'Use validates :attribute, hash of validations.' Enabled: true diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/config/obsoletion.yml b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/config/obsoletion.yml similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/config/obsoletion.yml rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/config/obsoletion.yml diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop-rails.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop-rails.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop-rails.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop-rails.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/mixin/active_record_helper.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/mixin/active_record_helper.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/mixin/active_record_helper.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/mixin/active_record_helper.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/mixin/enforce_superclass.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/mixin/enforce_superclass.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/mixin/enforce_superclass.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/mixin/index_method.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/mixin/index_method.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/mixin/index_method.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/mixin/target_rails_version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/mixin/target_rails_version.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/mixin/target_rails_version.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/action_filter.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/action_filter.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/action_filter.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/active_record_aliases.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/active_record_aliases.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/active_record_aliases.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/active_record_callbacks_order.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/active_record_callbacks_order.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/active_record_override.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/active_record_override.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/active_record_override.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/active_support_aliases.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/active_support_aliases.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/active_support_aliases.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/add_column_index.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/add_column_index.rb new file mode 100644 index 0000000000..e7816d5fa6 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/add_column_index.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module Rails + # This cop checks for migrations using `add_column` that have an `index` + # key. `add_column` does not accept `index`, but also does not raise an + # error for extra keys, so it is possible to mistakenly add the key without + # realizing it will not actually add an index. + # + # @example + # # bad (will not add an index) + # add_column :table, :column, :integer, index: true + # + # # good + # add_column :table, :column, :integer + # add_index :table, :column + # + class AddColumnIndex < Base + extend AutoCorrector + include RangeHelp + + MSG = '`add_column` does not accept an `index` key, use `add_index` instead.' + RESTRICT_ON_SEND = %i[add_column].freeze + + # @!method add_column_with_index(node) + def_node_matcher :add_column_with_index, <<~PATTERN + ( + send nil? :add_column $_table $_column + <(hash <$(pair {(sym :index) (str "index")} $_) ...>) ...> + ) + PATTERN + + def on_send(node) + table, column, pair, value = add_column_with_index(node) + return unless pair + + add_offense(pair) do |corrector| + corrector.remove(index_range(pair)) + + add_index = "add_index #{table.source}, #{column.source}" + add_index_opts = '' + + if value.hash_type? + hash = value.loc.expression.adjust(begin_pos: 1, end_pos: -1).source.strip + add_index_opts = ", #{hash}" + end + + corrector.insert_after(node, "\n#{add_index}#{add_index_opts}") + end + end + + private + + def index_range(pair_node) + range_with_surrounding_comma( + range_with_surrounding_space(range: pair_node.loc.expression, side: :left), + :left + ) + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/after_commit_override.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/after_commit_override.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/after_commit_override.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/application_controller.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/application_controller.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/application_controller.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/application_job.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/application_job.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/application_job.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/application_mailer.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/application_mailer.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/application_mailer.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/application_record.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/application_record.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/application_record.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/arel_star.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/arel_star.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/arel_star.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/assert_not.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/assert_not.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/assert_not.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/attribute_default_block_value.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/attribute_default_block_value.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/attribute_default_block_value.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/attribute_default_block_value.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/belongs_to.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/belongs_to.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/belongs_to.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/belongs_to.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/blank.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/blank.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/bulk_change_table.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/bulk_change_table.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/bulk_change_table.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/content_tag.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/content_tag.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/content_tag.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/content_tag.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/create_table_with_timestamps.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/create_table_with_timestamps.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/date.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/date.rb similarity index 88% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/date.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/date.rb index 79b074e78a..decc517d5d 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/date.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/date.rb @@ -12,20 +12,21 @@ module RuboCop # The cop also reports warnings when you are using `to_time` method, # because it doesn't know about Rails time zone either. # - # Two styles are supported for this cop. When EnforcedStyle is 'strict' + # Two styles are supported for this cop. When `EnforcedStyle` is 'strict' # then the Date methods `today`, `current`, `yesterday`, and `tomorrow` # are prohibited and the usage of both `to_time` # and 'to_time_in_current_zone' are reported as warning. # - # When EnforcedStyle is 'flexible' then only `Date.today` is prohibited - # and only `to_time` is reported as warning. + # When `EnforcedStyle` is `flexible` then only `Date.today` is prohibited. + # + # And you can set a warning for `to_time` with `AllowToTime: false`. + # `AllowToTime` is `true` by default to prevent false positive on `DateTime` object. # # @example EnforcedStyle: strict # # bad # Date.current # Date.yesterday # Date.today - # date.to_time # # # good # Time.zone.today @@ -34,7 +35,6 @@ module RuboCop # @example EnforcedStyle: flexible (default) # # bad # Date.today - # date.to_time # # # good # Time.zone.today @@ -43,6 +43,13 @@ module RuboCop # Date.yesterday # date.in_time_zone # + # @example AllowToTime: true (default) + # # good + # date.to_time + # + # @example AllowToTime: false + # # bad + # date.to_time class Date < Base include ConfigurableEnforcedStyle @@ -73,7 +80,7 @@ module RuboCop def on_send(node) return unless node.receiver && bad_methods.include?(node.method_name) - + return if allow_to_time? && node.method?(:to_time) return if safe_chain?(node) || safe_to_time?(node) check_deprecated_methods(node) @@ -139,6 +146,10 @@ module RuboCop end end + def allow_to_time? + cop_config.fetch('AllowToTime', true) + end + def good_days style == :strict ? [] : %i[current yesterday tomorrow] end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/default_scope.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/default_scope.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/default_scope.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/delegate.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/delegate.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/delegate.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/delegate.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/delegate_allow_blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/delegate_allow_blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/delegate_allow_blank.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/dynamic_find_by.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/dynamic_find_by.rb similarity index 95% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/dynamic_find_by.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/dynamic_find_by.rb index 87a06c4ad6..75358c8367 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/dynamic_find_by.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/dynamic_find_by.rb @@ -37,6 +37,7 @@ module RuboCop MSG = 'Use `%s` instead of dynamic `%s`.' METHOD_PATTERN = /^find_by_(.+?)(!)?$/.freeze + IGNORED_ARGUMENT_TYPES = %i[hash splat].freeze def on_send(node) return if node.receiver.nil? && !inherit_active_record_base?(node) || allowed_invocation?(node) @@ -44,7 +45,7 @@ module RuboCop method_name = node.method_name static_name = static_method_name(method_name) return unless static_name - return if node.arguments.any?(&:splat_type?) + return if node.arguments.any? { |argument| IGNORED_ARGUMENT_TYPES.include?(argument.type) } message = format(MSG, static_name: static_name, method: method_name) add_offense(node, message: message) do |corrector| diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/eager_evaluation_log_message.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/eager_evaluation_log_message.rb new file mode 100644 index 0000000000..a5d0ebe51f --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/eager_evaluation_log_message.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module Rails + # This cop checks that blocks are used for interpolated strings passed to + # `Rails.logger.debug`. + # + # By default, Rails production environments use the `:info` log level. + # At the `:info` log level, `Rails.logger.debug` statements do not result + # in log output. However, Ruby must eagerly evaluate interpolated string + # arguments passed as method arguments. Passing a block to + # `Rails.logger.debug` prevents costly evaluation of interpolated strings + # when no output would be produced anyway. + # + # @example + # #bad + # Rails.logger.debug "The time is #{Time.zone.now}." + # + # #good + # Rails.logger.debug { "The time is #{Time.zone.now}." } + # + class EagerEvaluationLogMessage < Base + extend AutoCorrector + + MSG = 'Pass a block to `Rails.logger.debug`.' + RESTRICT_ON_SEND = %i[debug].freeze + + def_node_matcher :interpolated_string_passed_to_debug, <<~PATTERN + (send + (send + (const {cbase nil?} :Rails) + :logger + ) + :debug + $(dstr ...) + ) + PATTERN + + def on_send(node) + return if node.parent&.block_type? + + interpolated_string_passed_to_debug(node) do |arguments| + message = format(MSG) + + range = replacement_range(node) + replacement = replacement_source(node, arguments) + + add_offense(range, message: message) do |corrector| + corrector.replace(range, replacement) + end + end + end + + private + + def replacement_range(node) + stop = node.loc.expression.end + start = node.loc.selector.end + + if node.parenthesized_call? + stop.with(begin_pos: start.begin_pos) + else + stop.with(begin_pos: start.begin_pos + 1) + end + end + + def replacement_source(node, arguments) + if node.parenthesized_call? + " { #{arguments.source} }" + else + "{ #{arguments.source} }" + end + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/enum_hash.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/enum_hash.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/enum_hash.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/enum_uniqueness.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/enum_uniqueness.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/enum_uniqueness.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/environment_comparison.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/environment_comparison.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/environment_comparison.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/environment_variable_access.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/environment_variable_access.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/environment_variable_access.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/environment_variable_access.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/exit.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/exit.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/exit.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/exit.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/expanded_date_range.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/expanded_date_range.rb new file mode 100644 index 0000000000..34e1d341af --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/expanded_date_range.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module Rails + # This cop checks for expanded date range. It only compatible `..` range is targeted. + # Incompatible `...` range is ignored. + # + # @example + # # bad + # date.beginning_of_day..date.end_of_day + # date.beginning_of_week..date.end_of_week + # date.beginning_of_month..date.end_of_month + # date.beginning_of_quarter..date.end_of_quarter + # date.beginning_of_year..date.end_of_year + # + # # good + # date.all_day + # date.all_week + # date.all_month + # date.all_quarter + # date.all_year + # + class ExpandedDateRange < Base + extend AutoCorrector + extend TargetRailsVersion + + MSG = 'Use `%s` instead.' + + minimum_target_rails_version 5.1 + + def_node_matcher :expanded_date_range, <<~PATTERN + (irange + (send + $_ {:beginning_of_day :beginning_of_week :beginning_of_month :beginning_of_quarter :beginning_of_year}) + (send + $_ {:end_of_day :end_of_week :end_of_month :end_of_quarter :end_of_year})) + PATTERN + + PREFERRED_METHODS = { + beginning_of_day: 'all_day', + beginning_of_week: 'all_week', + beginning_of_month: 'all_month', + beginning_of_quarter: 'all_quarter', + beginning_of_year: 'all_year' + }.freeze + + MAPPED_DATE_RANGE_METHODS = { + beginning_of_day: :end_of_day, + beginning_of_week: :end_of_week, + beginning_of_month: :end_of_month, + beginning_of_quarter: :end_of_quarter, + beginning_of_year: :end_of_year + }.freeze + + def on_irange(node) + return unless expanded_date_range(node) + + begin_node = node.begin + end_node = node.end + return unless same_receiver?(begin_node, end_node) + + beginning_method = begin_node.method_name + end_method = end_node.method_name + return unless use_mapped_methods?(beginning_method, end_method) + + preferred_method = "#{begin_node.receiver.source}.#{PREFERRED_METHODS[beginning_method]}" + + add_offense(node, message: format(MSG, preferred_method: preferred_method)) do |corrector| + corrector.replace(node, preferred_method) + end + end + + private + + def same_receiver?(begin_node, end_node) + begin_node.receiver.source == end_node.receiver.source + end + + def use_mapped_methods?(beginning_method, end_method) + MAPPED_DATE_RANGE_METHODS[beginning_method] == end_method + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/file_path.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/file_path.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/file_path.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/file_path.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/find_by.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/find_by.rb similarity index 61% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/find_by.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/find_by.rb index aa58f63371..14a4bdd1b3 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/find_by.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/find_by.rb @@ -3,16 +3,27 @@ module RuboCop module Cop module Rails - # This cop is used to identify usages of `where.first` and - # change them to use `find_by` instead. + # This cop is used to identify usages of `where.take` and change them to use `find_by` instead. + # + # And `where(...).first` can return different results from `find_by`. + # (They order records differently, so the "first" record can be different.) + # + # If you also want to detect `where.first`, you can set `IgnoreWhereFirst` to false. # # @example # # bad - # User.where(name: 'Bruce').first # User.where(name: 'Bruce').take # # # good # User.find_by(name: 'Bruce') + # + # @example IgnoreWhereFirst: true (default) + # # good + # User.where(name: 'Bruce').first + # + # @example IgnoreWhereFirst: false + # # bad + # User.where(name: 'Bruce').first class FindBy < Base include RangeHelp extend AutoCorrector @@ -20,12 +31,8 @@ module RuboCop MSG = 'Use `find_by` instead of `where.%s`.' RESTRICT_ON_SEND = %i[first take].freeze - def_node_matcher :where_first?, <<~PATTERN - (send ({send csend} _ :where ...) {:first :take}) - PATTERN - def on_send(node) - return unless where_first?(node) + return if ignore_where_first? && node.method?(:first) range = range_between(node.receiver.loc.selector.begin_pos, node.loc.selector.end_pos) @@ -38,9 +45,6 @@ module RuboCop private def autocorrect(corrector, node) - # Don't autocorrect where(...).first, because it can return different - # results from find_by. (They order records differently, so the - # 'first' record can be different.) return if node.method?(:first) where_loc = node.receiver.loc.selector @@ -49,6 +53,10 @@ module RuboCop corrector.replace(where_loc, 'find_by') corrector.replace(first_loc, '') end + + def ignore_where_first? + cop_config.fetch('IgnoreWhereFirst', true) + end end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/find_by_id.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/find_by_id.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/find_by_id.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/find_each.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/find_each.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/find_each.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/find_each.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/has_and_belongs_to_many.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.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.11.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.10.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.11.0/lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.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.11.0/lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/helper_instance_variable.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/helper_instance_variable.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/helper_instance_variable.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/http_positional_arguments.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/http_positional_arguments.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/http_positional_arguments.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/http_positional_arguments.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/http_status.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/http_status.rb similarity index 89% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/http_status.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/http_status.rb index d24a1178fd..adc4047a8c 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/http_status.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/http_status.rb @@ -11,12 +11,14 @@ module RuboCop # render json: { foo: 'bar' }, status: 200 # render plain: 'foo/bar', status: 304 # redirect_to root_url, status: 301 + # head 200 # # # good # render :foo, status: :ok # render json: { foo: 'bar' }, status: :ok # render plain: 'foo/bar', status: :not_modified # redirect_to root_url, status: :moved_permanently + # head :ok # # @example EnforcedStyle: numeric # # bad @@ -24,23 +26,26 @@ module RuboCop # render json: { foo: 'bar' }, status: :not_found # render plain: 'foo/bar', status: :not_modified # redirect_to root_url, status: :moved_permanently + # head :ok # # # good # render :foo, status: 200 # render json: { foo: 'bar' }, status: 404 # render plain: 'foo/bar', status: 304 # redirect_to root_url, status: 301 + # head 200 # class HttpStatus < Base include ConfigurableEnforcedStyle extend AutoCorrector - RESTRICT_ON_SEND = %i[render redirect_to].freeze + RESTRICT_ON_SEND = %i[render redirect_to head].freeze def_node_matcher :http_status, <<~PATTERN { (send nil? {:render :redirect_to} _ $hash) (send nil? {:render :redirect_to} $hash) + (send nil? :head ${int sym} ...) } PATTERN @@ -49,8 +54,12 @@ module RuboCop PATTERN def on_send(node) - http_status(node) do |hash_node| - status = status_code(hash_node) + http_status(node) do |hash_node_or_status_code| + status = if hash_node_or_status_code.hash_type? + status_code(hash_node_or_status_code) + else + hash_node_or_status_code + end return unless status checker = checker_class.new(status) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/i18n_locale_assignment.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/i18n_locale_assignment.rb new file mode 100644 index 0000000000..6b3dfb9eaf --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/i18n_locale_assignment.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module Rails + # This cop checks for the use of `I18n.locale=` method. + # + # The `locale` attribute persists for the rest of the Ruby runtime, potentially causing + # unexpected behavior at a later time. + # Using `I18n.with_locale` ensures the code passed in the block is the only place `I18n.locale` is affected. + # It eliminates the possibility of a `locale` sticking around longer than intended. + # + # @example + # # bad + # I18n.locale = :fr + # + # # good + # I18n.with_locale(:fr) do + # end + # + class I18nLocaleAssignment < Base + MSG = 'Use `I18n.with_locale` with block instead of `I18n.locale=`.' + RESTRICT_ON_SEND = %i[locale=].freeze + + def_node_matcher :i18n_locale_assignment?, <<~PATTERN + (send (const {nil? cbase} :I18n) :locale= ...) + PATTERN + + def on_send(node) + return unless i18n_locale_assignment?(node) + + add_offense(node) + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/ignored_skip_action_filter_option.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.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.11.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.10.1/lib/rubocop/cop/rails/index_by.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/index_by.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/index_by.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/index_with.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/index_with.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/index_with.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/inquiry.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/inquiry.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/inquiry.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/inquiry.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/inverse_of.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/inverse_of.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/inverse_of.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/lexically_scoped_action_filter.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/lexically_scoped_action_filter.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/link_to_blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/link_to_blank.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/link_to_blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/link_to_blank.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/mailer_name.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/mailer_name.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/mailer_name.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/match_route.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/match_route.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/match_route.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/negate_include.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/negate_include.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/negate_include.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/not_null_column.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/not_null_column.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/not_null_column.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/order_by_id.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/order_by_id.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/order_by_id.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/output.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/output.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/output.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/output.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/output_safety.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/output_safety.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/output_safety.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/pick.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/pick.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/pick.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/pick.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/pluck.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/pluck.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/pluck.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/pluck.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/pluck_id.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/pluck_id.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/pluck_id.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/pluck_in_where.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/pluck_in_where.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/pluck_in_where.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/pluralization_grammar.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/pluralization_grammar.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/pluralization_grammar.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/presence.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/presence.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/presence.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/presence.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/present.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/present.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/present.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/present.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/rake_environment.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/rake_environment.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/rake_environment.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/read_write_attribute.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/read_write_attribute.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/read_write_attribute.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/redundant_allow_nil.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/redundant_allow_nil.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/redundant_allow_nil.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/redundant_foreign_key.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/redundant_foreign_key.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/redundant_foreign_key.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.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.11.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.10.1/lib/rubocop/cop/rails/reflection_class_name.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/reflection_class_name.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/reflection_class_name.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/reflection_class_name.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/refute_methods.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/refute_methods.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/refute_methods.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/relative_date_constant.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/relative_date_constant.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/relative_date_constant.rb index 6e00fe1fde..45beecf00f 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/relative_date_constant.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/relative_date_constant.rb @@ -33,16 +33,12 @@ module RuboCop 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 + RELATIVE_DATE_METHODS = %i[since from_now after ago until before yesterday tomorrow].to_set.freeze def on_casgn(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 + nested_relative_date(node) do |method_name| + add_offense(node, message: message(method_name)) do |corrector| + autocorrect(corrector, node) end end end @@ -55,7 +51,7 @@ module RuboCop lhs.children.zip(rhs.children).each do |(name, value)| next unless name.casgn_type? - relative_date?(value) do |method_name| + nested_relative_date(value) do |method_name| add_offense(offense_range(name, value), message: message(method_name)) do |corrector| autocorrect(corrector, node) end @@ -64,7 +60,7 @@ module RuboCop end def on_or_asgn(node) - relative_date_or_assignment?(node) do |method_name| + relative_date_or_assignment(node) do |method_name| add_offense(node, message: format(MSG, method_name: method_name)) end end @@ -93,20 +89,22 @@ module RuboCop range_between(name.loc.expression.begin_pos, value.loc.expression.end_pos) end - def relative_date_method?(method_name) - RELATIVE_DATE_METHODS.include?(method_name) + def nested_relative_date(node, &callback) + return if node.block_type? + + node.each_child_node do |child| + nested_relative_date(child, &callback) + end + + relative_date(node, &callback) end - def_node_matcher :relative_date_or_assignment?, <<~PATTERN - (:or_asgn (casgn _ _) (send _ $#relative_date_method?)) + def_node_matcher :relative_date_or_assignment, <<~PATTERN + (:or_asgn (casgn _ _) (send _ $RELATIVE_DATE_METHODS)) PATTERN - def_node_matcher :relative_date?, <<~PATTERN - { - ({erange irange} _ (send _ $#relative_date_method?)) - ({erange irange} (send _ $#relative_date_method?) _) - (send _ $#relative_date_method?) - } + def_node_matcher :relative_date, <<~PATTERN + (send _ $RELATIVE_DATE_METHODS) PATTERN end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/render_inline.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/render_inline.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/render_inline.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/render_plain_text.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/render_plain_text.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/render_plain_text.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/request_referer.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/request_referer.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/request_referer.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/require_dependency.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/require_dependency.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/require_dependency.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/require_dependency.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/reversible_migration.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/reversible_migration.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/reversible_migration.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/reversible_migration.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/reversible_migration_method_definition.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/reversible_migration_method_definition.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/reversible_migration_method_definition.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/reversible_migration_method_definition.rb index 4a2b90d1ba..29914b49d5 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/reversible_migration_method_definition.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/reversible_migration_method_definition.rb @@ -50,7 +50,7 @@ module RuboCop (class (const nil? _) (send - (const (const nil? :ActiveRecord) :Migration) + (const (const {nil? cbase} :ActiveRecord) :Migration) :[] (float _)) _) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/safe_navigation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/safe_navigation.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/safe_navigation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/safe_navigation.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/safe_navigation_with_blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/safe_navigation_with_blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/save_bang.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/save_bang.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/save_bang.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/scope_args.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/scope_args.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/scope_args.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/short_i18n.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/short_i18n.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/short_i18n.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/skips_model_validations.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/skips_model_validations.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/skips_model_validations.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/squished_sql_heredocs.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/squished_sql_heredocs.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/squished_sql_heredocs.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/time_zone.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/time_zone.rb similarity index 94% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/time_zone.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/time_zone.rb index 4182aa562d..90ef9d5ff9 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/time_zone.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/time_zone.rb @@ -8,41 +8,33 @@ module RuboCop # Built on top of Ruby on Rails style guide (https://rails.rubystyle.guide#time) # and the article http://danilenko.org/2012/7/6/rails_timezones/ # - # Two styles are supported for this cop. When EnforcedStyle is 'strict' - # then only use of Time.zone is allowed. + # Two styles are supported for this cop. When `EnforcedStyle` is 'strict' + # then only use of `Time.zone` is allowed. # # When EnforcedStyle is 'flexible' then it's also allowed - # to use Time.in_time_zone. + # to use `Time#in_time_zone`. + # + # @example + # # bad + # Time.now + # Time.parse('2015-03-02T19:05:37') + # + # # good + # Time.current + # Time.zone.now + # 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: strict # # `strict` means that `Time` should be used with `zone`. # # # bad - # Time.now - # Time.parse('2015-03-02T19:05:37') - # - # # bad - # Time.current # Time.at(timestamp).in_time_zone # - # # good - # Time.zone.now - # 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-02T19:05:37') - # # # good - # Time.zone.now - # Time.zone.parse('2015-03-02T19:05:37') - # - # # good - # Time.current # Time.at(timestamp).in_time_zone class TimeZone < Base include ConfigurableEnforcedStyle @@ -59,7 +51,7 @@ module RuboCop GOOD_METHODS = %i[zone zone_default find_zone find_zone!].freeze - DANGEROUS_METHODS = %i[now local new parse at current].freeze + DANGEROUS_METHODS = %i[now local new parse at].freeze ACCEPTED_METHODS = %i[in_time_zone utc getlocal xmlschema iso8601 jisx0301 rfc3339 httpdate to_i to_f].freeze diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/time_zone_assignment.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/time_zone_assignment.rb similarity index 78% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/time_zone_assignment.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/time_zone_assignment.rb index b3a78ef58c..d279d4565e 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/time_zone_assignment.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/time_zone_assignment.rb @@ -6,8 +6,8 @@ module RuboCop # 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. + # unexpected behavior at a later time. + # Using `Time.use_zone` ensures the code passed in the block is the only place Time.zone is affected. # It eliminates the possibility of a `zone` sticking around longer than intended. # # @example @@ -19,7 +19,7 @@ module RuboCop # end # class TimeZoneAssignment < Base - MSG = 'Use `Time.use_zone` with blocks instead of `Time.zone=`.' + MSG = 'Use `Time.use_zone` with block instead of `Time.zone=`.' RESTRICT_ON_SEND = %i[zone=].freeze def_node_matcher :time_zone_assignement?, <<~PATTERN diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/uniq_before_pluck.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/uniq_before_pluck.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/uniq_before_pluck.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/unique_validation_without_index.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/unique_validation_without_index.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/unknown_env.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/unknown_env.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/unknown_env.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/unknown_env.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/unused_ignored_columns.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/unused_ignored_columns.rb new file mode 100644 index 0000000000..5fa569b855 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/unused_ignored_columns.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module Rails + # This cop suggests you remove a column that does not exist in the schema from `ignored_columns`. + # `ignored_columns` is necessary to drop a column from RDBMS, but you don't need it after the migration + # to drop the column. You avoid forgetting to remove `ignored_columns` by this cop. + # + # @example + # # bad + # class User < ApplicationRecord + # self.ignored_columns = [:already_removed_column] + # end + # + # # good + # class User < ApplicationRecord + # self.ignored_columns = [:still_existing_column] + # end + # + class UnusedIgnoredColumns < Base + include ActiveRecordHelper + + MSG = 'Remove `%s` from `ignored_columns` because the column does not exist.' + RESTRICT_ON_SEND = %i[ignored_columns=].freeze + + def_node_matcher :ignored_columns, <<~PATTERN + (send self :ignored_columns= $array) + PATTERN + + def_node_matcher :column_name, <<~PATTERN + ({str sym} $_) + PATTERN + + def on_send(node) + return unless (columns = ignored_columns(node)) + return unless schema + + table = table(node) + return unless table + + columns.children.each do |column_node| + check_column_existence(column_node, table) + end + end + + private + + def check_column_existence(column_node, table) + column_name = column_name(column_node) + return unless column_name + return if table.with_column?(name: column_name.to_s) + + message = format(MSG, column_name: column_name) + add_offense(column_node, message: message) + end + + def class_node(node) + node.each_ancestor.find(&:class_type?) + end + + def table(node) + klass = class_node(node) + schema.table_by(name: table_name(klass)) + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/validation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/validation.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/validation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/validation.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/where_equals.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1/lib/rubocop/cop/rails/where_equals.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/where_equals.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/where_exists.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/where_exists.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/where_exists.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/where_exists.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/where_not.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/where_not.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails/where_not.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails/where_not.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails_cops.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails_cops.rb similarity index 94% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails_cops.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails_cops.rb index 5c07a66421..f86c3b1818 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/cop/rails_cops.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/cop/rails_cops.rb @@ -10,6 +10,7 @@ require_relative 'rails/active_record_aliases' require_relative 'rails/active_record_callbacks_order' require_relative 'rails/active_record_override' require_relative 'rails/active_support_aliases' +require_relative 'rails/add_column_index' require_relative 'rails/after_commit_override' require_relative 'rails/application_controller' require_relative 'rails/application_job' @@ -28,11 +29,13 @@ require_relative 'rails/default_scope' require_relative 'rails/delegate' require_relative 'rails/delegate_allow_blank' require_relative 'rails/dynamic_find_by' +require_relative 'rails/eager_evaluation_log_message' 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/expanded_date_range' require_relative 'rails/file_path' require_relative 'rails/find_by' require_relative 'rails/find_by_id' @@ -42,6 +45,7 @@ require_relative 'rails/has_many_or_has_one_dependent' require_relative 'rails/helper_instance_variable' require_relative 'rails/http_positional_arguments' require_relative 'rails/http_status' +require_relative 'rails/i18n_locale_assignment' require_relative 'rails/ignored_skip_action_filter_option' require_relative 'rails/index_by' require_relative 'rails/index_with' @@ -89,6 +93,7 @@ require_relative 'rails/time_zone_assignment' require_relative 'rails/uniq_before_pluck' require_relative 'rails/unique_validation_without_index' require_relative 'rails/unknown_env' +require_relative 'rails/unused_ignored_columns' require_relative 'rails/validation' require_relative 'rails/where_equals' require_relative 'rails/where_exists' diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/rails.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/rails.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/rails.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/rails.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/rails/inject.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/rails/inject.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/rails/inject.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/rails/inject.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/rails/schema_loader.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/rails/schema_loader.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/rails/schema_loader.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/rails/schema_loader.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/rails/schema_loader/schema.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/rails/schema_loader/schema.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/rails/schema_loader/schema.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/rails/schema_loader/schema.rb index c641a0ebd8..8c9b62022f 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/rails/schema_loader/schema.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/rails/schema_loader/schema.rb @@ -114,7 +114,7 @@ module RuboCop attr_reader :name, :type, :not_null def initialize(node) - @name = node.first_argument.value + @name = node.first_argument.str_content @type = node.method_name @not_null = nil diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/rails/version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/rails/version.rb similarity index 90% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/rails/version.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.0/lib/rubocop/rails/version.rb index 495e12daad..76f6391b00 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.10.1/lib/rubocop/rails/version.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.11.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.10.1' + STRING = '2.11.0' def self.document_version STRING.match('\d+\.\d+').to_s