# frozen_string_literal: true

require_relative 'mixin'

module RuboCop
  module Cop
    # Cops for the `Rails` department. The department's cops are registered for lazy loading
    # and their files are loaded on demand.
    module Rails
      extend LazyLoader

      register_cop :ActionControllerFlashBeforeRender, "#{__dir__}/rails/action_controller_flash_before_render"
      register_cop :StrongParametersExpect, "#{__dir__}/rails/strong_parameters_expect"
      register_cop :ActionControllerTestCase, "#{__dir__}/rails/action_controller_test_case"
      register_cop :ActionFilter, "#{__dir__}/rails/action_filter"
      register_cop :ActionOrder, "#{__dir__}/rails/action_order"
      register_cop :ActiveRecordAliases, "#{__dir__}/rails/active_record_aliases"
      register_cop :ActiveRecordCallbacksOrder, "#{__dir__}/rails/active_record_callbacks_order"
      register_cop :ActiveRecordOverride, "#{__dir__}/rails/active_record_override"
      register_cop :ActiveSupportAliases, "#{__dir__}/rails/active_support_aliases"
      register_cop :ActiveSupportOnLoad, "#{__dir__}/rails/active_support_on_load"
      register_cop :AddColumnIndex, "#{__dir__}/rails/add_column_index"
      register_cop :AfterCommitOverride, "#{__dir__}/rails/after_commit_override"
      register_cop :ApplicationController, "#{__dir__}/rails/application_controller"
      register_cop :ApplicationJob, "#{__dir__}/rails/application_job"
      register_cop :ApplicationMailer, "#{__dir__}/rails/application_mailer"
      register_cop :ApplicationRecord, "#{__dir__}/rails/application_record"
      register_cop :ArelStar, "#{__dir__}/rails/arel_star"
      register_cop :AssertNot, "#{__dir__}/rails/assert_not"
      register_cop :AttributeDefaultBlockValue, "#{__dir__}/rails/attribute_default_block_value"
      register_cop :BelongsTo, "#{__dir__}/rails/belongs_to"
      register_cop :Blank, "#{__dir__}/rails/blank"
      register_cop :BulkChangeTable, "#{__dir__}/rails/bulk_change_table"
      register_cop :CompactBlank, "#{__dir__}/rails/compact_blank"
      register_cop :ContentTag, "#{__dir__}/rails/content_tag"
      register_cop :CreateTableWithTimestamps, "#{__dir__}/rails/create_table_with_timestamps"
      register_cop :DangerousColumnNames, "#{__dir__}/rails/dangerous_column_names"
      register_cop :Date, "#{__dir__}/rails/date"
      register_cop :DefaultScope, "#{__dir__}/rails/default_scope"
      register_cop :Delegate, "#{__dir__}/rails/delegate"
      register_cop :DelegateAllowBlank, "#{__dir__}/rails/delegate_allow_blank"
      register_cop :DeprecatedActiveModelErrorsMethods, "#{__dir__}/rails/deprecated_active_model_errors_methods"
      register_cop :DotSeparatedKeys, "#{__dir__}/rails/dot_separated_keys"
      register_cop :DuplicateAssociation, "#{__dir__}/rails/duplicate_association"
      register_cop :DuplicateScope, "#{__dir__}/rails/duplicate_scope"
      register_cop :DurationArithmetic, "#{__dir__}/rails/duration_arithmetic"
      register_cop :DynamicFindBy, "#{__dir__}/rails/dynamic_find_by"
      register_cop :EagerEvaluationLogMessage, "#{__dir__}/rails/eager_evaluation_log_message"
      register_cop :EnumHash, "#{__dir__}/rails/enum_hash"
      register_cop :EnumSyntax, "#{__dir__}/rails/enum_syntax"
      register_cop :EnumUniqueness, "#{__dir__}/rails/enum_uniqueness"
      register_cop :Env, "#{__dir__}/rails/env"
      register_cop :EnvLocal, "#{__dir__}/rails/env_local"
      register_cop :EnvironmentComparison, "#{__dir__}/rails/environment_comparison"
      register_cop :EnvironmentVariableAccess, "#{__dir__}/rails/environment_variable_access"
      register_cop :Exit, "#{__dir__}/rails/exit"
      register_cop :ExpandedDateRange, "#{__dir__}/rails/expanded_date_range"
      register_cop :FilePath, "#{__dir__}/rails/file_path"
      register_cop :FindBy, "#{__dir__}/rails/find_by"
      register_cop :FindById, "#{__dir__}/rails/find_by_id"
      register_cop :FindByOrAssignmentMemoization, "#{__dir__}/rails/find_by_or_assignment_memoization"
      register_cop :FindEach, "#{__dir__}/rails/find_each"
      register_cop :FreezeTime, "#{__dir__}/rails/freeze_time"
      register_cop :HasAndBelongsToMany, "#{__dir__}/rails/has_and_belongs_to_many"
      register_cop :HasManyOrHasOneDependent, "#{__dir__}/rails/has_many_or_has_one_dependent"
      register_cop :HelperInstanceVariable, "#{__dir__}/rails/helper_instance_variable"
      register_cop :HttpPositionalArguments, "#{__dir__}/rails/http_positional_arguments"
      register_cop :HttpStatus, "#{__dir__}/rails/http_status"
      register_cop :HttpStatusNameConsistency, "#{__dir__}/rails/http_status_name_consistency"
      register_cop :I18nLazyLookup, "#{__dir__}/rails/i18n_lazy_lookup"
      register_cop :I18nLocaleAssignment, "#{__dir__}/rails/i18n_locale_assignment"
      register_cop :I18nLocaleTexts, "#{__dir__}/rails/i18n_locale_texts"
      register_cop :IgnoredColumnsAssignment, "#{__dir__}/rails/ignored_columns_assignment"
      register_cop :IgnoredSkipActionFilterOption, "#{__dir__}/rails/ignored_skip_action_filter_option"
      register_cop :IndexBy, "#{__dir__}/rails/index_by"
      register_cop :IndexWith, "#{__dir__}/rails/index_with"
      register_cop :Inquiry, "#{__dir__}/rails/inquiry"
      register_cop :InverseOf, "#{__dir__}/rails/inverse_of"
      register_cop :LexicallyScopedActionFilter, "#{__dir__}/rails/lexically_scoped_action_filter"
      register_cop :LinkToBlank, "#{__dir__}/rails/link_to_blank"
      register_cop :MailerName, "#{__dir__}/rails/mailer_name"
      register_cop :MatchRoute, "#{__dir__}/rails/match_route"
      register_cop :MigrationClassName, "#{__dir__}/rails/migration_class_name"
      register_cop :MultipleRoutePaths, "#{__dir__}/rails/multiple_route_paths"
      register_cop :NegateInclude, "#{__dir__}/rails/negate_include"
      register_cop :NotNullColumn, "#{__dir__}/rails/not_null_column"
      register_cop :OrderArguments, "#{__dir__}/rails/order_arguments"
      register_cop :OrderById, "#{__dir__}/rails/order_by_id"
      register_cop :Output, "#{__dir__}/rails/output"
      register_cop :OutputSafety, "#{__dir__}/rails/output_safety"
      register_cop :Pick, "#{__dir__}/rails/pick"
      register_cop :Pluck, "#{__dir__}/rails/pluck"
      register_cop :PluckId, "#{__dir__}/rails/pluck_id"
      register_cop :PluckInWhere, "#{__dir__}/rails/pluck_in_where"
      register_cop :PluralizationGrammar, "#{__dir__}/rails/pluralization_grammar"
      register_cop :Presence, "#{__dir__}/rails/presence"
      register_cop :Present, "#{__dir__}/rails/present"
      register_cop :RakeEnvironment, "#{__dir__}/rails/rake_environment"
      register_cop :ReadWriteAttribute, "#{__dir__}/rails/read_write_attribute"
      register_cop :RedundantActiveRecordAllMethod, "#{__dir__}/rails/redundant_active_record_all_method"
      register_cop :RedundantAllowNil, "#{__dir__}/rails/redundant_allow_nil"
      register_cop :RedundantForeignKey, "#{__dir__}/rails/redundant_foreign_key"
      register_cop :RedundantPresenceValidationOnBelongsTo, "#{__dir__}/rails/redundant_presence_validation_on_belongs_to"
      register_cop :RedundantReceiverInWithOptions, "#{__dir__}/rails/redundant_receiver_in_with_options"
      register_cop :RedundantTravelBack, "#{__dir__}/rails/redundant_travel_back"
      register_cop :RedirectBackOrTo, "#{__dir__}/rails/redirect_back_or_to"
      register_cop :ReflectionClassName, "#{__dir__}/rails/reflection_class_name"
      register_cop :RefuteMethods, "#{__dir__}/rails/refute_methods"
      register_cop :RelativeDateConstant, "#{__dir__}/rails/relative_date_constant"
      register_cop :RenderInline, "#{__dir__}/rails/render_inline"
      register_cop :RenderPlainText, "#{__dir__}/rails/render_plain_text"
      register_cop :RequestReferer, "#{__dir__}/rails/request_referer"
      register_cop :RequireDependency, "#{__dir__}/rails/require_dependency"
      register_cop :ResponseParsedBody, "#{__dir__}/rails/response_parsed_body"
      register_cop :ReversibleMigration, "#{__dir__}/rails/reversible_migration"
      register_cop :ReversibleMigrationMethodDefinition, "#{__dir__}/rails/reversible_migration_method_definition"
      register_cop :RootJoinChain, "#{__dir__}/rails/root_join_chain"
      register_cop :RootPathnameMethods, "#{__dir__}/rails/root_pathname_methods"
      register_cop :RootPublicPath, "#{__dir__}/rails/root_public_path"
      register_cop :SafeNavigation, "#{__dir__}/rails/safe_navigation"
      register_cop :SafeNavigationWithBlank, "#{__dir__}/rails/safe_navigation_with_blank"
      register_cop :SaveBang, "#{__dir__}/rails/save_bang"
      register_cop :SchemaComment, "#{__dir__}/rails/schema_comment"
      register_cop :ScopeArgs, "#{__dir__}/rails/scope_args"
      register_cop :SelectMap, "#{__dir__}/rails/select_map"
      register_cop :ShortI18n, "#{__dir__}/rails/short_i18n"
      register_cop :SkipsModelValidations, "#{__dir__}/rails/skips_model_validations"
      register_cop :SquishedSQLHeredocs, "#{__dir__}/rails/squished_sql_heredocs"
      register_cop :StripHeredoc, "#{__dir__}/rails/strip_heredoc"
      register_cop :TableNameAssignment, "#{__dir__}/rails/table_name_assignment"
      register_cop :ThreeStateBooleanColumn, "#{__dir__}/rails/three_state_boolean_column"
      register_cop :TimeZone, "#{__dir__}/rails/time_zone"
      register_cop :TimeZoneAssignment, "#{__dir__}/rails/time_zone_assignment"
      register_cop :ToFormattedS, "#{__dir__}/rails/to_formatted_s"
      register_cop :ToSWithArgument, "#{__dir__}/rails/to_s_with_argument"
      register_cop :TopLevelHashWithIndifferentAccess, "#{__dir__}/rails/top_level_hash_with_indifferent_access"
      register_cop :TransactionExitStatement, "#{__dir__}/rails/transaction_exit_statement"
      register_cop :UniqBeforePluck, "#{__dir__}/rails/uniq_before_pluck"
      register_cop :UniqueValidationWithoutIndex, "#{__dir__}/rails/unique_validation_without_index"
      register_cop :UnknownEnv, "#{__dir__}/rails/unknown_env"
      register_cop :UnusedIgnoredColumns, "#{__dir__}/rails/unused_ignored_columns"
      register_cop :UnusedRenderContent, "#{__dir__}/rails/unused_render_content"
      register_cop :Validation, "#{__dir__}/rails/validation"
      register_cop :WhereEquals, "#{__dir__}/rails/where_equals"
      register_cop :WhereExists, "#{__dir__}/rails/where_exists"
      register_cop :WhereMissing, "#{__dir__}/rails/where_missing"
      register_cop :WhereNot, "#{__dir__}/rails/where_not"
      register_cop :WhereNotWithMultipleConditions, "#{__dir__}/rails/where_not_with_multiple_conditions"
      register_cop :WhereRange, "#{__dir__}/rails/where_range"
    end
  end
end
