From 3c6c52e16b79b03c51de7c42b744a838177157a5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Apr 2023 19:00:59 +0000 Subject: [PATCH 1/4] build(deps): bump rubocop-rails in /Library/Homebrew Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.18.0 to 2.19.0. - [Release notes](https://github.com/rubocop/rubocop-rails/releases) - [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.18.0...v2.19.0) --- updated-dependencies: - dependency-name: rubocop-rails dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Library/Homebrew/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index e7e42c144d..db4ed4e236 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -147,7 +147,7 @@ GEM rubocop-performance (1.16.0) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - rubocop-rails (2.18.0) + rubocop-rails (2.19.0) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) From da5d843f418c05496fe618c018593051cd84eba6 Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Fri, 7 Apr 2023 19:05:19 +0000 Subject: [PATCH 2/4] brew vendor-gems: commit updates. --- .../Homebrew/vendor/bundle/bundler/setup.rb | 2 +- .../config/default.yml | 25 ++++--- .../config/obsoletion.yml | 0 .../lib/rubocop-rails.rb | 1 + .../rubocop/cop/mixin/active_record_helper.rb | 0 .../mixin/active_record_migrations_helper.rb | 0 .../cop/mixin/class_send_node_helper.rb | 0 .../rubocop/cop/mixin/enforce_superclass.rb | 2 +- .../lib/rubocop/cop/mixin/index_method.rb | 6 +- .../rubocop/cop/mixin/migrations_helper.rb | 0 .../rubocop/cop/mixin/target_rails_version.rb | 0 .../action_controller_flash_before_render.rb | 0 .../cop/rails/action_controller_test_case.rb | 0 .../lib/rubocop/cop/rails/action_filter.rb | 0 .../lib/rubocop/cop/rails/action_order.rb | 11 ++- .../cop/rails/active_record_aliases.rb | 0 .../rails/active_record_callbacks_order.rb | 9 ++- .../cop/rails/active_record_override.rb | 0 .../cop/rails/active_support_aliases.rb | 0 .../cop/rails/active_support_on_load.rb | 0 .../lib/rubocop/cop/rails/add_column_index.rb | 4 +- .../cop/rails/after_commit_override.rb | 0 .../cop/rails/application_controller.rb | 0 .../lib/rubocop/cop/rails/application_job.rb | 2 +- .../rubocop/cop/rails/application_mailer.rb | 0 .../rubocop/cop/rails/application_record.rb | 0 .../lib/rubocop/cop/rails/arel_star.rb | 2 +- .../lib/rubocop/cop/rails/assert_not.rb | 2 +- .../rails/attribute_default_block_value.rb | 0 .../lib/rubocop/cop/rails/belongs_to.rb | 2 +- .../lib/rubocop/cop/rails/blank.rb | 8 +-- .../rubocop/cop/rails/bulk_change_table.rb | 0 .../lib/rubocop/cop/rails/compact_blank.rb | 4 +- .../lib/rubocop/cop/rails/content_tag.rb | 2 +- .../cop/rails/create_table_with_timestamps.rb | 19 ++++- .../lib/rubocop/cop/rails/date.rb | 0 .../lib/rubocop/cop/rails/default_scope.rb | 0 .../lib/rubocop/cop/rails/delegate.rb | 20 +++++- .../rubocop/cop/rails/delegate_allow_blank.rb | 2 +- .../deprecated_active_model_errors_methods.rb | 0 .../rubocop/cop/rails/dot_separated_keys.rb | 0 .../cop/rails/duplicate_association.rb | 0 .../lib/rubocop/cop/rails/duplicate_scope.rb | 0 .../rubocop/cop/rails/duration_arithmetic.rb | 2 +- .../lib/rubocop/cop/rails/dynamic_find_by.rb | 2 +- .../cop/rails/eager_evaluation_log_message.rb | 2 +- .../lib/rubocop/cop/rails/enum_hash.rb | 2 +- .../lib/rubocop/cop/rails/enum_uniqueness.rb | 0 .../cop/rails/environment_comparison.rb | 2 +- .../cop/rails/environment_variable_access.rb | 0 .../lib/rubocop/cop/rails/exit.rb | 0 .../rubocop/cop/rails/expanded_date_range.rb | 0 .../lib/rubocop/cop/rails/file_path.rb | 46 ++++++++---- .../lib/rubocop/cop/rails/find_by.rb | 0 .../lib/rubocop/cop/rails/find_by_id.rb | 4 +- .../lib/rubocop/cop/rails/find_each.rb | 8 ++- .../lib/rubocop/cop/rails/freeze_time.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 | 20 +++++- .../lib/rubocop/cop/rails/http_status.rb | 2 +- .../lib/rubocop/cop/rails/i18n_lazy_lookup.rb | 0 .../cop/rails/i18n_locale_assignment.rb | 0 .../rubocop/cop/rails/i18n_locale_texts.rb | 0 .../cop/rails/ignored_columns_assignment.rb | 0 .../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 | 2 +- .../lib/rubocop/cop/rails/mailer_name.rb | 2 +- .../lib/rubocop/cop/rails/match_route.rb | 0 .../rubocop/cop/rails/migration_class_name.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 | 5 +- .../lib/rubocop/cop/rails/output_safety.rb | 6 +- .../lib/rubocop/cop/rails/pick.rb | 0 .../lib/rubocop/cop/rails/pluck.rb | 2 +- .../lib/rubocop/cop/rails/pluck_id.rb | 2 +- .../lib/rubocop/cop/rails/pluck_in_where.rb | 0 .../cop/rails/pluralization_grammar.rb | 0 .../lib/rubocop/cop/rails/presence.rb | 2 +- .../lib/rubocop/cop/rails/present.rb | 8 +-- .../lib/rubocop/cop/rails/rake_environment.rb | 2 +- .../rubocop/cop/rails/read_write_attribute.rb | 2 +- .../rubocop/cop/rails/redundant_allow_nil.rb | 6 +- .../cop/rails/redundant_foreign_key.rb | 2 +- ...ndant_presence_validation_on_belongs_to.rb | 0 .../redundant_receiver_in_with_options.rb | 2 +- .../cop/rails/redundant_travel_back.rb | 0 .../cop/rails/reflection_class_name.rb | 18 ++++- .../lib/rubocop/cop/rails/refute_methods.rb | 0 .../cop/rails/relative_date_constant.rb | 4 +- .../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/response_parsed_body.rb | 6 +- .../rubocop/cop/rails/reversible_migration.rb | 0 .../reversible_migration_method_definition.rb | 0 .../lib/rubocop/cop/rails/root_join_chain.rb | 2 +- .../cop/rails/root_pathname_methods.rb | 2 +- .../lib/rubocop/cop/rails/root_public_path.rb | 0 .../lib/rubocop/cop/rails/safe_navigation.rb | 2 +- .../cop/rails/safe_navigation_with_blank.rb | 0 .../lib/rubocop/cop/rails/save_bang.rb | 0 .../lib/rubocop/cop/rails/schema_comment.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/strip_heredoc.rb | 0 .../cop/rails/table_name_assignment.rb | 0 .../cop/rails/three_state_boolean_column.rb | 71 +++++++++++++++++++ .../lib/rubocop/cop/rails/time_zone.rb | 4 +- .../rubocop/cop/rails/time_zone_assignment.rb | 0 .../lib/rubocop/cop/rails/to_formatted_s.rb | 0 .../rubocop/cop/rails/to_s_with_argument.rb | 0 .../top_level_hash_with_indifferent_access.rb | 0 .../cop/rails/transaction_exit_statement.rb | 0 .../rubocop/cop/rails/uniq_before_pluck.rb | 0 .../rails/unique_validation_without_index.rb | 2 +- .../lib/rubocop/cop/rails/unknown_env.rb | 0 .../cop/rails/unused_ignored_columns.rb | 0 .../lib/rubocop/cop/rails/validation.rb | 2 +- .../lib/rubocop/cop/rails/where_equals.rb | 2 +- .../lib/rubocop/cop/rails/where_exists.rb | 2 +- .../lib/rubocop/cop/rails/where_missing.rb | 6 +- .../lib/rubocop/cop/rails/where_not.rb | 2 +- .../where_not_with_multiple_conditions.rb | 4 +- .../lib/rubocop/cop/rails_cops.rb | 1 + .../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 | 0 .../lib/rubocop/rails/version.rb | 2 +- 141 files changed, 273 insertions(+), 115 deletions(-) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/config/default.yml (98%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/config/obsoletion.yml (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop-rails.rb (94%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/mixin/active_record_helper.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/mixin/active_record_migrations_helper.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/mixin/class_send_node_helper.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/mixin/enforce_superclass.rb (92%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/mixin/index_method.rb (95%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/mixin/migrations_helper.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/mixin/target_rails_version.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/action_controller_flash_before_render.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/action_controller_test_case.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/action_filter.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/action_order.rb (88%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/active_record_aliases.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/active_record_callbacks_order.rb (89%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/active_record_override.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/active_support_aliases.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/active_support_on_load.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/add_column_index.rb (92%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/after_commit_override.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/application_controller.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/application_job.rb (93%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/application_mailer.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/application_record.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/arel_star.rb (95%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/assert_not.rb (95%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/attribute_default_block_value.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/belongs_to.rb (97%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/blank.rb (95%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/bulk_change_table.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/compact_blank.rb (97%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/content_tag.rb (97%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/create_table_with_timestamps.rb (80%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/date.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/default_scope.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/delegate.rb (86%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/delegate_allow_blank.rb (92%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/deprecated_active_model_errors_methods.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/dot_separated_keys.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/duplicate_association.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/duplicate_scope.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/duration_arithmetic.rb (97%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/dynamic_find_by.rb (98%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/eager_evaluation_log_message.rb (98%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/enum_hash.rb (96%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/enum_uniqueness.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/environment_comparison.rb (98%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/environment_variable_access.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/exit.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/expanded_date_range.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/file_path.rb (73%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/find_by.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/find_by_id.rb (93%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/find_each.rb (84%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/freeze_time.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.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.18.0 => rubocop-rails-2.19.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.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/helper_instance_variable.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/http_positional_arguments.rb (86%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/http_status.rb (98%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/i18n_lazy_lookup.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/i18n_locale_assignment.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/i18n_locale_texts.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/ignored_columns_assignment.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.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.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/index_by.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/index_with.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/inquiry.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/inverse_of.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/lexically_scoped_action_filter.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/link_to_blank.rb (97%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/mailer_name.rb (97%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/match_route.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/migration_class_name.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/negate_include.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/not_null_column.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/order_by_id.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/output.rb (90%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/output_safety.rb (93%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/pick.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/pluck.rb (97%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/pluck_id.rb (94%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/pluck_in_where.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/pluralization_grammar.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/presence.rb (97%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/present.rb (95%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/rake_environment.rb (97%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/read_write_attribute.rb (97%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/redundant_allow_nil.rb (95%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/redundant_foreign_key.rb (96%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb (98%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/redundant_travel_back.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/reflection_class_name.rb (78%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/refute_methods.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/relative_date_constant.rb (95%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/render_inline.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/render_plain_text.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/request_referer.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/require_dependency.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/response_parsed_body.rb (78%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/reversible_migration.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/reversible_migration_method_definition.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/root_join_chain.rb (98%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/root_pathname_methods.rb (98%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/root_public_path.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/safe_navigation.rb (96%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/safe_navigation_with_blank.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/save_bang.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/schema_comment.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/scope_args.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/short_i18n.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/skips_model_validations.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/squished_sql_heredocs.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/strip_heredoc.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/table_name_assignment.rb (100%) create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/three_state_boolean_column.rb rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/time_zone.rb (98%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/time_zone_assignment.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/to_formatted_s.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/to_s_with_argument.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/top_level_hash_with_indifferent_access.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/transaction_exit_statement.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/uniq_before_pluck.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/unique_validation_without_index.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/unknown_env.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/unused_ignored_columns.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/validation.rb (97%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/where_equals.rb (97%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/where_exists.rb (98%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/where_missing.rb (94%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/where_not.rb (97%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails/where_not_with_multiple_conditions.rb (96%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/cop/rails_cops.rb (99%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/rails.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/rails/inject.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/rails/schema_loader.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.0}/lib/rubocop/rails/schema_loader/schema.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.18.0 => rubocop-rails-2.19.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 c24ec0100a..9f4bcce5c5 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -106,7 +106,7 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-1.48.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-capybara-2.17.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-performance-1.16.0/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-rails-2.18.0/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-rails-2.19.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-rspec-2.19.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-sorbet-0.7.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ruby-macho-3.0.0/lib") diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/config/default.yml b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/config/default.yml similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/config/default.yml rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/config/default.yml index 1e609a14f3..5fe5788785 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/config/default.yml +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/config/default.yml @@ -53,8 +53,6 @@ Rails: Rails/ActionControllerFlashBeforeRender: Description: 'Use `flash.now` instead of `flash` before `render`.' - StyleGuide: 'https://rails.rubystyle.guide/#flash-before-render' - Reference: 'https://api.rubyonrails.org/classes/ActionController/FlashBeforeRender.html' Enabled: 'pending' SafeAutoCorrect: false VersionAdded: '2.16' @@ -462,8 +460,9 @@ Rails/FindEach: Description: 'Prefer all.find_each over all.each.' StyleGuide: 'https://rails.rubystyle.guide#find-each' Enabled: true + Safe: false VersionAdded: '0.30' - VersionChanged: '2.9' + VersionChanged: '2.19' Include: - app/models/**/*.rb AllowedMethods: @@ -844,8 +843,9 @@ Rails/RequireDependency: Rails/ResponseParsedBody: Description: Prefer `response.parsed_body` to `JSON.parse(response.body)`. Enabled: pending - SafeAutoCorrect: false + Safe: false VersionAdded: '2.18' + VersionChanged: '2.19' Include: - spec/controllers/**/*.rb - spec/requests/**/*.rb @@ -997,6 +997,14 @@ Rails/TableNameAssignment: Include: - app/models/**/*.rb +Rails/ThreeStateBooleanColumn: + Description: 'Add a default value and a `NOT NULL` constraint to boolean columns.' + StyleGuide: 'https://rails.rubystyle.guide/#three-state-boolean' + Enabled: pending + VersionAdded: '2.19' + Include: + - db/**/*.rb + Rails/TimeZone: Description: 'Checks the correct usage of time zone aware methods.' StyleGuide: 'https://rails.rubystyle.guide#time' @@ -1144,15 +1152,6 @@ Style/FormatStringToken: AllowedMethods: - redirect -Style/InverseMethods: - # `InverseMethods` are methods that can be inverted by a not (`not` or `!`) - # The relationship of inverse methods only needs to be defined in one direction. - # Keys and values both need to be defined as symbols. - InverseMethods: - :present?: :blank? - :include?: :exclude? - :valid?: :invalid? - Style/SymbolProc: AllowedMethods: - define_method diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/config/obsoletion.yml b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/config/obsoletion.yml similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/config/obsoletion.yml rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/config/obsoletion.yml diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop-rails.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop-rails.rb similarity index 94% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop-rails.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop-rails.rb index e505cdac14..bda8121ed7 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop-rails.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop-rails.rb @@ -3,6 +3,7 @@ require 'rubocop' require 'rack/utils' require 'active_support/inflector' +require 'active_support/core_ext/object/blank' require_relative 'rubocop/rails' require_relative 'rubocop/rails/version' diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/mixin/active_record_helper.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/mixin/active_record_helper.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/active_record_helper.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/mixin/active_record_migrations_helper.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/active_record_migrations_helper.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/mixin/active_record_migrations_helper.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/active_record_migrations_helper.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/mixin/class_send_node_helper.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/class_send_node_helper.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/mixin/class_send_node_helper.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/class_send_node_helper.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/mixin/enforce_superclass.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/enforce_superclass.rb similarity index 92% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/mixin/enforce_superclass.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/enforce_superclass.rb index b534f37dc7..59f9763a60 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/mixin/enforce_superclass.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/enforce_superclass.rb @@ -32,7 +32,7 @@ module RuboCop def register_offense(offense_node) add_offense(offense_node) do |corrector| - corrector.replace(offense_node.source_range, self.class::SUPERCLASS) + corrector.replace(offense_node, self.class::SUPERCLASS) end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/mixin/index_method.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/index_method.rb similarity index 95% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/mixin/index_method.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/index_method.rb index d00edb6619..23ba0daae5 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/mixin/index_method.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/index_method.rb @@ -138,7 +138,7 @@ module RuboCop end def strip_prefix_and_suffix(node, corrector) - expression = node.loc.expression + expression = node.source_range corrector.remove_leading(expression, leading) corrector.remove_trailing(expression, trailing) end @@ -153,11 +153,11 @@ module RuboCop end def set_new_arg_name(transformed_argname, corrector) - corrector.replace(block_node.arguments.loc.expression, "|#{transformed_argname}|") + corrector.replace(block_node.arguments, "|#{transformed_argname}|") end def set_new_body_expression(transforming_body_expr, corrector) - corrector.replace(block_node.body.loc.expression, transforming_body_expr.loc.expression.source) + corrector.replace(block_node.body, transforming_body_expr.source) end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/mixin/migrations_helper.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/migrations_helper.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/mixin/migrations_helper.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/migrations_helper.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/mixin/target_rails_version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/mixin/target_rails_version.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/target_rails_version.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/action_controller_flash_before_render.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/action_controller_flash_before_render.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/action_controller_flash_before_render.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/action_controller_flash_before_render.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/action_controller_test_case.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/action_controller_test_case.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/action_controller_test_case.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/action_controller_test_case.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/action_filter.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/action_filter.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/action_filter.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/action_order.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/action_order.rb similarity index 88% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/action_order.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/action_order.rb index 99fa9071db..a2bcd3b462 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/action_order.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/action_order.rb @@ -92,12 +92,11 @@ module RuboCop end def range_with_comments(node) - ranges = [ - node, - *processed_source.ast_with_comments[node] - ].map do |element| - element.location.expression - end + # rubocop:todo InternalAffairs/LocationExpression + # Using `RuboCop::Ext::Comment#source_range` requires RuboCop > 1.46, + # which introduces https://github.com/rubocop/rubocop/pull/11630. + ranges = [node, *processed_source.ast_with_comments[node]].map { |comment| comment.loc.expression } + # rubocop:enable InternalAffairs/LocationExpression ranges.reduce do |result, range| add_range(result, range) end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/active_record_aliases.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/active_record_aliases.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/active_record_aliases.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/active_record_callbacks_order.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/active_record_callbacks_order.rb similarity index 89% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/active_record_callbacks_order.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/active_record_callbacks_order.rb index 734f117347..8742e76338 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/active_record_callbacks_order.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/active_record_callbacks_order.rb @@ -104,7 +104,7 @@ module RuboCop end def end_position_for(node) - end_line = buffer.line_for_position(node.loc.expression.end_pos) + end_line = buffer.line_for_position(node.source_range.end_pos) buffer.line_range(end_line).end_pos end @@ -112,8 +112,7 @@ module RuboCop annotation_line = node.first_line - 1 first_comment = nil - processed_source.comments_before_line(annotation_line) - .reverse_each do |comment| + processed_source.each_comment_in_lines(0..annotation_line).reverse_each do |comment| if comment.location.line == annotation_line && !inline_comment?(comment) first_comment = comment annotation_line -= 1 @@ -124,7 +123,11 @@ module RuboCop end def inline_comment?(comment) + # rubocop:todo InternalAffairs/LocationExpression + # Using `RuboCop::Ext::Comment#source_range` requires RuboCop > 1.46, + # which introduces https://github.com/rubocop/rubocop/pull/11630. !comment_line?(comment.loc.expression.source_line) + # rubocop:enable InternalAffairs/LocationExpression end def start_line_position(node) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/active_record_override.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/active_record_override.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/active_record_override.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/active_support_aliases.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/active_support_aliases.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/active_support_aliases.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/active_support_on_load.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/active_support_on_load.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/active_support_on_load.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/active_support_on_load.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/add_column_index.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/add_column_index.rb similarity index 92% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/add_column_index.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/add_column_index.rb index 96cf6174d1..6f58055695 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/add_column_index.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/add_column_index.rb @@ -42,7 +42,7 @@ module RuboCop add_index_opts = '' if value.hash_type? - hash = value.loc.expression.adjust(begin_pos: 1, end_pos: -1).source.strip + hash = value.source_range.adjust(begin_pos: 1, end_pos: -1).source.strip add_index_opts = ", #{hash}" end @@ -53,7 +53,7 @@ module RuboCop private def index_range(pair_node) - range_with_surrounding_comma(range_with_surrounding_space(pair_node.loc.expression, side: :left), :left) + range_with_surrounding_comma(range_with_surrounding_space(pair_node.source_range, side: :left), :left) end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/after_commit_override.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/after_commit_override.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/after_commit_override.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/application_controller.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/application_controller.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/application_controller.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/application_job.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/application_job.rb similarity index 93% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/application_job.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/application_job.rb index 6d55d9786a..b8d55cb419 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/application_job.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/application_job.rb @@ -36,7 +36,7 @@ module RuboCop def autocorrect(node) lambda do |corrector| - corrector.replace(node.source_range, self.class::SUPERCLASS) + corrector.replace(node, self.class::SUPERCLASS) end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/application_mailer.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/application_mailer.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/application_mailer.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/application_record.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/application_record.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/application_record.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/arel_star.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/arel_star.rb similarity index 95% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/arel_star.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/arel_star.rb index 77e5441a9a..74f43f9da3 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/arel_star.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/arel_star.rb @@ -38,7 +38,7 @@ module RuboCop return unless (star = star_bracket?(node)) add_offense(star) do |corrector| - corrector.replace(star.loc.expression, 'Arel.star') + corrector.replace(star, 'Arel.star') end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/assert_not.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/assert_not.rb similarity index 95% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/assert_not.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/assert_not.rb index 5acc24416e..9610264927 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/assert_not.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/assert_not.rb @@ -25,7 +25,7 @@ module RuboCop return unless offensive?(node) add_offense(node) do |corrector| - expression = node.loc.expression + expression = node.source_range corrector.replace(expression, corrected_source(expression.source)) end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/attribute_default_block_value.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/attribute_default_block_value.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/belongs_to.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/belongs_to.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/belongs_to.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/belongs_to.rb index ad315131e8..055569ae78 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/belongs_to.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/belongs_to.rb @@ -80,7 +80,7 @@ module RuboCop end add_offense(node.loc.selector, message: message) do |corrector| - corrector.replace(option_node.loc.expression, replacement) + corrector.replace(option_node, replacement) end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/blank.rb similarity index 95% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/blank.rb index e5d0232821..1f30fd7425 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/blank.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/blank.rb @@ -142,10 +142,10 @@ module RuboCop if method_call corrector.replace(node.loc.keyword, 'if') - range = method_call.loc.expression + range = method_call.source_range else variable1, _variable2 = nil_or_empty?(node) || not_present?(node) - range = node.loc.expression + range = node.source_range end corrector.replace(range, replacement(variable1)) @@ -153,9 +153,9 @@ module RuboCop def unless_condition(node, method_call) if node.modifier_form? - node.loc.keyword.join(node.loc.expression.end) + node.loc.keyword.join(node.source_range.end) else - node.loc.expression.begin.join(method_call.loc.expression) + node.source_range.begin.join(method_call.source_range) end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/bulk_change_table.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/bulk_change_table.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/bulk_change_table.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/compact_blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/compact_blank.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/compact_blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/compact_blank.rb index fe5e88448f..5ba028d55c 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/compact_blank.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/compact_blank.rb @@ -94,9 +94,9 @@ module RuboCop def offense_range(node) end_pos = if node.parent&.block_type? && node.parent&.send_node == node - node.parent.loc.expression.end_pos + node.parent.source_range.end_pos else - node.loc.expression.end_pos + node.source_range.end_pos end range_between(node.loc.selector.begin_pos, end_pos) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/content_tag.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/content_tag.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/content_tag.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/content_tag.rb index b93269b6ad..2ae4afe085 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/content_tag.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/content_tag.rb @@ -85,7 +85,7 @@ module RuboCop end def correction_range(node) - range_between(node.loc.selector.begin_pos, node.loc.expression.end_pos) + range_between(node.loc.selector.begin_pos, node.source_range.end_pos) end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/create_table_with_timestamps.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/create_table_with_timestamps.rb similarity index 80% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/create_table_with_timestamps.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/create_table_with_timestamps.rb index 6b676436b6..03ce7f54ff 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/create_table_with_timestamps.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/create_table_with_timestamps.rb @@ -3,10 +3,12 @@ module RuboCop module Cop module Rails - # Checks the migration for which timestamps are not included - # when creating a new table. + # Checks the migration for which timestamps are not included when creating a new table. # In many cases, timestamps are useful information and should be added. # + # NOTE: Allow `timestamps` not written when `id: false` because this emphasizes respecting + # user's editing intentions. + # # @example # # bad # create_table :users @@ -40,12 +42,23 @@ module RuboCop # # t.datetime :updated_at, default: -> { 'CURRENT_TIMESTAMP' } # end + # + # # good + # create_table :users, articles, id: false do |t| + # t.integer :user_id + # t.integer :article_id + # end + # class CreateTableWithTimestamps < Base include ActiveRecordMigrationsHelper MSG = 'Add timestamps when creating a new table.' RESTRICT_ON_SEND = %i[create_table].freeze + def_node_search :use_id_false_option?, <<~PATTERN + (pair (sym :id) (false)) + PATTERN + def_node_matcher :create_table_with_timestamps_proc?, <<~PATTERN (send nil? :create_table (sym _) ... (block-pass (sym :timestamps))) PATTERN @@ -61,7 +74,7 @@ module RuboCop PATTERN def on_send(node) - return unless node.command?(:create_table) + return if !node.command?(:create_table) || use_id_false_option?(node) parent = node.parent diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/date.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/date.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/date.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/date.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/default_scope.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/default_scope.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/default_scope.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/delegate.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/delegate.rb similarity index 86% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/delegate.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/delegate.rb index 2f1c80662b..a50f5d3e84 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/delegate.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/delegate.rb @@ -24,6 +24,14 @@ module RuboCop # # good # delegate :bar, to: :foo # + # # bad + # def bar + # self.bar + # end + # + # # good + # delegate :bar, to: :self + # # # good # def bar # foo&.bar @@ -60,7 +68,7 @@ module RuboCop def_node_matcher :delegate?, <<~PATTERN (def _method_name _args - (send (send nil? _) _ ...)) + (send {(send nil? _) (self)} _ ...)) PATTERN def on_def(node) @@ -74,10 +82,14 @@ module RuboCop def register_offense(node) add_offense(node.loc.keyword) do |corrector| - delegation = ["delegate :#{node.body.method_name}", "to: :#{node.body.receiver.method_name}"] + body = node.body + + receiver = body.receiver.self_type? ? 'self' : ":#{body.receiver.method_name}" + + delegation = ["delegate :#{body.method_name}", "to: #{receiver}"] delegation << ['prefix: true'] if node.method?(prefixed_method_name(node.body)) - corrector.replace(node.source_range, delegation.join(', ')) + corrector.replace(node, delegation.join(', ')) end end @@ -106,6 +118,8 @@ module RuboCop end def prefixed_method_name(body) + return '' if body.receiver.self_type? + [body.receiver.method_name, body.method_name].join('_').to_sym end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/delegate_allow_blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/delegate_allow_blank.rb similarity index 92% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/delegate_allow_blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/delegate_allow_blank.rb index a3eb325a3c..1d9869c50a 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/delegate_allow_blank.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/delegate_allow_blank.rb @@ -27,7 +27,7 @@ module RuboCop return unless (offending_node = allow_blank_option(node)) add_offense(offending_node) do |corrector| - corrector.replace(offending_node.key.source_range, 'allow_nil') + corrector.replace(offending_node.key, 'allow_nil') end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/deprecated_active_model_errors_methods.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/deprecated_active_model_errors_methods.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/deprecated_active_model_errors_methods.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/deprecated_active_model_errors_methods.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/dot_separated_keys.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/dot_separated_keys.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/dot_separated_keys.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/dot_separated_keys.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/duplicate_association.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/duplicate_association.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/duplicate_association.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/duplicate_association.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/duplicate_scope.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/duplicate_scope.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/duplicate_scope.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/duplicate_scope.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/duration_arithmetic.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/duration_arithmetic.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/duration_arithmetic.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/duration_arithmetic.rb index ddaf0fac55..90cbd4501d 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/duration_arithmetic.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/duration_arithmetic.rb @@ -78,7 +78,7 @@ module RuboCop def on_send(node) duration_arithmetic_argument?(node) do |*operation| add_offense(node) do |corrector| - corrector.replace(node.source_range, corrected_source(*operation)) + corrector.replace(node, corrected_source(*operation)) end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/dynamic_find_by.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/dynamic_find_by.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/dynamic_find_by.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/dynamic_find_by.rb index 027bb32fd6..b669b94c7f 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/dynamic_find_by.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/dynamic_find_by.rb @@ -99,7 +99,7 @@ module RuboCop def autocorrect_argument_keywords(corrector, node, keywords) keywords.each.with_index do |keyword, idx| - corrector.insert_before(node.arguments[idx].loc.expression, keyword) + corrector.insert_before(node.arguments[idx], keyword) end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/eager_evaluation_log_message.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/eager_evaluation_log_message.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/eager_evaluation_log_message.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/eager_evaluation_log_message.rb index 72d686d68c..8fc230121f 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/eager_evaluation_log_message.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/eager_evaluation_log_message.rb @@ -59,7 +59,7 @@ module RuboCop private def replacement_range(node) - stop = node.loc.expression.end + stop = node.source_range.end start = node.loc.selector.end if node.parenthesized_call? diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/enum_hash.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/enum_hash.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/enum_hash.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/enum_hash.rb index 04d4a86d4e..2b69e2e2ee 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/enum_hash.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/enum_hash.rb @@ -42,7 +42,7 @@ module RuboCop "#{source(elem)} => #{index}" end.join(', ') - corrector.replace(array.loc.expression, "{#{hash}}") + corrector.replace(array, "{#{hash}}") end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/enum_uniqueness.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/enum_uniqueness.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/enum_uniqueness.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/environment_comparison.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/environment_comparison.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/environment_comparison.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/environment_comparison.rb index 1e1c5261aa..456bc85dde 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/environment_comparison.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/environment_comparison.rb @@ -84,7 +84,7 @@ module RuboCop def autocorrect(corrector, node) replacement = build_predicate_method(node) - corrector.replace(node.source_range, replacement) + corrector.replace(node, replacement) end def build_predicate_method(node) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/environment_variable_access.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/environment_variable_access.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/environment_variable_access.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/exit.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/exit.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/exit.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/exit.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/expanded_date_range.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/expanded_date_range.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/expanded_date_range.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/expanded_date_range.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/file_path.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/file_path.rb similarity index 73% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/file_path.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/file_path.rb index 8afb72dbdb..74595992ef 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/file_path.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/file_path.rb @@ -3,34 +3,43 @@ module RuboCop module Cop module Rails - # Identifies usages of file path joining process - # to use `Rails.root.join` clause. It is used to add uniformity when - # joining paths. + # Identifies usages of file path joining process to use `Rails.root.join` clause. + # It is used to add uniformity when joining paths. # # @example EnforcedStyle: slashes (default) # # bad # Rails.root.join('app', 'models', 'goober') + # + # # good + # Rails.root.join('app/models/goober') + # + # # bad # File.join(Rails.root, 'app/models/goober') # "#{Rails.root}/app/models/goober" # # # good - # Rails.root.join('app/models/goober') + # Rails.root.join('app/models/goober').to_s # # @example EnforcedStyle: arguments # # bad # Rails.root.join('app/models/goober') + # + # # good + # Rails.root.join('app', 'models', 'goober') + # + # # bad # File.join(Rails.root, 'app/models/goober') # "#{Rails.root}/app/models/goober" # # # good - # Rails.root.join('app', 'models', 'goober') + # Rails.root.join('app', 'models', 'goober').to_s # class FilePath < Base include ConfigurableEnforcedStyle include RangeHelp - MSG_SLASHES = 'Prefer `Rails.root.join(\'path/to\')`.' - MSG_ARGUMENTS = 'Prefer `Rails.root.join(\'path\', \'to\')`.' + MSG_SLASHES = 'Prefer `Rails.root.join(\'path/to\')%s`.' + MSG_ARGUMENTS = 'Prefer `Rails.root.join(\'path\', \'to\')%s`.' RESTRICT_ON_SEND = %i[join].freeze def_node_matcher :file_join_nodes?, <<~PATTERN @@ -53,7 +62,7 @@ module RuboCop return unless last_child_source.start_with?('.') || last_child_source.include?(File::SEPARATOR) return if last_child_source.start_with?(':') - register_offense(node) + register_offense(node, require_to_s: true) end def on_send(node) @@ -68,7 +77,7 @@ module RuboCop return unless file_join_nodes?(node) return unless node.arguments.any? { |e| rails_root_nodes?(e) } - register_offense(node) + register_offense(node, require_to_s: true) end def check_for_rails_root_join_with_string_arguments(node) @@ -78,7 +87,7 @@ module RuboCop return unless node.arguments.size > 1 return unless node.arguments.all?(&:str_type?) - register_offense(node) + register_offense(node, require_to_s: false) end def check_for_rails_root_join_with_slash_separated_path(node) @@ -87,21 +96,28 @@ module RuboCop return unless rails_root_join_nodes?(node) return unless node.arguments.any? { |arg| string_with_slash?(arg) } - register_offense(node) + register_offense(node, require_to_s: false) end def string_with_slash?(node) node.str_type? && node.source.include?('/') end - def register_offense(node) + def register_offense(node, require_to_s:) line_range = node.loc.column...node.loc.last_column source_range = source_range(processed_source.buffer, node.first_line, line_range) - add_offense(source_range) + require_to_s = false if node.dstr_type? + + message = build_message(require_to_s) + + add_offense(source_range, message: message) end - def message(_range) - format(style == :arguments ? MSG_ARGUMENTS : MSG_SLASHES) + def build_message(require_to_s) + message_template = style == :arguments ? MSG_ARGUMENTS : MSG_SLASHES + to_s = require_to_s ? '.to_s' : '' + + format(message_template, to_s: to_s) end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/find_by.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/find_by.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/find_by.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/find_by.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/find_by_id.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/find_by_id.rb similarity index 93% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/find_by_id.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/find_by_id.rb index 415e45e25b..9e6dc1c274 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/find_by_id.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/find_by_id.rb @@ -65,11 +65,11 @@ module RuboCop end def where_take_offense_range(node, where) - range_between(where.loc.selector.begin_pos, node.loc.expression.end_pos) + range_between(where.loc.selector.begin_pos, node.source_range.end_pos) end def find_by_offense_range(node) - range_between(node.loc.selector.begin_pos, node.loc.expression.end_pos) + range_between(node.loc.selector.begin_pos, node.source_range.end_pos) end def build_good_method(id_value) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/find_each.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/find_each.rb similarity index 84% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/find_each.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/find_each.rb index a667201bdc..11d4a660fa 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/find_each.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/find_each.rb @@ -3,8 +3,12 @@ module RuboCop module Cop module Rails - # Identifies usages of `all.each` and - # change them to use `all.find_each` instead. + # Identifies usages of `all.each` and change them to use `all.find_each` instead. + # + # @safety + # This cop is unsafe if the receiver object is not an Active Record object. + # Also, `all.each` returns an `Array` instance and `all.find_each` returns nil, + # so the return values are different. # # @example # # bad diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/freeze_time.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/freeze_time.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/freeze_time.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/freeze_time.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/has_and_belongs_to_many.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/has_and_belongs_to_many.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/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.19.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.18.0/lib/rubocop/cop/rails/helper_instance_variable.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/helper_instance_variable.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/helper_instance_variable.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/http_positional_arguments.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/http_positional_arguments.rb similarity index 86% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/http_positional_arguments.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/http_positional_arguments.rb index 361e5e5b2c..221fca3487 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/http_positional_arguments.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/http_positional_arguments.rb @@ -10,6 +10,9 @@ module RuboCop # Rails/HttpPositionalArguments cop or set your TargetRailsVersion in your # .rubocop.yml file to 4.2. # + # NOTE: It does not detect any cases where `include Rack::Test::Methods` is used + # which makes the http methods incompatible behavior. + # # @example # # bad # get :new, { user_id: 1} @@ -37,8 +40,15 @@ module RuboCop (hash (kwsplat _)) PATTERN + def_node_matcher :include_rack_test_methods?, <<~PATTERN + (send nil? :include + (const + (const + (const {nil? cbase} :Rack) :Test) :Methods)) + PATTERN + def on_send(node) - return if in_routing_block?(node) + return if in_routing_block?(node) || use_rack_test_methods? http_request?(node) do |data| return unless needs_conversion?(data) @@ -56,7 +66,7 @@ module RuboCop # that represents the path/action on the Rails controller # the data is the http parameters and environment sent in # the Rails 5 http call - corrector.replace(node.loc.expression, correction(node)) + corrector.replace(node, correction(node)) end end end @@ -67,6 +77,12 @@ module RuboCop !!node.each_ancestor(:block).detect { |block| ROUTING_METHODS.include?(block.method_name) } end + def use_rack_test_methods? + processed_source.ast.each_descendant(:send).any? do |node| + include_rack_test_methods?(node) + end + end + def needs_conversion?(data) return true unless data.hash_type? return false if kwsplat_hash?(data) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/http_status.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/http_status.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/http_status.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/http_status.rb index b80498c27e..52eb64966a 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/http_status.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/http_status.rb @@ -66,7 +66,7 @@ module RuboCop return unless checker.offensive? add_offense(checker.node, message: checker.message) do |corrector| - corrector.replace(checker.node.loc.expression, checker.preferred_style) + corrector.replace(checker.node, checker.preferred_style) end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/i18n_lazy_lookup.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/i18n_lazy_lookup.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/i18n_lazy_lookup.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/i18n_lazy_lookup.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/i18n_locale_assignment.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/i18n_locale_assignment.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/i18n_locale_assignment.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/i18n_locale_assignment.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/i18n_locale_texts.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/i18n_locale_texts.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/i18n_locale_texts.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/i18n_locale_texts.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/ignored_columns_assignment.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/ignored_columns_assignment.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/ignored_columns_assignment.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/ignored_columns_assignment.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/ignored_skip_action_filter_option.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/ignored_skip_action_filter_option.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/index_by.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/index_by.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/index_by.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/index_with.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/index_with.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/index_with.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/inquiry.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/inquiry.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/inquiry.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/inquiry.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/inverse_of.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/inverse_of.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/inverse_of.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/lexically_scoped_action_filter.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/lexically_scoped_action_filter.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/link_to_blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/link_to_blank.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/link_to_blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/link_to_blank.rb index 32811e7952..61484050d2 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/link_to_blank.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/link_to_blank.rb @@ -68,7 +68,7 @@ module RuboCop def append_to_rel(rel_node, corrector) existing_rel = rel_node.children.last.value - str_range = rel_node.children.last.loc.expression.adjust(begin_pos: 1, end_pos: -1) + str_range = rel_node.children.last.source_range.adjust(begin_pos: 1, end_pos: -1) corrector.replace(str_range, "#{existing_rel} noopener") end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/mailer_name.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/mailer_name.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/mailer_name.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/mailer_name.rb index 43abab7bda..168434b7df 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/mailer_name.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/mailer_name.rb @@ -77,7 +77,7 @@ module RuboCop corrector.replace(node.loc.name, "#{name}Mailer") else name = node.children.last - corrector.replace(node.source_range, "#{name}Mailer") + corrector.replace(node, "#{name}Mailer") end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/match_route.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/match_route.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/match_route.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/migration_class_name.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/migration_class_name.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/migration_class_name.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/migration_class_name.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/negate_include.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/negate_include.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/negate_include.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/not_null_column.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/not_null_column.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/not_null_column.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/order_by_id.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/order_by_id.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/order_by_id.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/output.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/output.rb similarity index 90% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/output.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/output.rb index dba0a57dbe..43b104c8f2 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/output.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/output.rb @@ -39,7 +39,8 @@ module RuboCop PATTERN def on_send(node) - return unless (output?(node) || io_output?(node)) && node.arguments? + return if node.parent&.call_type? + return unless output?(node) || io_output?(node) range = offense_range(node) @@ -56,7 +57,7 @@ module RuboCop def offense_range(node) if node.receiver - range_between(node.loc.expression.begin_pos, node.loc.selector.end_pos) + range_between(node.source_range.begin_pos, node.loc.selector.end_pos) else node.loc.selector end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/output_safety.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/output_safety.rb similarity index 93% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/output_safety.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/output_safety.rb index 869fa3030e..fa754089f0 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/output_safety.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/output_safety.rb @@ -66,8 +66,12 @@ module RuboCop MSG = 'Tagging a string as html safe may be a security risk.' RESTRICT_ON_SEND = %i[html_safe raw safe_concat].freeze + def_node_search :i18n_method?, <<~PATTERN + (send {nil? (const {nil? cbase} :I18n)} {:t :translate :l :localize} ...) + PATTERN + def on_send(node) - return if non_interpolated_string?(node) + return if non_interpolated_string?(node) || i18n_method?(node) return unless looks_like_rails_html_safe?(node) || looks_like_rails_raw?(node) || diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/pick.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/pick.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/pick.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/pick.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/pluck.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/pluck.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/pluck.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/pluck.rb index 4cd3bca6e0..ee10214853 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/pluck.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/pluck.rb @@ -43,7 +43,7 @@ module RuboCop def on_block(node) pluck_candidate?(node) do |argument, key| - next unless use_one_block_argument?(argument) + next if key.regexp_type? || !use_one_block_argument?(argument) match = if node.block_type? block_argument = argument.children.first.source diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/pluck_id.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/pluck_id.rb similarity index 94% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/pluck_id.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/pluck_id.rb index 4a99691f07..4ba2e109b2 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/pluck_id.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/pluck_id.rb @@ -51,7 +51,7 @@ module RuboCop private def offense_range(node) - range_between(node.loc.selector.begin_pos, node.loc.expression.end_pos) + range_between(node.loc.selector.begin_pos, node.source_range.end_pos) end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/pluck_in_where.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/pluck_in_where.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/pluck_in_where.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/pluralization_grammar.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/pluralization_grammar.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/pluralization_grammar.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/presence.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/presence.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/presence.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/presence.rb index 6a134736ae..49dbfe09ac 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/presence.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/presence.rb @@ -93,7 +93,7 @@ module RuboCop def register_offense(node, receiver, other) add_offense(node, message: message(node, receiver, other)) do |corrector| - corrector.replace(node.source_range, replacement(receiver, other, node.left_sibling)) + corrector.replace(node, replacement(receiver, other, node.left_sibling)) end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/present.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/present.rb similarity index 95% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/present.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/present.rb index cc7b04140b..1d789cf7bd 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/present.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/present.rb @@ -128,10 +128,10 @@ module RuboCop if method_call corrector.replace(node.loc.keyword, 'if') - range = method_call.loc.expression + range = method_call.source_range else variable1, _variable2 = exists_and_not_empty?(node) || not_blank?(node) - range = node.loc.expression + range = node.source_range end corrector.replace(range, replacement(variable1)) @@ -141,9 +141,9 @@ module RuboCop def unless_condition(node, method_call) if node.modifier_form? - node.loc.keyword.join(node.loc.expression.end) + node.loc.keyword.join(node.source_range.end) else - node.loc.expression.begin.join(method_call.loc.expression) + node.source_range.begin.join(method_call.source_range) end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/rake_environment.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/rake_environment.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/rake_environment.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/rake_environment.rb index 8772b2682c..67694b30b7 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/rake_environment.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/rake_environment.rb @@ -48,7 +48,7 @@ module RuboCop task_name = task_method.arguments[0] task_dependency = correct_task_dependency(task_name) - corrector.replace(task_name.loc.expression, task_dependency) + corrector.replace(task_name, task_dependency) end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/read_write_attribute.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/read_write_attribute.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/read_write_attribute.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/read_write_attribute.rb index 1f481a1777..b3c30aba3a 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/read_write_attribute.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/read_write_attribute.rb @@ -52,7 +52,7 @@ module RuboCop return if within_shadowing_method?(node) add_offense(node, message: build_message(node)) do |corrector| - corrector.replace(node.source_range, node_replacement(node)) + corrector.replace(node, node_replacement(node)) end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/redundant_allow_nil.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/redundant_allow_nil.rb similarity index 95% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/redundant_allow_nil.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/redundant_allow_nil.rb index b1dccd1335..07b61b0b05 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/redundant_allow_nil.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/redundant_allow_nil.rb @@ -62,7 +62,7 @@ module RuboCop elsif prv_sib corrector.remove(range_between(node_end(prv_sib), node_end(allow_nil))) else - corrector.remove(allow_nil.loc.expression) + corrector.remove(allow_nil) end end end @@ -87,11 +87,11 @@ module RuboCop end def node_beg(node) - node.loc.expression.begin_pos + node.source_range.begin_pos end def node_end(node) - node.loc.expression.end_pos + node.source_range.end_pos end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/redundant_foreign_key.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/redundant_foreign_key.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/redundant_foreign_key.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/redundant_foreign_key.rb index 21ccc18f4d..3026fca294 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/redundant_foreign_key.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/redundant_foreign_key.rb @@ -40,7 +40,7 @@ module RuboCop def on_send(node) association_with_foreign_key(node) do |type, name, options, foreign_key_pair, foreign_key| if redundant?(node, type, name, options, foreign_key) - add_offense(foreign_key_pair.loc.expression) do |corrector| + add_offense(foreign_key_pair.source_range) do |corrector| range = range_with_surrounding_space(foreign_key_pair.source_range, side: :left) range = range_with_surrounding_comma(range, :left) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb index 4c25dcebdd..ec6699e96d 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb @@ -89,7 +89,7 @@ module RuboCop private def autocorrect(corrector, send_node, node) - corrector.remove(send_node.receiver.source_range) + corrector.remove(send_node.receiver) corrector.remove(send_node.loc.dot) corrector.remove(block_argument_range(send_node)) unless node.numblock_type? end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/redundant_travel_back.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/redundant_travel_back.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/redundant_travel_back.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/redundant_travel_back.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/reflection_class_name.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/reflection_class_name.rb similarity index 78% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/reflection_class_name.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/reflection_class_name.rb index ff2f3eb283..d0afa1acb6 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/reflection_class_name.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/reflection_class_name.rb @@ -18,6 +18,8 @@ module RuboCop # # good # has_many :accounts, class_name: 'Account' class ReflectionClassName < Base + extend AutoCorrector + MSG = 'Use a string value for `class_name`.' RESTRICT_ON_SEND = %i[has_many has_one belongs_to].freeze ALLOWED_REFLECTION_CLASS_TYPES = %i[dstr str sym].freeze @@ -32,12 +34,18 @@ module RuboCop (pair (sym :class_name) #reflection_class_value?) PATTERN + def_node_matcher :const_or_string, <<~PATTERN + {$(const nil? _) (send $(const nil? _) :name) (send $(const nil? _) :to_s)} + PATTERN + def on_send(node) association_with_reflection(node) do |reflection_class_name| return if reflection_class_name.value.send_type? && reflection_class_name.value.receiver.nil? return if reflection_class_name.value.lvar_type? && str_assigned?(reflection_class_name) - add_offense(reflection_class_name.loc.expression) + add_offense(reflection_class_name.source_range) do |corrector| + autocorrect(corrector, reflection_class_name) + end end end @@ -64,6 +72,14 @@ module RuboCop !ALLOWED_REFLECTION_CLASS_TYPES.include?(class_value.type) end end + + def autocorrect(corrector, class_config) + class_value = class_config.value + replacement = const_or_string(class_value) + return unless replacement.present? + + corrector.replace(class_value, replacement.source.inspect) + end end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/refute_methods.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/refute_methods.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/refute_methods.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/relative_date_constant.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/relative_date_constant.rb similarity index 95% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/relative_date_constant.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/relative_date_constant.rb index 92fd50d0b6..a2fed38e8e 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/relative_date_constant.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/relative_date_constant.rb @@ -78,7 +78,7 @@ module RuboCop indent = ' ' * node.loc.column new_code = ["def self.#{const_name.downcase}", "#{indent}#{value.source}", 'end'].join("\n#{indent}") - corrector.replace(node.source_range, new_code) + corrector.replace(node, new_code) end def message(method_name) @@ -86,7 +86,7 @@ module RuboCop end def offense_range(name, value) - range_between(name.loc.expression.begin_pos, value.loc.expression.end_pos) + range_between(name.source_range.begin_pos, value.source_range.end_pos) end def nested_relative_date(node, &callback) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/render_inline.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/render_inline.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/render_inline.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/render_plain_text.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/render_plain_text.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/render_plain_text.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/request_referer.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/request_referer.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/request_referer.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/require_dependency.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/require_dependency.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/require_dependency.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/response_parsed_body.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/response_parsed_body.rb similarity index 78% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/response_parsed_body.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/response_parsed_body.rb index 5c74d992c3..d80b2ec06b 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/response_parsed_body.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/response_parsed_body.rb @@ -6,9 +6,9 @@ module RuboCop # Prefer `response.parsed_body` to `JSON.parse(response.body)`. # # @safety - # This cop's autocorrection is unsafe because Content-Type may not be `application/json`. For example, the - # proprietary Content-Type provided by corporate entities such as `application/vnd.github+json` is not - # supported at `response.parsed_body` by default, so you still have to use `JSON.parse(response.body)` there. + # This cop is unsafe because Content-Type may not be `application/json`. For example, the proprietary + # Content-Type provided by corporate entities such as `application/vnd.github+json` is not supported at + # `response.parsed_body` by default, so you still have to use `JSON.parse(response.body)` there. # # @example # # bad diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/reversible_migration.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/reversible_migration.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/reversible_migration.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/reversible_migration_method_definition.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/reversible_migration_method_definition.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/reversible_migration_method_definition.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/reversible_migration_method_definition.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/root_join_chain.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/root_join_chain.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/root_join_chain.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/root_join_chain.rb index fb28d0c2d3..66a1549e10 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/root_join_chain.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/root_join_chain.rb @@ -39,7 +39,7 @@ module RuboCop def on_send(node) evidence(node) do |rails_node, args| add_offense(node, message: format(MSG, root: rails_node.source)) do |corrector| - range = range_between(rails_node.loc.selector.end_pos, node.loc.expression.end_pos) + range = range_between(rails_node.loc.selector.end_pos, node.source_range.end_pos) replacement = ".join(#{args.map(&:source).join(', ')})" corrector.replace(range, replacement) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/root_pathname_methods.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/root_pathname_methods.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/root_pathname_methods.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/root_pathname_methods.rb index 3f8d75d76b..cc7c87a796 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/root_pathname_methods.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/root_pathname_methods.rb @@ -184,7 +184,7 @@ module RuboCop end def build_path_glob_replacement(path, method) - receiver = range_between(path.loc.expression.begin_pos, path.children.first.loc.selector.end_pos).source + receiver = range_between(path.source_range.begin_pos, path.children.first.loc.selector.end_pos).source argument = path.arguments.one? ? path.first_argument.source : join_arguments(path.arguments) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/root_public_path.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/root_public_path.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/root_public_path.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/root_public_path.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/safe_navigation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/safe_navigation.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/safe_navigation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/safe_navigation.rb index c75ee8ac64..8c6205c71e 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/safe_navigation.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/safe_navigation.rb @@ -73,7 +73,7 @@ module RuboCop method = method_node.source[1..] range = if node.receiver - range_between(node.loc.dot.begin_pos, node.loc.expression.end_pos) + range_between(node.loc.dot.begin_pos, node.source_range.end_pos) else corrector.insert_before(node, 'self') node diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/safe_navigation_with_blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/safe_navigation_with_blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/save_bang.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/save_bang.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/save_bang.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/schema_comment.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/schema_comment.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/schema_comment.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/schema_comment.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/scope_args.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/scope_args.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/scope_args.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/short_i18n.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/short_i18n.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/short_i18n.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/skips_model_validations.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/skips_model_validations.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/skips_model_validations.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/squished_sql_heredocs.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/squished_sql_heredocs.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/squished_sql_heredocs.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/strip_heredoc.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/strip_heredoc.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/strip_heredoc.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/strip_heredoc.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/table_name_assignment.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/table_name_assignment.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/table_name_assignment.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/table_name_assignment.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/three_state_boolean_column.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/three_state_boolean_column.rb new file mode 100644 index 0000000000..e7e3ebf4a9 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/three_state_boolean_column.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module Rails + # Enforces that boolean columns are created with default values (`false` or `true`) and + # `NOT NULL` constraint. + # + # @example + # # bad + # add_column :users, :active, :boolean + # t.column :active, :boolean + # t.boolean :active + # + # # good + # add_column :users, :active, :boolean, default: true, null: false + # t.column :active, :boolean, default: true, null: false + # t.boolean :active, default: true, null: false + # + class ThreeStateBooleanColumn < Base + MSG = 'Boolean columns should always have a default value and a `NOT NULL` constraint.' + + RESTRICT_ON_SEND = %i[add_column column boolean].freeze + + def_node_matcher :three_state_boolean?, <<~PATTERN + { + (send nil? :add_column _ $_ {(sym :boolean) (str "boolean")} $_ ?) + (send !nil? :column $_ {(sym :boolean) (str "boolean")} $_ ?) + (send !nil? :boolean $_ $_ ?) + } + PATTERN + + def_node_matcher :required_options?, <<~PATTERN + (hash <(pair (sym :default) !nil?) (pair (sym :null) false) ...>) + PATTERN + + def_node_search :change_column_null?, <<~PATTERN + (send nil? :change_column_null {(sym %1) (str %1)} {(sym %2) (str %2)} false) + PATTERN + + def on_send(node) + three_state_boolean?(node) do |column_node, options_node| + options_node = options_node.first + + return if required_options?(options_node) + + def_node = node.each_ancestor(:def, :defs).first + table_node = table_node(node) + return if def_node && change_column_null?(def_node, table_node.value, column_node.value) + + add_offense(node) + end + end + + private + + def table_node(node) + case node.method_name + when :add_column + node.first_argument + when :column, :boolean + ancestor = node.each_ancestor(:block).find do |n| + n.method?(:create_table) || n.method?(:change_table) + end + ancestor&.send_node&.first_argument + end + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/time_zone.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/time_zone.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/time_zone.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/time_zone.rb index 63439e6fb9..f4f7b5f0f6 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/time_zone.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/time_zone.rb @@ -70,7 +70,7 @@ module RuboCop def autocorrect(corrector, node) # add `.zone`: `Time.at` => `Time.zone.at` - corrector.insert_after(node.children[0].source_range, '.zone') + corrector.insert_after(node.children[0], '.zone') case node.method_name when :current @@ -81,7 +81,7 @@ module RuboCop end # prefer `Time` over `DateTime` class - corrector.replace(node.children.first.source_range, 'Time') if strict? + corrector.replace(node.children.first, 'Time') if strict? remove_redundant_in_time_zone(corrector, node) end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/time_zone_assignment.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/time_zone_assignment.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/time_zone_assignment.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/time_zone_assignment.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/to_formatted_s.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/to_formatted_s.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/to_formatted_s.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/to_formatted_s.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/to_s_with_argument.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/to_s_with_argument.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/to_s_with_argument.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/to_s_with_argument.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/top_level_hash_with_indifferent_access.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/top_level_hash_with_indifferent_access.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/top_level_hash_with_indifferent_access.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/top_level_hash_with_indifferent_access.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/transaction_exit_statement.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/transaction_exit_statement.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/transaction_exit_statement.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/transaction_exit_statement.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/uniq_before_pluck.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/uniq_before_pluck.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/uniq_before_pluck.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/unique_validation_without_index.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/unique_validation_without_index.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/unique_validation_without_index.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/unique_validation_without_index.rb index da55757857..4a5d3d1cf0 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/unique_validation_without_index.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/unique_validation_without_index.rb @@ -4,7 +4,7 @@ module RuboCop module Cop module Rails # When you define a uniqueness validation in Active Record model, - # you also should add a unique index for the column. There are two reasons + # you also should add a unique index for the column. There are two reasons. # First, duplicated records may occur even if Active Record's validation # is defined. # Second, it will cause slow queries. The validation executes a `SELECT` diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/unknown_env.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0/lib/rubocop/cop/rails/unknown_env.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/unknown_env.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/unused_ignored_columns.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/unused_ignored_columns.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/unused_ignored_columns.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/unused_ignored_columns.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/validation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/validation.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/validation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/validation.rb index 2958e14552..f250d5d8a4 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/validation.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/validation.rb @@ -102,7 +102,7 @@ module RuboCop end def correct_validate_type_for_hash(corrector, node, arguments) - corrector.replace(arguments.loc.expression, "#{validate_type(node)}: #{braced_options(arguments)}") + corrector.replace(arguments, "#{validate_type(node)}: #{braced_options(arguments)}") end def correct_validate_type_for_array(corrector, node, arguments, loc) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/where_equals.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/where_equals.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/where_equals.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/where_equals.rb index 217e83a711..db9072d867 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/where_equals.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/where_equals.rb @@ -65,7 +65,7 @@ module RuboCop private def offense_range(node) - range_between(node.loc.selector.begin_pos, node.loc.expression.end_pos) + range_between(node.loc.selector.begin_pos, node.source_range.end_pos) end def extract_column_and_value(template_node, value_node) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/where_exists.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/where_exists.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/where_exists.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/where_exists.rb index 65b32cb467..766988f4ed 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/where_exists.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/where_exists.rb @@ -105,7 +105,7 @@ module RuboCop if exists_style? node.receiver.loc.selector.join(node.loc.selector) elsif where_style? - node.loc.selector.with(end_pos: node.loc.expression.end_pos) + node.loc.selector.with(end_pos: node.source_range.end_pos) end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/where_missing.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/where_missing.rb similarity index 94% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/where_missing.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/where_missing.rb index 0d0d35014f..168d2516d1 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/where_missing.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/where_missing.rb @@ -43,7 +43,7 @@ module RuboCop next unless root_receiver == root_receiver(where_node) next unless same_relationship?(where_argument, node.first_argument) - range = range_between(node.loc.selector.begin_pos, node.loc.expression.end_pos) + range = range_between(node.loc.selector.begin_pos, node.source_range.end_pos) register_offense(node, where_node, where_argument, range) break end @@ -83,9 +83,9 @@ module RuboCop def replace_range(child) if (right_sibling = child.right_sibling) - range_between(child.loc.expression.begin_pos, right_sibling.loc.expression.begin_pos) + range_between(child.source_range.begin_pos, right_sibling.source_range.begin_pos) else - range_between(child.left_sibling.loc.expression.end_pos, child.loc.expression.end_pos) + range_between(child.left_sibling.source_range.end_pos, child.source_range.end_pos) end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/where_not.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/where_not.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/where_not.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/where_not.rb index 126b7926fa..1e2aab2b65 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/where_not.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/where_not.rb @@ -64,7 +64,7 @@ module RuboCop private def offense_range(node) - range_between(node.loc.selector.begin_pos, node.loc.expression.end_pos) + range_between(node.loc.selector.begin_pos, node.source_range.end_pos) end def extract_column_and_value(template_node, value_node) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/where_not_with_multiple_conditions.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/where_not_with_multiple_conditions.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/where_not_with_multiple_conditions.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/where_not_with_multiple_conditions.rb index 5d820da7e3..5b0dfb7b23 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails/where_not_with_multiple_conditions.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/where_not_with_multiple_conditions.rb @@ -32,10 +32,10 @@ module RuboCop def on_send(node) where_not_call?(node) do |args| - next unless args[0].hash_type? + next unless args[0]&.hash_type? next unless multiple_arguments_hash? args[0] - range = node.receiver.loc.selector.with(end_pos: node.loc.expression.end_pos) + range = node.receiver.loc.selector.with(end_pos: node.source_range.end_pos) add_offense(range) end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails_cops.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails_cops.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails_cops.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails_cops.rb index fa167e1811..5e0db983d6 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/cop/rails_cops.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails_cops.rb @@ -115,6 +115,7 @@ require_relative 'rails/skips_model_validations' require_relative 'rails/squished_sql_heredocs' require_relative 'rails/strip_heredoc' require_relative 'rails/table_name_assignment' +require_relative 'rails/three_state_boolean_column' require_relative 'rails/time_zone' require_relative 'rails/time_zone_assignment' require_relative 'rails/to_formatted_s' diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/rails.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/rails.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/rails.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/rails.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/rails/inject.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/rails/inject.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/rails/inject.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/rails/inject.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/rails/schema_loader.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/rails/schema_loader.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/rails/schema_loader.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/rails/schema_loader.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/rails/schema_loader/schema.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/rails/schema_loader/schema.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/rails/schema_loader/schema.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/rails/schema_loader/schema.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/rails/version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/rails/version.rb similarity index 90% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/rails/version.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/rails/version.rb index 4517b3af13..887f195c0d 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.18.0/lib/rubocop/rails/version.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.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.18.0' + STRING = '2.19.0' def self.document_version STRING.match('\d+\.\d+').to_s From 11b2f8d95662497b9869c0c446b0fd52a7bd3ce5 Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Fri, 7 Apr 2023 19:13:18 +0000 Subject: [PATCH 3/4] Update RBI files for rubocop-rails. Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gems.yml) workflow. --- ...ls@2.18.0.rbi => rubocop-rails@2.19.0.rbi} | 26 +++++++++++++++++-- .../sorbet/rbi/hidden-definitions/hidden.rbi | 1 + 2 files changed, 25 insertions(+), 2 deletions(-) rename Library/Homebrew/sorbet/rbi/gems/{rubocop-rails@2.18.0.rbi => rubocop-rails@2.19.0.rbi} (98%) diff --git a/Library/Homebrew/sorbet/rbi/gems/rubocop-rails@2.18.0.rbi b/Library/Homebrew/sorbet/rbi/gems/rubocop-rails@2.19.0.rbi similarity index 98% rename from Library/Homebrew/sorbet/rbi/gems/rubocop-rails@2.18.0.rbi rename to Library/Homebrew/sorbet/rbi/gems/rubocop-rails@2.19.0.rbi index 71a908cfcc..3673a5a870 100644 --- a/Library/Homebrew/sorbet/rbi/gems/rubocop-rails@2.18.0.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/rubocop-rails@2.19.0.rbi @@ -514,6 +514,7 @@ class RuboCop::Cop::Rails::CreateTableWithTimestamps < ::RuboCop::Cop::Base def created_at_or_updated_at_included?(param0); end def on_send(node); end def timestamps_included?(param0); end + def use_id_false_option?(param0); end private @@ -848,11 +849,11 @@ class RuboCop::Cop::Rails::FilePath < ::RuboCop::Cop::Base private + def build_message(require_to_s); end def check_for_file_join_with_rails_root(node); end def check_for_rails_root_join_with_slash_separated_path(node); end def check_for_rails_root_join_with_string_arguments(node); end - def message(_range); end - def register_offense(node); end + def register_offense(node, require_to_s:); end def string_with_slash?(node); end end @@ -986,6 +987,7 @@ class RuboCop::Cop::Rails::HttpPositionalArguments < ::RuboCop::Cop::Base extend ::RuboCop::Cop::TargetRailsVersion def http_request?(param0 = T.unsafe(nil)); end + def include_rack_test_methods?(param0 = T.unsafe(nil)); end def kwsplat_hash?(param0 = T.unsafe(nil)); end def on_send(node); end @@ -999,6 +1001,7 @@ class RuboCop::Cop::Rails::HttpPositionalArguments < ::RuboCop::Cop::Base def in_routing_block?(node); end def needs_conversion?(data); end def special_keyword_arg?(node); end + def use_rack_test_methods?; end end RuboCop::Cop::Rails::HttpPositionalArguments::KEYWORD_ARGS = T.let(T.unsafe(nil), Array) @@ -1330,6 +1333,7 @@ RuboCop::Cop::Rails::Output::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Rails::Output::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) class RuboCop::Cop::Rails::OutputSafety < ::RuboCop::Cop::Base + def i18n_method?(param0); end def on_csend(node); end def on_send(node); end @@ -1612,12 +1616,16 @@ RuboCop::Cop::Rails::RedundantTravelBack::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Rails::RedundantTravelBack::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) class RuboCop::Cop::Rails::ReflectionClassName < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + def association_with_reflection(param0 = T.unsafe(nil)); end + def const_or_string(param0 = T.unsafe(nil)); end def on_send(node); end def reflection_class_name(param0 = T.unsafe(nil)); end private + def autocorrect(corrector, class_config); end def reflection_class_value?(class_value); end def str_assigned?(reflection_class_name); end end @@ -2018,6 +2026,20 @@ end RuboCop::Cop::Rails::TableNameAssignment::MSG = T.let(T.unsafe(nil), String) +class RuboCop::Cop::Rails::ThreeStateBooleanColumn < ::RuboCop::Cop::Base + def change_column_null?(param0, param1, param2); end + def on_send(node); end + def required_options?(param0 = T.unsafe(nil)); end + def three_state_boolean?(param0 = T.unsafe(nil)); end + + private + + def table_node(node); end +end + +RuboCop::Cop::Rails::ThreeStateBooleanColumn::MSG = T.let(T.unsafe(nil), String) +RuboCop::Cop::Rails::ThreeStateBooleanColumn::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + class RuboCop::Cop::Rails::TimeZone < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector diff --git a/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi b/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi index 85eb114c10..cbe969e81b 100644 --- a/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi +++ b/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi @@ -6509,6 +6509,7 @@ module RuboCop::AST::NodePattern::Sets SET_ON_INTEL_ON_ARM = ::T.let(nil, ::T.untyped) SET_OR_NEWER_OR_OLDER = ::T.let(nil, ::T.untyped) SET_SYSTEM_SHELL_OUTPUT_PIPE_OUTPUT = ::T.let(nil, ::T.untyped) + SET_T_TRANSLATE_L_LOCALIZE = ::T.let(nil, ::T.untyped) SET_WITH_WITHOUT = ::T.let(nil, ::T.untyped) SET____ETC_4 = ::T.let(nil, ::T.untyped) end From 0c2e6e59c5228139492c444cd51e01fb0a3e1793 Mon Sep 17 00:00:00 2001 From: Issy Long Date: Fri, 7 Apr 2023 21:35:38 +0100 Subject: [PATCH 4/4] rubocop: Remove redundant `Style/InverseMethods` disables --- Library/Homebrew/rubocops/components_order.rb | 2 +- Library/Homebrew/rubocops/shared/desc_helper.rb | 3 +-- Library/Homebrew/startup/bootsnap.rb | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/rubocops/components_order.rb b/Library/Homebrew/rubocops/components_order.rb index 4768a22605..c7ac428903 100644 --- a/Library/Homebrew/rubocops/components_order.rb +++ b/Library/Homebrew/rubocops/components_order.rb @@ -124,7 +124,7 @@ module RuboCop end def check_on_system_block_content(component_precedence_list, on_system_block) - if on_system_block.body.block_type? && !on_system_methods.include?(on_system_block.body.method_name) # rubocop:disable Style/InverseMethods (false positive) + if on_system_block.body.block_type? && !on_system_methods.include?(on_system_block.body.method_name) offending_node(on_system_block) problem "Nest `#{on_system_block.method_name}` blocks inside `#{on_system_block.body.method_name}` " \ "blocks when there is only one inner block." do |corrector| diff --git a/Library/Homebrew/rubocops/shared/desc_helper.rb b/Library/Homebrew/rubocops/shared/desc_helper.rb index 215075a1dd..bfde588488 100644 --- a/Library/Homebrew/rubocops/shared/desc_helper.rb +++ b/Library/Homebrew/rubocops/shared/desc_helper.rb @@ -53,8 +53,7 @@ module RuboCop desc_problem "Description shouldn't start with an article." if regex_match_group(desc, /^(the|an?)(?=\s)/i) # Check if invalid lowercase words are at the start of a desc. - if !VALID_LOWERCASE_WORDS.include?(string_content(desc).split.first) && # rubocop:disable Style/InverseMethods (false positive) - regex_match_group(desc, /^[a-z]/) + if !VALID_LOWERCASE_WORDS.include?(string_content(desc).split.first) && regex_match_group(desc, /^[a-z]/) desc_problem "Description should start with a capital letter." end diff --git a/Library/Homebrew/startup/bootsnap.rb b/Library/Homebrew/startup/bootsnap.rb index 81027de947..b83be1d335 100644 --- a/Library/Homebrew/startup/bootsnap.rb +++ b/Library/Homebrew/startup/bootsnap.rb @@ -7,7 +7,7 @@ homebrew_bootsnap_enabled = ENV["HOMEBREW_NO_BOOTSNAP"].nil? && !ENV["HOMEBREW_B # portable ruby doesn't play nice with bootsnap -homebrew_bootsnap_enabled &&= !RUBY_PATH.to_s.include?("/vendor/portable-ruby/") # rubocop:disable Style/InverseMethods +homebrew_bootsnap_enabled &&= !RUBY_PATH.to_s.include?("/vendor/portable-ruby/") homebrew_bootsnap_enabled &&= if ENV["HOMEBREW_MACOS_VERSION"] # Apple Silicon doesn't play nice with bootsnap