From f41ea10690508955bf3f28c164da127bf66bf9ca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Mar 2022 18:05:03 +0000 Subject: [PATCH 1/3] build(deps): bump rubocop-rails in /Library/Homebrew Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.13.2 to 2.14.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.13.2...v2.14.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 ed2a74f8d7..da4cd04b74 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -137,7 +137,7 @@ GEM rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - rubocop-rails (2.13.2) + rubocop-rails (2.14.0) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.7.0, < 2.0) From cecc32971c70cd91358321378340a818a1741772 Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Tue, 15 Mar 2022 18:07:24 +0000 Subject: [PATCH 2/3] brew vendor-gems: commit updates. --- .../Homebrew/vendor/bundle/bundler/setup.rb | 2 +- .../config/default.yml | 71 ++++++++++- .../config/obsoletion.yml | 0 .../lib/rubocop-rails.rb | 0 .../rubocop/cop/mixin/active_record_helper.rb | 0 .../mixin/active_record_migrations_helper.rb | 0 .../cop/mixin/class_send_node_helper.rb | 20 ++++ .../rubocop/cop/mixin/enforce_superclass.rb | 0 .../lib/rubocop/cop/mixin/index_method.rb | 0 .../rubocop/cop/mixin/migrations_helper.rb | 0 .../rubocop/cop/mixin/target_rails_version.rb | 0 .../cop/rails/action_controller_test_case.rb | 47 ++++++++ .../lib/rubocop/cop/rails/action_filter.rb | 0 .../cop/rails/active_record_aliases.rb | 0 .../rails/active_record_callbacks_order.rb | 0 .../cop/rails/active_record_override.rb | 0 .../cop/rails/active_support_aliases.rb | 0 .../lib/rubocop/cop/rails/add_column_index.rb | 0 .../cop/rails/after_commit_override.rb | 14 +-- .../cop/rails/application_controller.rb | 0 .../lib/rubocop/cop/rails/application_job.rb | 0 .../rubocop/cop/rails/application_mailer.rb | 0 .../rubocop/cop/rails/application_record.rb | 0 .../lib/rubocop/cop/rails/arel_star.rb | 0 .../lib/rubocop/cop/rails/assert_not.rb | 0 .../rails/attribute_default_block_value.rb | 0 .../lib/rubocop/cop/rails/belongs_to.rb | 0 .../lib/rubocop/cop/rails/blank.rb | 0 .../rubocop/cop/rails/bulk_change_table.rb | 26 ++++- .../lib/rubocop/cop/rails/compact_blank.rb | 18 ++- .../lib/rubocop/cop/rails/content_tag.rb | 0 .../cop/rails/create_table_with_timestamps.rb | 0 .../lib/rubocop/cop/rails/date.rb | 0 .../lib/rubocop/cop/rails/default_scope.rb | 0 .../lib/rubocop/cop/rails/delegate.rb | 0 .../rubocop/cop/rails/delegate_allow_blank.rb | 0 .../deprecated_active_model_errors_methods.rb | 108 +++++++++++++++++ .../cop/rails/duplicate_association.rb | 56 +++++++++ .../lib/rubocop/cop/rails/duplicate_scope.rb | 46 ++++++++ .../rubocop/cop/rails/duration_arithmetic.rb | 0 .../lib/rubocop/cop/rails/dynamic_find_by.rb | 0 .../cop/rails/eager_evaluation_log_message.rb | 0 .../lib/rubocop/cop/rails/enum_hash.rb | 0 .../lib/rubocop/cop/rails/enum_uniqueness.rb | 0 .../cop/rails/environment_comparison.rb | 0 .../cop/rails/environment_variable_access.rb | 0 .../lib/rubocop/cop/rails/exit.rb | 0 .../rubocop/cop/rails/expanded_date_range.rb | 0 .../lib/rubocop/cop/rails/file_path.rb | 0 .../lib/rubocop/cop/rails/find_by.rb | 0 .../lib/rubocop/cop/rails/find_by_id.rb | 0 .../lib/rubocop/cop/rails/find_each.rb | 0 .../cop/rails/has_and_belongs_to_many.rb | 0 .../rails/has_many_or_has_one_dependent.rb | 0 .../cop/rails/helper_instance_variable.rb | 0 .../cop/rails/http_positional_arguments.rb | 0 .../lib/rubocop/cop/rails/http_status.rb | 0 .../lib/rubocop/cop/rails/i18n_lazy_lookup.rb | 94 +++++++++++++++ .../cop/rails/i18n_locale_assignment.rb | 0 .../rubocop/cop/rails/i18n_locale_texts.rb | 110 ++++++++++++++++++ .../ignored_skip_action_filter_option.rb | 0 .../lib/rubocop/cop/rails/index_by.rb | 0 .../lib/rubocop/cop/rails/index_with.rb | 0 .../lib/rubocop/cop/rails/inquiry.rb | 0 .../lib/rubocop/cop/rails/inverse_of.rb | 0 .../rails/lexically_scoped_action_filter.rb | 0 .../lib/rubocop/cop/rails/link_to_blank.rb | 0 .../lib/rubocop/cop/rails/mailer_name.rb | 0 .../lib/rubocop/cop/rails/match_route.rb | 0 .../rubocop/cop/rails/migration_class_name.rb | 61 ++++++++++ .../lib/rubocop/cop/rails/negate_include.rb | 0 .../lib/rubocop/cop/rails/not_null_column.rb | 0 .../lib/rubocop/cop/rails/order_by_id.rb | 0 .../lib/rubocop/cop/rails/output.rb | 0 .../lib/rubocop/cop/rails/output_safety.rb | 0 .../lib/rubocop/cop/rails/pick.rb | 0 .../lib/rubocop/cop/rails/pluck.rb | 22 ++-- .../lib/rubocop/cop/rails/pluck_id.rb | 0 .../lib/rubocop/cop/rails/pluck_in_where.rb | 0 .../cop/rails/pluralization_grammar.rb | 0 .../lib/rubocop/cop/rails/presence.rb | 0 .../lib/rubocop/cop/rails/present.rb | 0 .../lib/rubocop/cop/rails/rake_environment.rb | 0 .../rubocop/cop/rails/read_write_attribute.rb | 0 .../rubocop/cop/rails/redundant_allow_nil.rb | 0 .../cop/rails/redundant_foreign_key.rb | 0 ...ndant_presence_validation_on_belongs_to.rb | 0 .../redundant_receiver_in_with_options.rb | 0 .../cop/rails/redundant_travel_back.rb | 0 .../cop/rails/reflection_class_name.rb | 0 .../lib/rubocop/cop/rails/refute_methods.rb | 0 .../cop/rails/relative_date_constant.rb | 0 .../lib/rubocop/cop/rails/render_inline.rb | 0 .../rubocop/cop/rails/render_plain_text.rb | 0 .../lib/rubocop/cop/rails/request_referer.rb | 0 .../rubocop/cop/rails/require_dependency.rb | 0 .../rubocop/cop/rails/reversible_migration.rb | 0 .../reversible_migration_method_definition.rb | 0 .../lib/rubocop/cop/rails/root_join_chain.rb | 0 .../lib/rubocop/cop/rails/safe_navigation.rb | 0 .../cop/rails/safe_navigation_with_blank.rb | 0 .../lib/rubocop/cop/rails/save_bang.rb | 0 .../lib/rubocop/cop/rails/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 .../cop/rails/table_name_assignment.rb | 44 +++++++ .../lib/rubocop/cop/rails/time_zone.rb | 0 .../rubocop/cop/rails/time_zone_assignment.rb | 0 .../cop/rails/transaction_exit_statement.rb | 77 ++++++++++++ .../rubocop/cop/rails/uniq_before_pluck.rb | 0 .../rails/unique_validation_without_index.rb | 0 .../lib/rubocop/cop/rails/unknown_env.rb | 0 .../cop/rails/unused_ignored_columns.rb | 0 .../lib/rubocop/cop/rails/validation.rb | 0 .../lib/rubocop/cop/rails/where_equals.rb | 0 .../lib/rubocop/cop/rails/where_exists.rb | 0 .../lib/rubocop/cop/rails/where_not.rb | 0 .../lib/rubocop/cop/rails_cops.rb | 10 ++ .../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 +- 125 files changed, 794 insertions(+), 34 deletions(-) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/config/default.yml (91%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/config/obsoletion.yml (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop-rails.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/mixin/active_record_helper.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/mixin/active_record_migrations_helper.rb (100%) create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/mixin/class_send_node_helper.rb rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/mixin/enforce_superclass.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/mixin/index_method.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/mixin/migrations_helper.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/mixin/target_rails_version.rb (100%) create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/action_controller_test_case.rb rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/action_filter.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/active_record_aliases.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/active_record_callbacks_order.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/active_record_override.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/active_support_aliases.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/add_column_index.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/after_commit_override.rb (89%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/application_controller.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/application_job.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/application_mailer.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/application_record.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/arel_star.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/assert_not.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/attribute_default_block_value.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/belongs_to.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/blank.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/bulk_change_table.rb (92%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/compact_blank.rb (72%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/content_tag.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/create_table_with_timestamps.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/date.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/default_scope.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/delegate.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/delegate_allow_blank.rb (100%) create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/deprecated_active_model_errors_methods.rb create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/duplicate_association.rb create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/duplicate_scope.rb rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/duration_arithmetic.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/dynamic_find_by.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/eager_evaluation_log_message.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/enum_hash.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/enum_uniqueness.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/environment_comparison.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/environment_variable_access.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/exit.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/expanded_date_range.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/file_path.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/find_by.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/find_by_id.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/find_each.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.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.13.2 => rubocop-rails-2.14.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.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/helper_instance_variable.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/http_positional_arguments.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/http_status.rb (100%) create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/i18n_lazy_lookup.rb rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/i18n_locale_assignment.rb (100%) create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/i18n_locale_texts.rb rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.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.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/index_by.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/index_with.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/inquiry.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/inverse_of.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/lexically_scoped_action_filter.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/link_to_blank.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/mailer_name.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/match_route.rb (100%) create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/migration_class_name.rb rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/negate_include.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/not_null_column.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/order_by_id.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/output.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/output_safety.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/pick.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/pluck.rb (63%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/pluck_id.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/pluck_in_where.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/pluralization_grammar.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/presence.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/present.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/rake_environment.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/read_write_attribute.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/redundant_allow_nil.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/redundant_foreign_key.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.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.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/redundant_travel_back.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/reflection_class_name.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/refute_methods.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/relative_date_constant.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/render_inline.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/render_plain_text.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/request_referer.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/require_dependency.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/reversible_migration.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/reversible_migration_method_definition.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/root_join_chain.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/safe_navigation.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/safe_navigation_with_blank.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/save_bang.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/schema_comment.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/scope_args.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/short_i18n.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/skips_model_validations.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/squished_sql_heredocs.rb (100%) create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/table_name_assignment.rb rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/time_zone.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/time_zone_assignment.rb (100%) create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/transaction_exit_statement.rb rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/uniq_before_pluck.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/unique_validation_without_index.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/unknown_env.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/unused_ignored_columns.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/validation.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/where_equals.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/where_exists.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails/where_not.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/cop/rails_cops.rb (90%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/rails.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/rails/inject.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/rails/schema_loader.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.0}/lib/rubocop/rails/schema_loader/schema.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{rubocop-rails-2.13.2 => rubocop-rails-2.14.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 9703fcdced..6c228a578b 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -86,7 +86,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-progressbar-1.11 $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unicode-display_width-2.1.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-1.26.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.13.3/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rails-2.13.2/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rails-2.14.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-2.9.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-sorbet-0.6.7/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-3.0.0/lib" diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/config/default.yml b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/config/default.yml similarity index 91% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/config/default.yml rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/config/default.yml index cb7f462e1e..ee8fa92ae4 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/config/default.yml +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/config/default.yml @@ -7,7 +7,9 @@ inherit_mode: AllCops: Exclude: - bin/* - - db/schema.rb + # Exclude db/schema.rb and db/[CONFIGURATION_NAMESPACE]_schema.rb by default. + # See: https://guides.rubyonrails.org/active_record_multiple_databases.html#setting-up-your-application + - db/*schema.rb # What version of Rails is the inspected code using? If a value is specified # for TargetRailsVersion then it is used. Acceptable values are specified # as a float (i.e. 5.1); the patch version of Rails should not be included. @@ -38,6 +40,16 @@ Lint/NumberConversion: - fortnights - in_milliseconds +Rails/ActionControllerTestCase: + Description: 'Use `ActionDispatch::IntegrationTest` instead of `ActionController::TestCase`.' + StyleGuide: 'https://rails.rubystyle.guide/#integration-testing' + Reference: 'https://api.rubyonrails.org/classes/ActionController/TestCase.html' + Enabled: 'pending' + SafeAutocorrect: false + VersionAdded: '2.14' + Include: + - '**/test/**/*.rb' + Rails/ActionFilter: Description: 'Enforces consistent use of action filter methods.' Enabled: true @@ -195,9 +207,12 @@ Rails/ContentTag: Enabled: true VersionAdded: '2.6' VersionChanged: '2.12' - # This `Exclude` config prevents false positives for `tag` calls to `has_one: tag`. No helpers are used in normal models. + # This `Exclude` config prevents false positives for `tag` calls to `has_one: tag` and Puma configuration: + # https://puma.io/puma/Puma/DSL.html#tag-instance_method + # No helpers are used in normal models and configs. Exclude: - app/models/**/*.rb + - config/**/*.rb Rails/CreateTableWithTimestamps: Description: >- @@ -251,6 +266,22 @@ Rails/DelegateAllowBlank: Enabled: true VersionAdded: '0.44' +Rails/DeprecatedActiveModelErrorsMethods: + Description: 'Avoid manipulating ActiveModel errors hash directly.' + Enabled: pending + Safe: false + VersionAdded: '2.14' + +Rails/DuplicateAssociation: + Description: "Don't repeat associations in a model." + Enabled: pending + VersionAdded: '2.14' + +Rails/DuplicateScope: + Description: 'Multiple scopes share this same where clause.' + Enabled: pending + VersionAdded: '2.14' + Rails/DurationArithmetic: Description: 'Do not use duration as arithmetic operand with `Time.current`.' StyleGuide: 'https://rails.rubystyle.guide#duration-arithmetic' @@ -415,6 +446,15 @@ Rails/HttpStatus: - numeric - symbolic +Rails/I18nLazyLookup: + Description: 'Checks for places where I18n "lazy" lookup can be used.' + StyleGuide: 'https://rails.rubystyle.guide/#lazy-lookup' + Reference: 'https://guides.rubyonrails.org/i18n.html#lazy-lookup' + Enabled: pending + VersionAdded: '2.14' + Include: + - 'controllers/**/*' + Rails/I18nLocaleAssignment: Description: 'Prefer the usage of `I18n.with_locale` instead of manually updating `I18n.locale` value.' Enabled: 'pending' @@ -423,6 +463,12 @@ Rails/I18nLocaleAssignment: - spec/**/*.rb - test/**/*.rb +Rails/I18nLocaleTexts: + Description: 'Enforces use of I18n and locale files instead of locale specific strings.' + StyleGuide: 'https://rails.rubystyle.guide/#locale-texts' + Enabled: pending + VersionAdded: '2.14' + Rails/IgnoredSkipActionFilterOption: Description: 'Checks that `if` and `only` (or `except`) are not used together as options of `skip_*` action filter.' Reference: 'https://api.rubyonrails.org/classes/AbstractController/Callbacks/ClassMethods.html#method-i-_normalize_callback_options' @@ -495,6 +541,13 @@ Rails/MatchRoute: - config/routes.rb - config/routes/**/*.rb +Rails/MigrationClassName: + Description: 'The class name of the migration should match its file name.' + Enabled: pending + VersionAdded: '2.14' + Include: + - db/migrate/*.rb + Rails/NegateInclude: Description: 'Prefer `collection.exclude?(obj)` over `!collection.include?(obj)`.' StyleGuide: 'https://rails.rubystyle.guide#exclude' @@ -817,6 +870,15 @@ Rails/SquishedSQLHeredocs: # to be preserved in order to work, thus auto-correction is not safe. SafeAutoCorrect: false +Rails/TableNameAssignment: + Description: >- + Do not use `self.table_name =`. Use Inflections or `table_name_prefix` instead. + StyleGuide: 'https://rails.rubystyle.guide/#keep-ar-defaults' + Enabled: false + VersionAdded: '2.14' + Include: + - app/models/**/*.rb + Rails/TimeZone: Description: 'Checks the correct usage of time zone aware methods.' StyleGuide: 'https://rails.rubystyle.guide#time' @@ -843,6 +905,11 @@ Rails/TimeZoneAssignment: - spec/**/*.rb - test/**/*.rb +Rails/TransactionExitStatement: + Description: 'Avoid the usage of `return`, `break` and `throw` in transaction blocks.' + Enabled: pending + VersionAdded: '2.14' + Rails/UniqBeforePluck: Description: 'Prefer the use of uniq or distinct before pluck.' Enabled: true diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/config/obsoletion.yml b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/config/obsoletion.yml similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/config/obsoletion.yml rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/config/obsoletion.yml diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop-rails.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop-rails.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop-rails.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop-rails.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/mixin/active_record_helper.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/mixin/active_record_helper.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/mixin/active_record_helper.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/mixin/active_record_migrations_helper.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/mixin/active_record_migrations_helper.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.14.0/lib/rubocop/cop/mixin/class_send_node_helper.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/mixin/class_send_node_helper.rb new file mode 100644 index 0000000000..e68737d47f --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/mixin/class_send_node_helper.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + # A mixin to return all of the class send nodes. + module ClassSendNodeHelper + def class_send_nodes(class_node) + class_def = class_node.body + + return [] unless class_def + + if class_def.send_type? + [class_def] + else + class_def.each_child_node(:send) + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/mixin/enforce_superclass.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/mixin/enforce_superclass.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/mixin/enforce_superclass.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/mixin/enforce_superclass.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/mixin/index_method.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/mixin/index_method.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/mixin/index_method.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/mixin/index_method.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/mixin/migrations_helper.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/mixin/migrations_helper.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/mixin/migrations_helper.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/mixin/target_rails_version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/mixin/target_rails_version.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/mixin/target_rails_version.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/action_controller_test_case.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/action_controller_test_case.rb new file mode 100644 index 0000000000..0811e699ab --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/action_controller_test_case.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module Rails + # Using `ActionController::TestCase`` is discouraged and should be replaced by + # `ActionDispatch::IntegrationTest``. Controller tests are too close to the + # internals of a controller whereas integration tests mimic the browser/user. + # + # @safety + # This cop's autocorrection is unsafe because the API of each test case class is different. + # Make sure to update each test of your controller test cases after changing the superclass. + # + # @example + # # bad + # class MyControllerTest < ActionController::TestCase + # end + # + # # good + # class MyControllerTest < ActionDispatch::IntegrationTest + # end + # + class ActionControllerTestCase < Base + extend AutoCorrector + extend TargetRailsVersion + + MSG = 'Use `ActionDispatch::IntegrationTest` instead.' + + minimum_target_rails_version 5.0 + + def_node_matcher :action_controller_test_case?, <<~PATTERN + (class + (const nil? _) + (const (const {nil? cbase} :ActionController) :TestCase) nil?) + PATTERN + + def on_class(node) + return unless action_controller_test_case?(node) + + add_offense(node.parent_class) do |corrector| + corrector.replace(node.parent_class, 'ActionDispatch::IntegrationTest') + end + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/action_filter.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/action_filter.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/action_filter.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/active_record_aliases.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/active_record_aliases.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/active_record_aliases.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/active_record_callbacks_order.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/active_record_callbacks_order.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/active_record_callbacks_order.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/active_record_callbacks_order.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/active_record_override.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/active_record_override.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/active_record_override.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/active_support_aliases.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/active_support_aliases.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/active_support_aliases.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/add_column_index.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/add_column_index.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/add_column_index.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/add_column_index.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/after_commit_override.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/after_commit_override.rb similarity index 89% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/after_commit_override.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/after_commit_override.rb index 88992fb7bb..789f5059c7 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/after_commit_override.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/after_commit_override.rb @@ -32,6 +32,8 @@ module RuboCop # after_update_commit :log_update_action # class AfterCommitOverride < Base + include ClassSendNodeHelper + MSG = 'There can only be one `after_*_commit :%s` hook defined for a model.' AFTER_COMMIT_CALLBACKS = %i[ @@ -63,18 +65,6 @@ module RuboCop end end - def class_send_nodes(class_node) - class_def = class_node.body - - return [] unless class_def - - if class_def.send_type? - [class_def] - else - class_def.each_child_node(:send).to_a - end - end - def after_commit_callback?(node) AFTER_COMMIT_CALLBACKS.include?(node.method_name) end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/application_controller.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/application_controller.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/application_controller.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/application_job.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/application_job.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/application_job.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/application_job.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/application_mailer.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/application_mailer.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/application_mailer.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/application_record.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/application_record.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/application_record.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/arel_star.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/arel_star.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/arel_star.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/arel_star.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/assert_not.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/assert_not.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/assert_not.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/assert_not.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/attribute_default_block_value.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/attribute_default_block_value.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/belongs_to.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/belongs_to.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/belongs_to.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/belongs_to.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/blank.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/blank.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/bulk_change_table.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/bulk_change_table.rb similarity index 92% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/bulk_change_table.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/bulk_change_table.rb index fab0fa5796..d29cbe5bd0 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/bulk_change_table.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/bulk_change_table.rb @@ -155,17 +155,31 @@ module RuboCop return if include_bulk_options?(node) return unless node.block_node - send_nodes = node.block_node.body.each_child_node(:send).to_a + send_nodes = send_nodes_from_change_table_block(node.block_node.body) - transformations = send_nodes.select do |send_node| - combinable_transformations.include?(send_node.method_name) - end - - add_offense_for_change_table(node) if transformations.size > 1 + add_offense_for_change_table(node) if count_transformations(send_nodes) > 1 end private + def send_nodes_from_change_table_block(body) + if body.send_type? + [body] + else + body.each_child_node(:send).to_a + end + end + + def count_transformations(send_nodes) + send_nodes.sum do |node| + if node.method?(:remove) + node.arguments.count { |arg| !arg.hash_type? } + else + combinable_transformations.include?(node.method_name) ? 1 : 0 + end + end + end + # @param node [RuboCop::AST::SendNode] (send nil? :change_table ...) def include_bulk_options?(node) # arguments: [{(sym :table)(str "table")} (hash (pair (sym :bulk) _))] diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/compact_blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/compact_blank.rb similarity index 72% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/compact_blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/compact_blank.rb index 9587fc1772..dadd8356c8 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/compact_blank.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/compact_blank.rb @@ -13,6 +13,12 @@ module RuboCop # `[[1, 2], [3, nil]].compact_blank` are not compatible. The same is true for `blank?`. # This will work fine when the receiver is a hash object. # + # And `compact_blank!` has different implementations for `Array`, `Hash`, and + # `ActionController::Parameters`. + # `Array#compact_blank!`, `Hash#compact_blank!` are equivalent to `delete_if(&:blank?)`. + # `ActionController::Parameters#compact_blank!` is equivalent to `reject!(&:blank?)`. + # If the cop makes a mistake, auto-corrected code may get unexpected behavior. + # # @example # # # bad @@ -23,8 +29,10 @@ module RuboCop # collection.compact_blank # # # bad - # collection.reject!(&:blank?) - # collection.reject! { |_k, v| v.blank? } + # collection.delete_if(&:blank?) # Same behavior as `Array#compact_blank!` and `Hash#compact_blank!` + # collection.delete_if { |_k, v| v.blank? } # Same behavior as `Array#compact_blank!` and `Hash#compact_blank!` + # collection.reject!(&:blank?) # Same behavior as `ActionController::Parameters#compact_blank!` + # collection.reject! { |_k, v| v.blank? } # Same behavior as `ActionController::Parameters#compact_blank!` # # # good # collection.compact_blank! @@ -35,20 +43,20 @@ module RuboCop extend TargetRailsVersion MSG = 'Use `%s` instead.' - RESTRICT_ON_SEND = %i[reject reject!].freeze + RESTRICT_ON_SEND = %i[reject delete_if reject!].freeze minimum_target_rails_version 6.1 def_node_matcher :reject_with_block?, <<~PATTERN (block - (send _ {:reject :reject!}) + (send _ {:reject :delete_if :reject!}) $(args ...) (send $(lvar _) :blank?)) PATTERN def_node_matcher :reject_with_block_pass?, <<~PATTERN - (send _ {:reject :reject!} + (send _ {:reject :delete_if :reject!} (block_pass (sym :blank?))) PATTERN diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/content_tag.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/content_tag.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/content_tag.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/content_tag.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/create_table_with_timestamps.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/create_table_with_timestamps.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/create_table_with_timestamps.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/create_table_with_timestamps.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/date.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/date.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/date.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/date.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/default_scope.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/default_scope.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/default_scope.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/delegate.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/delegate.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/delegate.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/delegate.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/delegate_allow_blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/delegate_allow_blank.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/delegate_allow_blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/delegate_allow_blank.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/deprecated_active_model_errors_methods.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/deprecated_active_model_errors_methods.rb new file mode 100644 index 0000000000..d77863972e --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/deprecated_active_model_errors_methods.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module Rails + # This cop checks direct manipulation of ActiveModel#errors as hash. + # These operations are deprecated in Rails 6.1 and will not work in Rails 7. + # + # @safety + # This cop is unsafe because it can report `errors` manipulation on non-ActiveModel, + # which is obviously valid. + # The cop has no way of knowing whether a variable is an ActiveModel or not. + # + # @example + # # bad + # user.errors[:name] << 'msg' + # user.errors.messages[:name] << 'msg' + # + # # good + # user.errors.add(:name, 'msg') + # + # # bad + # user.errors[:name].clear + # user.errors.messages[:name].clear + # + # # good + # user.errors.delete(:name) + # + class DeprecatedActiveModelErrorsMethods < Base + MSG = 'Avoid manipulating ActiveModel errors as hash directly.' + + MANIPULATIVE_METHODS = Set[ + *%i[ + << append clear collect! compact! concat + delete delete_at delete_if drop drop_while fill filter! keep_if + flatten! insert map! pop prepend push reject! replace reverse! + rotate! select! shift shuffle! slice! sort! sort_by! uniq! unshift + ] + ].freeze + + def_node_matcher :receiver_matcher_outside_model, '{send ivar lvar}' + def_node_matcher :receiver_matcher_inside_model, '{nil? send ivar lvar}' + + def_node_matcher :any_manipulation?, <<~PATTERN + { + #root_manipulation? + #root_assignment? + #messages_details_manipulation? + #messages_details_assignment? + } + PATTERN + + def_node_matcher :root_manipulation?, <<~PATTERN + (send + (send + (send #receiver_matcher :errors) :[] ...) + MANIPULATIVE_METHODS + ... + ) + PATTERN + + def_node_matcher :root_assignment?, <<~PATTERN + (send + (send #receiver_matcher :errors) + :[]= + ...) + PATTERN + + def_node_matcher :messages_details_manipulation?, <<~PATTERN + (send + (send + (send + (send #receiver_matcher :errors) + {:messages :details}) + :[] + ...) + MANIPULATIVE_METHODS + ...) + PATTERN + + def_node_matcher :messages_details_assignment?, <<~PATTERN + (send + (send + (send #receiver_matcher :errors) + {:messages :details}) + :[]= + ...) + PATTERN + + def on_send(node) + any_manipulation?(node) do + add_offense(node) + end + end + + private + + def receiver_matcher(node) + model_file? ? receiver_matcher_inside_model(node) : receiver_matcher_outside_model(node) + end + + def model_file? + processed_source.buffer.name.include?('/models/') + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/duplicate_association.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/duplicate_association.rb new file mode 100644 index 0000000000..3c1da3ec07 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/duplicate_association.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module Rails + # This cop looks for associations that have been defined multiple times in the same file. + # + # When an association is defined multiple times on a model, Active Record overrides the + # previously defined association with the new one. Because of this, this cop's autocorrection + # simply keeps the last of any duplicates and discards the rest. + # + # @example + # + # # bad + # belongs_to :foo + # belongs_to :bar + # has_one :foo + # + # # good + # belongs_to :bar + # has_one :foo + # + class DuplicateAssociation < Base + include RangeHelp + extend AutoCorrector + include ClassSendNodeHelper + + MSG = "Association `%s` is defined multiple times. Don't repeat associations." + + def_node_matcher :association, <<~PATTERN + (send nil? {:belongs_to :has_one :has_many :has_and_belongs_to_many} ({sym str} $_) ...) + PATTERN + + def on_class(class_node) + offenses(class_node).each do |name, nodes| + nodes.each do |node| + add_offense(node, message: format(MSG, name: name)) do |corrector| + next if nodes.last == node + + corrector.remove(range_by_whole_lines(node.source_range, include_final_newline: true)) + end + end + end + end + + private + + def offenses(class_node) + class_send_nodes(class_node).select { |node| association(node) } + .group_by { |node| association(node).to_sym } + .select { |_, nodes| nodes.length > 1 } + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/duplicate_scope.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/duplicate_scope.rb new file mode 100644 index 0000000000..e3a33ce4e5 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/duplicate_scope.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module Rails + # This cop checks for multiple scopes in a model that have the same `where` clause. This + # often means you copy/pasted a scope, updated the name, and forgot to change the condition. + # + # @example + # + # # bad + # scope :visible, -> { where(visible: true) } + # scope :hidden, -> { where(visible: true) } + # + # # good + # scope :visible, -> { where(visible: true) } + # scope :hidden, -> { where(visible: false) } + # + class DuplicateScope < Base + include ClassSendNodeHelper + + MSG = 'Multiple scopes share this same where clause.' + + def_node_matcher :scope, <<~PATTERN + (send nil? :scope _ $...) + PATTERN + + def on_class(class_node) + offenses(class_node).each do |node| + add_offense(node) + end + end + + private + + def offenses(class_node) + class_send_nodes(class_node).select { |node| scope(node) } + .group_by { |node| scope(node) } + .select { |_, nodes| nodes.length > 1 } + .values + .flatten + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/duration_arithmetic.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/duration_arithmetic.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/duration_arithmetic.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/duration_arithmetic.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/dynamic_find_by.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/dynamic_find_by.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/dynamic_find_by.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/dynamic_find_by.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/eager_evaluation_log_message.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/eager_evaluation_log_message.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/eager_evaluation_log_message.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/eager_evaluation_log_message.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/enum_hash.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/enum_hash.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/enum_hash.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/enum_hash.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/enum_uniqueness.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/enum_uniqueness.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/enum_uniqueness.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/environment_comparison.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/environment_comparison.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/environment_comparison.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/environment_comparison.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/environment_variable_access.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/environment_variable_access.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/environment_variable_access.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/exit.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/exit.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/exit.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/exit.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/expanded_date_range.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/expanded_date_range.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/expanded_date_range.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/file_path.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/file_path.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/file_path.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/file_path.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/find_by.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/find_by.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/find_by.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/find_by_id.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/find_by_id.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/find_by_id.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/find_by_id.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/find_each.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/find_each.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/find_each.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/find_each.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/has_and_belongs_to_many.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/has_and_belongs_to_many.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/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.14.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.13.2/lib/rubocop/cop/rails/helper_instance_variable.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/helper_instance_variable.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/helper_instance_variable.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/http_positional_arguments.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/http_positional_arguments.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/http_positional_arguments.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/http_positional_arguments.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/http_status.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/http_status.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/http_status.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/http_status.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/i18n_lazy_lookup.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/i18n_lazy_lookup.rb new file mode 100644 index 0000000000..d3093ea23d --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/i18n_lazy_lookup.rb @@ -0,0 +1,94 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module Rails + # This cop checks for places where I18n "lazy" lookup can be used. + # + # @example + # # en.yml + # # en: + # # books: + # # create: + # # success: Book created! + # + # # bad + # class BooksController < ApplicationController + # def create + # # ... + # redirect_to books_url, notice: t('books.create.success') + # end + # end + # + # # good + # class BooksController < ApplicationController + # def create + # # ... + # redirect_to books_url, notice: t('.success') + # end + # end + # + class I18nLazyLookup < Base + include VisibilityHelp + extend AutoCorrector + + MSG = 'Use "lazy" lookup for the text used in controllers.' + + def_node_matcher :translate_call?, <<~PATTERN + (send nil? {:translate :t} ${sym_type? str_type?} ...) + PATTERN + + def on_send(node) + translate_call?(node) do |key_node| + key = key_node.value + return if key.to_s.start_with?('.') + + controller, action = controller_and_action(node) + return unless controller && action + + scoped_key = get_scoped_key(key_node, controller, action) + return unless key == scoped_key + + add_offense(key_node) do |corrector| + unscoped_key = key_node.value.to_s.split('.').last + corrector.replace(key_node, "'.#{unscoped_key}'") + end + end + end + + private + + def controller_and_action(node) + action_node = node.each_ancestor(:def).first + return unless action_node && node_visibility(action_node) == :public + + controller_node = node.each_ancestor(:class).first + return unless controller_node && controller_node.identifier.source.end_with?('Controller') + + [controller_node, action_node] + end + + def get_scoped_key(key_node, controller, action) + path = controller_path(controller).tr('/', '.') + action_name = action.method_name + key = key_node.value.to_s.split('.').last + + "#{path}.#{action_name}.#{key}" + end + + def controller_path(controller) + module_name = controller.parent_module_name + controller_name = controller.identifier.source + + path = if module_name == 'Object' + controller_name + else + "#{module_name}::#{controller_name}" + end + + path.delete_suffix('Controller').underscore + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/i18n_locale_assignment.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/i18n_locale_assignment.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/i18n_locale_assignment.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/i18n_locale_texts.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/i18n_locale_texts.rb new file mode 100644 index 0000000000..353adac504 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/i18n_locale_texts.rb @@ -0,0 +1,110 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module Rails + # Enforces use of I18n and locale files instead of locale specific strings. + # + # @example + # # bad + # class User < ApplicationRecord + # validates :email, presence: { message: "must be present" } + # end + # + # # good + # # config/locales/en.yml + # # en: + # # activerecord: + # # errors: + # # models: + # # user: + # # blank: "must be present" + # + # class User < ApplicationRecord + # validates :email, presence: true + # end + # + # # bad + # class PostsController < ApplicationController + # def create + # # ... + # redirect_to root_path, notice: "Post created!" + # end + # end + # + # # good + # # config/locales/en.yml + # # en: + # # posts: + # # create: + # # success: "Post created!" + # + # class PostsController < ApplicationController + # def create + # # ... + # redirect_to root_path, notice: t(".success") + # end + # end + # + # # bad + # class UserMailer < ApplicationMailer + # def welcome(user) + # mail(to: user.email, subject: "Welcome to My Awesome Site") + # end + # end + # + # # good + # # config/locales/en.yml + # # en: + # # user_mailer: + # # welcome: + # # subject: "Welcome to My Awesome Site" + # + # class UserMailer < ApplicationMailer + # def welcome(user) + # mail(to: user.email) + # end + # end + # + class I18nLocaleTexts < Base + MSG = 'Move locale texts to the locale files in the `config/locales` directory.' + + RESTRICT_ON_SEND = %i[validates redirect_to []= mail].freeze + + def_node_search :validation_message, <<~PATTERN + (pair (sym :message) $str) + PATTERN + + def_node_search :redirect_to_flash, <<~PATTERN + (pair (sym {:notice :alert}) $str) + PATTERN + + def_node_matcher :flash_assignment?, <<~PATTERN + (send (send nil? :flash) :[]= _ $str) + PATTERN + + def_node_search :mail_subject, <<~PATTERN + (pair (sym :subject) $str) + PATTERN + + def on_send(node) + case node.method_name + when :validates + validation_message(node) do |text_node| + add_offense(text_node) + end + return + when :redirect_to + text_node = redirect_to_flash(node).to_a.last + when :[]= + text_node = flash_assignment?(node) + when :mail + text_node = mail_subject(node).to_a.last + end + + add_offense(text_node) if text_node + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/ignored_skip_action_filter_option.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/ignored_skip_action_filter_option.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/index_by.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/index_by.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/index_by.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/index_with.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/index_with.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/index_with.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/inquiry.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/inquiry.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/inquiry.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/inquiry.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/inverse_of.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/inverse_of.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/inverse_of.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/lexically_scoped_action_filter.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/lexically_scoped_action_filter.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/link_to_blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/link_to_blank.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/link_to_blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/link_to_blank.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/mailer_name.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/mailer_name.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/mailer_name.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/mailer_name.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/match_route.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/match_route.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/match_route.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/migration_class_name.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/migration_class_name.rb new file mode 100644 index 0000000000..09d9011743 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/migration_class_name.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module Rails + # This cop makes sure that each migration file defines a migration class + # whose name matches the file name. + # (e.g. `20220224111111_create_users.rb` should define `CreateUsers` class.) + # + # @example + # # db/migrate/20220224111111_create_users.rb + # + # # bad + # class SellBooks < ActiveRecord::Migration[7.0] + # end + # + # # good + # class CreateUsers < ActiveRecord::Migration[7.0] + # end + # + class MigrationClassName < Base + extend AutoCorrector + + MSG = 'Replace with `%s` that matches the file name.' + + def on_class(node) + snake_class_name = to_snakecase(node.identifier.source) + + return if snake_class_name == basename_without_timestamp + + corrected_class_name = to_camelcase(basename_without_timestamp) + message = format(MSG, corrected_class_name: corrected_class_name) + + add_offense(node.identifier, message: message) do |corrector| + corrector.replace(node.identifier, corrected_class_name) + end + end + + private + + def basename_without_timestamp + filepath = processed_source.file_path + basename = File.basename(filepath, '.rb') + basename.sub(/\A\d+_/, '') + end + + def to_camelcase(word) + word.split('_').map(&:capitalize).join + end + + def to_snakecase(word) + word + .gsub(/([A-Z\d]+)([A-Z][a-z])/, '\1_\2') + .gsub(/([a-z\d])([A-Z])/, '\1_\2') + .tr('-', '_') + .downcase + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/negate_include.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/negate_include.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/negate_include.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/not_null_column.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/not_null_column.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/not_null_column.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/order_by_id.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/order_by_id.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/order_by_id.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/output.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/output.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/output.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/output.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/output_safety.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/output_safety.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/output_safety.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/output_safety.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/pick.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/pick.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/pick.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/pick.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/pluck.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/pluck.rb similarity index 63% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/pluck.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/pluck.rb index 332e5ac94b..ffb42fb1fc 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/pluck.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/pluck.rb @@ -21,25 +21,31 @@ module RuboCop extend AutoCorrector extend TargetRailsVersion - MSG = 'Prefer `pluck(:%s)` over `%s { |%s| %s[:%s] }`.' + MSG = 'Prefer `pluck(:%s)` over `%s`.' minimum_target_rails_version 5.0 def_node_matcher :pluck_candidate?, <<~PATTERN - (block (send _ ${:map :collect}) (args (arg $_argument)) (send (lvar $_element) :[] (sym $_value))) + ({block numblock} (send _ {:map :collect}) $_argument (send (lvar $_element) :[] (sym $_value))) PATTERN def on_block(node) - pluck_candidate?(node) do |method, argument, element, value| - next unless argument == element + pluck_candidate?(node) do |argument, element, value| + match = if node.block_type? + argument.children.first.source.to_sym == element + else # numblock + argument == 1 && element == :_1 + end + next unless match - message = message(method, argument, element, value) + message = message(value, node) add_offense(offense_range(node), message: message) do |corrector| corrector.replace(offense_range(node), "pluck(:#{value})") end end end + alias on_numblock on_block private @@ -47,8 +53,10 @@ module RuboCop node.send_node.loc.selector.join(node.loc.end) end - def message(method, argument, element, value) - format(MSG, method: method, argument: argument, element: element, value: value) + def message(value, node) + current = offense_range(node).source + + format(MSG, value: value, current: current) end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/pluck_id.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/pluck_id.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/pluck_id.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/pluck_id.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/pluck_in_where.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/pluck_in_where.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/pluck_in_where.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/pluralization_grammar.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/pluralization_grammar.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/pluralization_grammar.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/presence.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/presence.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/presence.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/presence.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/present.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/present.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/present.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/present.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/rake_environment.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/rake_environment.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/rake_environment.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/rake_environment.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/read_write_attribute.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/read_write_attribute.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/read_write_attribute.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/read_write_attribute.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/redundant_allow_nil.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/redundant_allow_nil.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/redundant_allow_nil.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/redundant_allow_nil.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/redundant_foreign_key.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/redundant_foreign_key.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/redundant_foreign_key.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/redundant_foreign_key.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/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.14.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.13.2/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/redundant_travel_back.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/redundant_travel_back.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/redundant_travel_back.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/reflection_class_name.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/reflection_class_name.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/reflection_class_name.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/reflection_class_name.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/refute_methods.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/refute_methods.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/refute_methods.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/relative_date_constant.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/relative_date_constant.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/relative_date_constant.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/relative_date_constant.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/render_inline.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/render_inline.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/render_inline.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/render_plain_text.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/render_plain_text.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/render_plain_text.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/request_referer.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/request_referer.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/request_referer.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/require_dependency.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/require_dependency.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/require_dependency.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/reversible_migration.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/reversible_migration.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/reversible_migration.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/reversible_migration_method_definition.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/reversible_migration_method_definition.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/root_join_chain.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/root_join_chain.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/root_join_chain.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/root_join_chain.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/safe_navigation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/safe_navigation.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/safe_navigation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/safe_navigation.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/safe_navigation_with_blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/safe_navigation_with_blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/save_bang.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/save_bang.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/save_bang.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/schema_comment.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/schema_comment.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/schema_comment.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/scope_args.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/scope_args.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/scope_args.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/short_i18n.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/short_i18n.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/short_i18n.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/skips_model_validations.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/skips_model_validations.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/skips_model_validations.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/squished_sql_heredocs.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/squished_sql_heredocs.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/squished_sql_heredocs.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/table_name_assignment.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/table_name_assignment.rb new file mode 100644 index 0000000000..ad342b4687 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/table_name_assignment.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module Rails + # This cop enforces the absence of explicit table name assignment. + # + # `self.table_name=` should only be used for very good reasons, + # such as not having control over the database, or working + # on a legacy project. + # + # If you need to change how your model's name is translated to + # a table name, you may want to look at Inflections: + # https://api.rubyonrails.org/classes/ActiveSupport/Inflector/Inflections.html + # + # If you wish to add a prefix in front of your model, or wish to change + # the default prefix, `self.table_name_prefix` might better suit your needs: + # https://api.rubyonrails.org/classes/ActiveRecord/ModelSchema.html#method-c-table_name_prefix-3D + # + # STI base classes named `Base` are ignored by this cop. + # For more information: https://api.rubyonrails.org/classes/ActiveRecord/Inheritance.html + # + # @example + # # bad + # self.table_name = 'some_table_name' + # self.table_name = :some_other_name + class TableNameAssignment < Base + include ActiveRecordHelper + + MSG = 'Do not use `self.table_name =`.' + + def_node_matcher :base_class?, <<~PATTERN + (class (const ... :Base) ...) + PATTERN + + def on_class(class_node) + return if base_class?(class_node) + + find_set_table_name(class_node).each { |node| add_offense(node) } + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/time_zone.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/time_zone.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/time_zone.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/time_zone.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/time_zone_assignment.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/time_zone_assignment.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/time_zone_assignment.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/transaction_exit_statement.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/transaction_exit_statement.rb new file mode 100644 index 0000000000..742154418a --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/transaction_exit_statement.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module Rails + # This cop checks for the use of exit statements (namely `return`, + # `break` and `throw`) in transactions. This is due to the eventual + # unexpected behavior when using ActiveRecord >= 7, where transactions + # exitted using these statements are being rollbacked rather than + # committed (pre ActiveRecord 7 behavior). + # + # As alternatives, it would be more intuitive to explicitly raise an + # error when rollback is desired, and to use `next` when commit is + # desired. + # + # @example + # # bad + # ApplicationRecord.transaction do + # return if user.active? + # end + # + # # bad + # ApplicationRecord.transaction do + # break if user.active? + # end + # + # # bad + # ApplicationRecord.transaction do + # throw if user.active? + # end + # + # # good + # ApplicationRecord.transaction do + # # Rollback + # raise "User is active" if user.active? + # end + # + # # good + # ApplicationRecord.transaction do + # # Commit + # next if user.active? + # end + # + # @see https://github.com/rails/rails/commit/15aa4200e083 + class TransactionExitStatement < Base + MSG = <<~MSG.chomp + Exit statement `%s` is not allowed. Use `raise` (rollback) or `next` (commit). + MSG + + RESTRICT_ON_SEND = %i[transaction].freeze + + def_node_search :exit_statements, <<~PATTERN + ({return | break | send nil? :throw} ...) + PATTERN + + def on_send(node) + parent = node.parent + + return unless parent&.block_type? + + exit_statements(parent.body).each do |statement_node| + statement = if statement_node.return_type? + 'return' + elsif statement_node.break_type? + 'break' + else + statement_node.method_name + end + message = format(MSG, statement: statement) + + add_offense(statement_node, message: message) + end + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/uniq_before_pluck.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/uniq_before_pluck.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/uniq_before_pluck.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/unique_validation_without_index.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/unique_validation_without_index.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/unique_validation_without_index.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/unique_validation_without_index.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/unknown_env.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/unknown_env.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/unknown_env.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/unused_ignored_columns.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/cop/rails/unused_ignored_columns.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/unused_ignored_columns.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/validation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/validation.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/validation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/validation.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/where_equals.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/where_equals.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/where_equals.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/where_equals.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/where_exists.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/where_exists.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/where_exists.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/where_exists.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/where_not.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/where_not.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails/where_not.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails/where_not.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails_cops.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails_cops.rb similarity index 90% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails_cops.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails_cops.rb index fadc00b347..0615c7a2f9 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/cop/rails_cops.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/cop/rails_cops.rb @@ -2,11 +2,13 @@ require_relative 'mixin/active_record_helper' require_relative 'mixin/active_record_migrations_helper' +require_relative 'mixin/class_send_node_helper' require_relative 'mixin/enforce_superclass' require_relative 'mixin/index_method' require_relative 'mixin/migrations_helper' require_relative 'mixin/target_rails_version' +require_relative 'rails/action_controller_test_case' require_relative 'rails/action_filter' require_relative 'rails/active_record_aliases' require_relative 'rails/active_record_callbacks_order' @@ -31,6 +33,9 @@ require_relative 'rails/date' require_relative 'rails/default_scope' require_relative 'rails/delegate' require_relative 'rails/delegate_allow_blank' +require_relative 'rails/deprecated_active_model_errors_methods' +require_relative 'rails/duplicate_association' +require_relative 'rails/duplicate_scope' require_relative 'rails/duration_arithmetic' require_relative 'rails/dynamic_find_by' require_relative 'rails/eager_evaluation_log_message' @@ -49,7 +54,9 @@ require_relative 'rails/has_many_or_has_one_dependent' require_relative 'rails/helper_instance_variable' require_relative 'rails/http_positional_arguments' require_relative 'rails/http_status' +require_relative 'rails/i18n_lazy_lookup' require_relative 'rails/i18n_locale_assignment' +require_relative 'rails/i18n_locale_texts' require_relative 'rails/ignored_skip_action_filter_option' require_relative 'rails/index_by' require_relative 'rails/index_with' @@ -59,6 +66,7 @@ require_relative 'rails/lexically_scoped_action_filter' require_relative 'rails/link_to_blank' require_relative 'rails/mailer_name' require_relative 'rails/match_route' +require_relative 'rails/migration_class_name' require_relative 'rails/negate_include' require_relative 'rails/not_null_column' require_relative 'rails/order_by_id' @@ -96,8 +104,10 @@ require_relative 'rails/scope_args' require_relative 'rails/short_i18n' require_relative 'rails/skips_model_validations' require_relative 'rails/squished_sql_heredocs' +require_relative 'rails/table_name_assignment' require_relative 'rails/time_zone' require_relative 'rails/time_zone_assignment' +require_relative 'rails/transaction_exit_statement' require_relative 'rails/uniq_before_pluck' require_relative 'rails/unique_validation_without_index' require_relative 'rails/unknown_env' diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/rails.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/rails.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/rails.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/rails.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/rails/inject.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/rails/inject.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/rails/inject.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/rails/inject.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/rails/schema_loader.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/rails/schema_loader.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/rails/schema_loader.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/rails/schema_loader.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/rails/schema_loader/schema.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2/lib/rubocop/rails/schema_loader/schema.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/rails/schema_loader/schema.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/rails/version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/rails/version.rb similarity index 90% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/rails/version.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.0/lib/rubocop/rails/version.rb index 703bef1c8c..eb99c8c307 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.13.2/lib/rubocop/rails/version.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.14.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.13.2' + STRING = '2.14.0' def self.document_version STRING.match('\d+\.\d+').to_s From 23f4c5a3a03ce9c6eed0b390793b22654e5032b3 Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Tue, 15 Mar 2022 18:11:43 +0000 Subject: [PATCH 3/3] Update RBI files for rubocop-rails. --- ...ls@2.13.2.rbi => rubocop-rails@2.14.0.rbi} | 127 +++++++++++++++++- .../sorbet/rbi/hidden-definitions/hidden.rbi | 4 + 2 files changed, 129 insertions(+), 2 deletions(-) rename Library/Homebrew/sorbet/rbi/gems/{rubocop-rails@2.13.2.rbi => rubocop-rails@2.14.0.rbi} (94%) diff --git a/Library/Homebrew/sorbet/rbi/gems/rubocop-rails@2.13.2.rbi b/Library/Homebrew/sorbet/rbi/gems/rubocop-rails@2.14.0.rbi similarity index 94% rename from Library/Homebrew/sorbet/rbi/gems/rubocop-rails@2.13.2.rbi rename to Library/Homebrew/sorbet/rbi/gems/rubocop-rails@2.14.0.rbi index d0902566ab..b32d81569f 100644 --- a/Library/Homebrew/sorbet/rbi/gems/rubocop-rails@2.13.2.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/rubocop-rails@2.14.0.rbi @@ -36,6 +36,10 @@ RuboCop::Cop::ActiveRecordMigrationsHelper::POSTGRES_SCHEMA_DEFINITIONS = T.let( RuboCop::Cop::ActiveRecordMigrationsHelper::RAILS_ABSTRACT_SCHEMA_DEFINITIONS = T.let(T.unsafe(nil), Array) RuboCop::Cop::ActiveRecordMigrationsHelper::RAILS_ABSTRACT_SCHEMA_DEFINITIONS_HELPERS = T.let(T.unsafe(nil), Array) +module RuboCop::Cop::ClassSendNodeHelper + def class_send_nodes(class_node); end +end + module RuboCop::Cop::EnforceSuperclass def on_class(node); end def on_send(node); end @@ -119,6 +123,16 @@ end module RuboCop::Cop::Rails; end +class RuboCop::Cop::Rails::ActionControllerTestCase < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRailsVersion + + def action_controller_test_case?(param0 = T.unsafe(nil)); end + def on_class(node); end +end + +RuboCop::Cop::Rails::ActionControllerTestCase::MSG = T.let(T.unsafe(nil), String) + class RuboCop::Cop::Rails::ActionFilter < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector @@ -217,12 +231,13 @@ RuboCop::Cop::Rails::AddColumnIndex::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Rails::AddColumnIndex::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) class RuboCop::Cop::Rails::AfterCommitOverride < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ClassSendNodeHelper + def on_class(class_node); end private def after_commit_callback?(node); end - def class_send_nodes(class_node); end def each_after_commit_callback(class_node); end def named_callback?(node); end end @@ -364,10 +379,12 @@ class RuboCop::Cop::Rails::BulkChangeTable < ::RuboCop::Cop::Base def call_to_combinable_alter_method?(child_node); end def combinable_alter_methods; end def combinable_transformations; end + def count_transformations(send_nodes); end def database; end def database_from_yaml; end def database_yaml; end def include_bulk_options?(node); end + def send_nodes_from_change_table_block(body); end def support_bulk_alter?; end end @@ -521,6 +538,53 @@ end RuboCop::Cop::Rails::DelegateAllowBlank::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Rails::DelegateAllowBlank::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) +class RuboCop::Cop::Rails::DeprecatedActiveModelErrorsMethods < ::RuboCop::Cop::Base + def any_manipulation?(param0 = T.unsafe(nil)); end + def messages_details_assignment?(param0 = T.unsafe(nil)); end + def messages_details_manipulation?(param0 = T.unsafe(nil)); end + def on_send(node); end + def receiver_matcher_inside_model(param0 = T.unsafe(nil)); end + def receiver_matcher_outside_model(param0 = T.unsafe(nil)); end + def root_assignment?(param0 = T.unsafe(nil)); end + def root_manipulation?(param0 = T.unsafe(nil)); end + + private + + def model_file?; end + def receiver_matcher(node); end +end + +RuboCop::Cop::Rails::DeprecatedActiveModelErrorsMethods::MANIPULATIVE_METHODS = T.let(T.unsafe(nil), Set) +RuboCop::Cop::Rails::DeprecatedActiveModelErrorsMethods::MSG = T.let(T.unsafe(nil), String) + +class RuboCop::Cop::Rails::DuplicateAssociation < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::ClassSendNodeHelper + extend ::RuboCop::Cop::AutoCorrector + + def association(param0 = T.unsafe(nil)); end + def on_class(class_node); end + + private + + def offenses(class_node); end +end + +RuboCop::Cop::Rails::DuplicateAssociation::MSG = T.let(T.unsafe(nil), String) + +class RuboCop::Cop::Rails::DuplicateScope < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ClassSendNodeHelper + + def on_class(class_node); end + def scope(param0 = T.unsafe(nil)); end + + private + + def offenses(class_node); end +end + +RuboCop::Cop::Rails::DuplicateScope::MSG = T.let(T.unsafe(nil), String) + class RuboCop::Cop::Rails::DurationArithmetic < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector @@ -877,6 +941,22 @@ end RuboCop::Cop::Rails::HttpStatus::SymbolicStyleChecker::DEFAULT_MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Rails::HttpStatus::SymbolicStyleChecker::MSG = T.let(T.unsafe(nil), String) +class RuboCop::Cop::Rails::I18nLazyLookup < ::RuboCop::Cop::Base + include ::RuboCop::Cop::VisibilityHelp + extend ::RuboCop::Cop::AutoCorrector + + def on_send(node); end + def translate_call?(param0 = T.unsafe(nil)); end + + private + + def controller_and_action(node); end + def controller_path(controller); end + def get_scoped_key(key_node, controller, action); end +end + +RuboCop::Cop::Rails::I18nLazyLookup::MSG = T.let(T.unsafe(nil), String) + class RuboCop::Cop::Rails::I18nLocaleAssignment < ::RuboCop::Cop::Base def i18n_locale_assignment?(param0 = T.unsafe(nil)); end def on_send(node); end @@ -885,6 +965,17 @@ end RuboCop::Cop::Rails::I18nLocaleAssignment::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Rails::I18nLocaleAssignment::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) +class RuboCop::Cop::Rails::I18nLocaleTexts < ::RuboCop::Cop::Base + def flash_assignment?(param0 = T.unsafe(nil)); end + def mail_subject(param0); end + def on_send(node); end + def redirect_to_flash(param0); end + def validation_message(param0); end +end + +RuboCop::Cop::Rails::I18nLocaleTexts::MSG = T.let(T.unsafe(nil), String) +RuboCop::Cop::Rails::I18nLocaleTexts::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + class RuboCop::Cop::Rails::IgnoredSkipActionFilterOption < ::RuboCop::Cop::Base def filter_options(param0 = T.unsafe(nil)); end def on_send(node); end @@ -1038,6 +1129,20 @@ RuboCop::Cop::Rails::MatchRoute::HTTP_METHODS = T.let(T.unsafe(nil), Array) RuboCop::Cop::Rails::MatchRoute::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Rails::MatchRoute::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) +class RuboCop::Cop::Rails::MigrationClassName < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + def on_class(node); end + + private + + def basename_without_timestamp; end + def to_camelcase(word); end + def to_snakecase(word); end +end + +RuboCop::Cop::Rails::MigrationClassName::MSG = T.let(T.unsafe(nil), String) + class RuboCop::Cop::Rails::NegateInclude < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector @@ -1131,11 +1236,12 @@ class RuboCop::Cop::Rails::Pluck < ::RuboCop::Cop::Base extend ::RuboCop::Cop::TargetRailsVersion def on_block(node); end + def on_numblock(node); end def pluck_candidate?(param0 = T.unsafe(nil)); end private - def message(method, argument, element, value); end + def message(value, node); end def offense_range(node); end end @@ -1692,6 +1798,15 @@ RuboCop::Cop::Rails::SquishedSQLHeredocs::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Rails::SquishedSQLHeredocs::SQL = T.let(T.unsafe(nil), String) RuboCop::Cop::Rails::SquishedSQLHeredocs::SQUISH = T.let(T.unsafe(nil), String) +class RuboCop::Cop::Rails::TableNameAssignment < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ActiveRecordHelper + + def base_class?(param0 = T.unsafe(nil)); end + def on_class(class_node); end +end + +RuboCop::Cop::Rails::TableNameAssignment::MSG = T.let(T.unsafe(nil), String) + class RuboCop::Cop::Rails::TimeZone < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector @@ -1736,6 +1851,14 @@ end RuboCop::Cop::Rails::TimeZoneAssignment::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Rails::TimeZoneAssignment::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) +class RuboCop::Cop::Rails::TransactionExitStatement < ::RuboCop::Cop::Base + def exit_statements(param0); end + def on_send(node); end +end + +RuboCop::Cop::Rails::TransactionExitStatement::MSG = T.let(T.unsafe(nil), String) +RuboCop::Cop::Rails::TransactionExitStatement::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + class RuboCop::Cop::Rails::UniqBeforePluck < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp diff --git a/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi b/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi index a7c8cb1acc..707ea7b76c 100644 --- a/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi +++ b/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi @@ -5027,7 +5027,11 @@ module RuboCop::AST::NodePattern::Sets SET_BUILD_RECOMMENDED_TEST_OPTIONAL = ::T.let(nil, ::T.untyped) SET_DEPENDS_ON_USES_FROM_MACOS = ::T.let(nil, ::T.untyped) SET_INCLUDE_WITH_WITHOUT = ::T.let(nil, ::T.untyped) + SET_MESSAGES_DETAILS = ::T.let(nil, ::T.untyped) + SET_NOTICE_ALERT = ::T.let(nil, ::T.untyped) + SET_REJECT_DELETE_IF_REJECT = ::T.let(nil, ::T.untyped) SET_SYSTEM_SHELL_OUTPUT_PIPE_OUTPUT = ::T.let(nil, ::T.untyped) + SET_TRANSLATE_T = ::T.let(nil, ::T.untyped) SET_WITH_WITHOUT = ::T.let(nil, ::T.untyped) end