# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2026-03-26 21:32:30 UTC using RuboCop version 1.85.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 190
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowSafeAssignment.
Lint/AssignmentInCondition:
  Enabled: false

# Offense count: 16
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
Lint/DuplicateBranch:
  Exclude:
    - 'lib/mongo/address.rb'
    - 'lib/mongo/auth/aws/credentials_retriever.rb'
    - 'lib/mongo/collection/view/aggregation.rb'
    - 'lib/mongo/collection/view/builder/aggregation.rb'
    - 'lib/mongo/error/sdam_error_detection.rb'
    - 'lib/mongo/monitoring/event/secure.rb'
    - 'lib/mongo/operation/shared/sessions_supported.rb'
    - 'lib/mongo/protocol/serializers.rb'
    - 'lib/mongo/query_cache.rb'
    - 'lib/mongo/server_selector/base.rb'
    - 'lib/mongo/socket.rb'
    - 'spec/runners/sdam.rb'
    - 'spec/support/client_registry.rb'

# Offense count: 4
# This cop supports unsafe autocorrection (--autocorrect-all).
Lint/IncompatibleIoSelectWithFiberScheduler:
  Exclude:
    - 'lib/mongo/socket/ssl.rb'
    - 'lib/mongo/socket/tcp.rb'

# Offense count: 31
# Configuration parameters: AllowedParentClasses.
Lint/MissingSuper:
  Enabled: false

# Offense count: 1
Lint/MixedRegexpCaptureTypes:
  Exclude:
    - 'lib/mongo/crypt/binding.rb'

# Offense count: 2
Lint/NextWithoutAccumulator:
  Exclude:
    - 'lib/mongo/operation/shared/result/aggregatable.rb'

# Offense count: 1
Lint/NonLocalExitFromIterator:
  Exclude:
    - 'lib/mongo/uri/options_mapper.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedMethods, InferNonNilReceiver, AdditionalNilMethods.
# AllowedMethods: instance_of?, kind_of?, is_a?, eql?, respond_to?, equal?
# AdditionalNilMethods: present?, blank?, try, try!
Lint/RedundantSafeNavigation:
  Exclude:
    - 'lib/mongo/uri/options_mapper.rb'

# Offense count: 12
Lint/RescueException:
  Exclude:
    - 'lib/mongo/monitoring/command_log_subscriber.rb'
    - 'lib/mongo/server/connection.rb'
    - 'lib/mongo/server/connection_base.rb'
    - 'lib/mongo/server/connection_pool.rb'
    - 'lib/mongo/session.rb'
    - 'spec/mongo/server/connection_spec.rb'

# Offense count: 3
Lint/ShadowedException:
  Exclude:
    - 'lib/mongo/auth/aws/credentials_retriever.rb'
    - 'lib/mongo/socket/ssl.rb'

# Offense count: 35
# Configuration parameters: AllowComments, AllowNil.
Lint/SuppressedException:
  Enabled: false

# Offense count: 19
# Configuration parameters: AllowKeywordBlockArguments.
Lint/UnderscorePrefixedVariableName:
  Exclude:
    - 'lib/mongo/client.rb'
    - 'lib/mongo/monitoring/command_log_subscriber.rb'
    - 'lib/mongo/protocol/message.rb'
    - 'lib/mongo/query_cache.rb'
    - 'lib/mongo/server.rb'
    - 'lib/mongo/server/monitor/connection.rb'
    - 'lib/mongo/socket.rb'
    - 'spec/mongo/operation/read_preference_legacy_spec.rb'
    - 'spec/mongo/operation/read_preference_op_msg_spec.rb'
    - 'spec/mongo/server/monitor_spec.rb'
    - 'spec/support/local_resource_registry.rb'

# Offense count: 2
Lint/UnreachableCode:
  Exclude:
    - 'lib/mongo/protocol/serializers.rb'
    - 'spec/runners/unified/test.rb'

# Offense count: 2
# Configuration parameters: AllowedPatterns.
# AllowedPatterns: (?-mix:(exactly|at_least|at_most)\(\d+\)\.times)
Lint/UnreachableLoop:
  Exclude:
    - 'spec/integration/query_cache_spec.rb'
    - 'spec/mongo/cursor_spec.rb'

# Offense count: 5
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions.
# NotImplementedExceptions: NotImplementedError
Lint/UnusedMethodArgument:
  Exclude:
    - 'lib/mongo/collection/view/aggregation.rb'
    - 'spec/integration/aws_lambda_examples_spec.rb'

# Offense count: 6
# This cop supports unsafe autocorrection (--autocorrect-all).
Lint/UselessMethodDefinition:
  Exclude:
    - 'lib/mongo/error/failed_string_prep_validation.rb'
    - 'lib/mongo/error/insufficient_iteration_count.rb'
    - 'lib/mongo/error/invalid_server_preference.rb'
    - 'lib/mongo/error/invalid_session.rb'
    - 'lib/mongo/error/invalid_transaction_operation.rb'
    - 'lib/mongo/error/sessions_not_supported.rb'

# Offense count: 302
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
  Max: 349

# Offense count: 25
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
# AllowedMethods: refine
Metrics/BlockLength:
  Max: 121

# Offense count: 26
# Configuration parameters: CountBlocks, CountModifierForms.
Metrics/BlockNesting:
  Max: 5

# Offense count: 28
# Configuration parameters: CountComments, Max, CountAsOne.
Metrics/ClassLength:
  Enabled: false

# Offense count: 8
# Configuration parameters: LengthThreshold.
Metrics/CollectionLiteralLength:
  Exclude:
    - 'lib/mongo/auth/stringprep/tables.rb'
    - 'lib/mongo/auth/stringprep/unicode_normalize/tables.rb'

# Offense count: 161
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/CyclomaticComplexity:
  Max: 77

# Offense count: 166
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
  Enabled: false

# Offense count: 35
# Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
Metrics/ParameterLists:
  Max: 11

# Offense count: 139
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/PerceivedComplexity:
  Max: 67

# Offense count: 22
Naming/AccessorMethodName:
  Exclude:
    - 'lib/mongo/client_encryption.rb'
    - 'lib/mongo/cluster.rb'
    - 'lib/mongo/crypt/auto_encrypter.rb'
    - 'lib/mongo/crypt/data_key_context.rb'
    - 'lib/mongo/crypt/explicit_encryption_context.rb'
    - 'lib/mongo/cursor.rb'
    - 'lib/mongo/session.rb'
    - 'lib/mongo/socket.rb'
    - 'lib/mongo/write_concern/acknowledged.rb'
    - 'lib/mongo/write_concern/unacknowledged.rb'
    - 'spec/integration/secondary_reads_spec.rb'
    - 'spec/support/cluster_tools.rb'

# Offense count: 3
# Configuration parameters: ForbiddenDelimiters.
# ForbiddenDelimiters: (?i-mx:(^|\s)(EO[A-Z]{1}|END)(\s|$))
Naming/HeredocDelimiterNaming:
  Exclude:
    - 'spec/runners/crud/verifier.rb'
    - 'spec/support/spec_config.rb'

# Offense count: 4
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyleForLeadingUnderscores.
# SupportedStylesForLeadingUnderscores: disallowed, required, optional
Naming/MemoizedInstanceVariableName:
  Exclude:
    - 'lib/mongo/error/invalid_replacement_document.rb'
    - 'lib/mongo/error/invalid_update_document.rb'
    - 'lib/mongo/server/connection.rb'
    - 'spec/support/aws_utils/inspector.rb'

# Offense count: 69
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
Naming/MethodParameterName:
  Enabled: false

# Offense count: 21
# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros, UseSorbetSigs.
# NamePrefix: is_, has_, have_, does_
# ForbiddenPrefixes: is_, has_, have_, does_
# AllowedMethods: is_a?
# MethodDefinitionMacros: define_method, define_singleton_method
Naming/PredicatePrefix:
  Exclude:
    - 'spec/**/*'
    - 'lib/mongo/bulk_write/combineable.rb'
    - 'lib/mongo/cluster.rb'
    - 'lib/mongo/cluster/topology/load_balanced.rb'
    - 'lib/mongo/cluster/topology/replica_set_no_primary.rb'
    - 'lib/mongo/cluster/topology/sharded.rb'
    - 'lib/mongo/cluster/topology/single.rb'
    - 'lib/mongo/cluster/topology/unknown.rb'
    - 'lib/mongo/operation/result.rb'
    - 'lib/mongo/operation/shared/idable.rb'
    - 'lib/mongo/options/redacted.rb'
    - 'lib/mongo/retryable/base_worker.rb'
    - 'lib/mongo/server/description.rb'

# Offense count: 35
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
# SupportedStyles: snake_case, normalcase, non_integer
# AllowedIdentifiers: TLS1_1, TLS1_2, capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
Naming/VariableNumber:
  Exclude:
    - 'lib/mongo/bulk_write.rb'
    - 'lib/mongo/collection/view/writable.rb'
    - 'lib/mongo/crypt/binding.rb'
    - 'lib/mongo/crypt/handle.rb'
    - 'spec/integration/query_cache_spec.rb'
    - 'spec/mongo/cluster/cursor_reaper_spec.rb'
    - 'spec/mongo/cluster/topology/single_spec.rb'
    - 'spec/mongo/crypt/helpers/mongo_crypt_spec_helper.rb'
    - 'spec/mongo/operation/delete/op_msg_spec.rb'
    - 'spec/mongo/operation/insert/op_msg_spec.rb'
    - 'spec/mongo/operation/update/op_msg_spec.rb'

# Offense count: 23
# Configuration parameters: MinSize.
Performance/CollectionLiteralInLoop:
  Enabled: false

# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
Performance/Count:
  Exclude:
    - 'spec/integration/retryable_reads_errors_spec.rb'
    - 'spec/integration/retryable_writes_errors_spec.rb'
    - 'spec/stress/cleanup_spec.rb'

# Offense count: 5
# This cop supports unsafe autocorrection (--autocorrect-all).
Performance/InefficientHashSearch:
  Exclude:
    - 'lib/mongo/bulk_write.rb'
    - 'lib/mongo/config/validators/option.rb'
    - 'lib/mongo/server_selector.rb'
    - 'spec/runners/crud/operation.rb'
    - 'spec/runners/server_selection.rb'

# Offense count: 8
# This cop supports unsafe autocorrection (--autocorrect-all).
Performance/MapCompact:
  Exclude:
    - 'lib/mongo/error/parser.rb'
    - 'lib/mongo/uri.rb'
    - 'spec/integration/shell_examples_spec.rb'
    - 'spec/runners/unified/support_operations.rb'
    - 'spec/runners/unified/test.rb'
    - 'spec/support/shared/session.rb'

# Offense count: 28
Performance/MapMethodChain:
  Exclude:
    - 'lib/mongo/cluster.rb'
    - 'lib/mongo/cluster/topology/load_balanced.rb'
    - 'lib/mongo/cluster/topology/single.rb'
    - 'spec/integration/srv_monitoring_spec.rb'
    - 'spec/mongo/srv/monitor_spec.rb'
    - 'spec/runners/server_selection.rb'
    - 'spec/spec_tests/sdam_spec.rb'

# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
Performance/RangeInclude:
  Exclude:
    - 'lib/mongo/auth/aws/conversation.rb'
    - 'lib/mongo/socket/ocsp_verifier.rb'
    - 'lib/mongo/srv/resolver.rb'

# Offense count: 4
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowRegexpMatch.
Performance/RedundantEqualityComparisonBlock:
  Exclude:
    - 'lib/mongo.rb'
    - 'lib/mongo/cluster.rb'
    - 'lib/mongo/crypt/data_key_context.rb'
    - 'spec/support/client_registry_macros.rb'

# Offense count: 8
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: MaxKeyValuePairs.
Performance/RedundantMerge:
  Exclude:
    - 'lib/mongo/cluster.rb'
    - 'lib/mongo/monitoring/event/command_succeeded.rb'
    - 'lib/mongo/operation/shared/result/aggregatable.rb'
    - 'lib/mongo/operation/shared/sessions_supported.rb'
    - 'lib/mongo/session.rb'
    - 'spec/runners/gridfs.rb'

# Offense count: 14
# This cop supports unsafe autocorrection (--autocorrect-all).
Performance/StringInclude:
  Exclude:
    - 'lib/mongo/collection/helpers.rb'
    - 'spec/integration/aws_auth_request_spec.rb'
    - 'spec/integration/srv_monitoring_spec.rb'
    - 'spec/mongo/socket/ssl_spec.rb'
    - 'spec/runners/connection_string.rb'
    - 'spec/runners/crud.rb'
    - 'spec/runners/crud/operation.rb'
    - 'spec/runners/transactions/operation.rb'
    - 'spec/runners/transactions/test.rb'
    - 'spec/runners/unified/test.rb'
    - 'spec/spec_tests/uri_options_spec.rb'
    - 'spec/support/spec_config.rb'
    - 'spec/support/spec_setup.rb'

# Offense count: 7
# This cop supports unsafe autocorrection (--autocorrect-all).
Performance/TimesMap:
  Exclude:
    - 'spec/mongo/bulk_write_spec.rb'
    - 'spec/mongo/cluster/cursor_reaper_spec.rb'
    - 'spec/mongo/session/session_pool_spec.rb'
    - 'spec/stress/push_monitor_close_spec.rb'

# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
Performance/UnfreezeString:
  Exclude:
    - 'lib/mongo/socket.rb'
    - 'spec/support/matchers.rb'

# Offense count: 69
RSpec/AnyInstance:
  Enabled: false

# Offense count: 37
# This cop supports unsafe autocorrection (--autocorrect-all).
RSpec/BeEq:
  Exclude:
    - 'spec/integration/change_stream_spec.rb'
    - 'spec/kerberos/kerberos_spec.rb'
    - 'spec/mongo/collection/view/aggregation_spec.rb'
    - 'spec/mongo/collection/view/readable_spec.rb'
    - 'spec/mongo/collection_crud_spec.rb'
    - 'spec/mongo/crypt/binding/status_spec.rb'
    - 'spec/mongo/database_spec.rb'
    - 'spec/mongo/error/parser_spec.rb'
    - 'spec/mongo/grid/stream/write_spec.rb'
    - 'spec/mongo/operation/update_spec.rb'
    - 'spec/mongo/uri/srv_protocol_spec.rb'

# Offense count: 26
# This cop supports unsafe autocorrection (--autocorrect-all).
RSpec/BeEql:
  Exclude:
    - 'spec/integration/command_monitoring_spec.rb'
    - 'spec/mongo/bulk_write/result_spec.rb'
    - 'spec/mongo/error/operation_failure_spec.rb'

# Offense count: 1176
# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
RSpec/ContextWording:
  Enabled: false

# Offense count: 137
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants.
# SupportedStyles: described_class, explicit
RSpec/DescribedClass:
  Enabled: false

# Offense count: 37
# This cop supports unsafe autocorrection (--autocorrect-all).
RSpec/EmptyExampleGroup:
  Enabled: false

# Offense count: 114
# Configuration parameters: Max, CountAsOne.
RSpec/ExampleLength:
  Enabled: false

# Offense count: 11
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: CustomTransform, IgnoredWords, DisallowedExamples.
# DisallowedExamples: works
RSpec/ExampleWording:
  Exclude:
    - 'spec/integration/ocsp_connectivity_spec.rb'
    - 'spec/integration/transaction_pinning_spec.rb'
    - 'spec/integration/truncated_utf8_spec.rb'
    - 'spec/mongo/auth/x509_spec.rb'
    - 'spec/mongo/bulk_write/result_spec.rb'
    - 'spec/mongo/cluster/periodic_executor_spec.rb'
    - 'spec/mongo/server/connection_pool/populator_spec.rb'
    - 'spec/mongo/server/monitor_spec.rb'
    - 'spec/mongo/server/push_monitor_spec.rb'
    - 'spec/mongo/server_spec.rb'
    - 'spec/stress/fork_reconnect_stress_spec.rb'

# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
RSpec/ExpectActual:
  Exclude:
    - '**/spec/routing/**/*'
    - 'spec/integration/operation_failure_code_spec.rb'
    - 'spec/runners/crud/verifier.rb'

# Offense count: 151
RSpec/ExpectInHook:
  Enabled: false

# Offense count: 5
RSpec/IdenticalEqualityAssertion:
  Exclude:
    - 'spec/integration/change_stream_examples_spec.rb'
    - 'spec/mongo/grid/file/chunk_spec.rb'
    - 'spec/mongo/grid/file/info_spec.rb'
    - 'spec/mongo/grid/file_spec.rb'

# Offense count: 53
# Configuration parameters: AssignmentOnly.
RSpec/InstanceVariable:
  Exclude:
    - 'spec/integration/aws_auth_credentials_cache_spec.rb'
    - 'spec/mongo/collection/view/change_stream_spec.rb'
    - 'spec/mongo/query_cache_middleware_spec.rb'
    - 'spec/spec_tests/cmap_spec.rb'
    - 'spec/spec_tests/sdam_monitoring_spec.rb'
    - 'spec/spec_tests/sdam_spec.rb'
    - 'spec/stress/connection_pool_timing_spec.rb'

# Offense count: 8
RSpec/LeakyConstantDeclaration:
  Exclude:
    - 'spec/integration/heartbeat_events_spec.rb'
    - 'spec/mongo/id_spec.rb'
    - 'spec/mongo/operation/result_spec.rb'
    - 'spec/mongo/server/connection_spec.rb'
    - 'spec/spec_tests/sdam_spec.rb'

# Offense count: 21
RSpec/LeakyLocalVariable:
  Exclude:
    - 'spec/integration/client_side_encryption/auto_encryption_bulk_writes_spec.rb'
    - 'spec/integration/ocsp_verifier_cache_spec.rb'
    - 'spec/integration/ocsp_verifier_spec.rb'
    - 'spec/mongo/lint_spec.rb'
    - 'spec/mongo/operation/read_preference_legacy_spec.rb'
    - 'spec/mongo/operation/read_preference_op_msg_spec.rb'
    - 'spec/mongo/srv/result_spec.rb'
    - 'spec/runners/server_selection.rb'
    - 'spec/spec_tests/cmap_spec.rb'
    - 'spec/spec_tests/sdam_monitoring_spec.rb'
    - 'spec/spec_tests/sdam_spec.rb'
    - 'spec/spec_tests/seed_list_discovery_spec.rb'
    - 'spec/spec_tests/server_selection_rtt_spec.rb'
    - 'spec/spec_tests/uri_options_spec.rb'

# Offense count: 25
RSpec/LetSetup:
  Exclude:
    - 'spec/integration/shell_examples_spec.rb'
    - 'spec/mongo/collection/view/change_stream_spec.rb'
    - 'spec/mongo/database_spec.rb'
    - 'spec/mongo/grid/fs_bucket_spec.rb'
    - 'spec/mongo/index/view_spec.rb'
    - 'spec/mongo/server/connection_pool_spec.rb'
    - 'spec/mongo/session/session_pool_spec.rb'
    - 'spec/support/shared/session.rb'

# Offense count: 2
RSpec/MultipleDescribes:
  Exclude:
    - 'spec/spec_tests/retryable_reads_spec.rb'
    - 'spec/spec_tests/unified_spec.rb'

# Offense count: 169
# Configuration parameters: AllowedPatterns.
# AllowedPatterns: ^expect_, ^assert_
RSpec/NoExpectationExample:
  Enabled: false

# Offense count: 83
# This cop supports unsafe autocorrection (--autocorrect-all).
RSpec/Output:
  Enabled: false

# Offense count: 12
RSpec/RepeatedDescription:
  Exclude:
    - 'spec/mongo/address_spec.rb'
    - 'spec/mongo/collection/view/readable_spec.rb'
    - 'spec/mongo/options/redacted_spec.rb'
    - 'spec/mongo/server/description_spec.rb'

# Offense count: 2
RSpec/RepeatedExample:
  Exclude:
    - 'spec/integration/client_update_spec.rb'

# Offense count: 16
RSpec/RepeatedExampleGroupBody:
  Exclude:
    - 'spec/integration/client_side_encryption/auto_encryption_command_monitoring_spec.rb'
    - 'spec/mongo/collection_crud_spec.rb'
    - 'spec/mongo/collection_spec.rb'
    - 'spec/mongo/server_selector/nearest_spec.rb'
    - 'spec/mongo/server_selector/primary_preferred_spec.rb'
    - 'spec/mongo/server_selector/primary_spec.rb'
    - 'spec/mongo/server_spec.rb'

# Offense count: 22
RSpec/RepeatedExampleGroupDescription:
  Exclude:
    - 'spec/mongo/client_encryption_spec.rb'
    - 'spec/mongo/collection/view/aggregation_spec.rb'
    - 'spec/mongo/collection/view/readable_spec.rb'
    - 'spec/mongo/collection_crud_spec.rb'
    - 'spec/mongo/error/crypt_error_spec.rb'
    - 'spec/mongo/server/connection_pool_spec.rb'
    - 'spec/mongo/server/description/features_spec.rb'
    - 'spec/mongo/uri/options_mapper_spec.rb'

# Offense count: 241
# This cop supports safe autocorrection (--autocorrect).
RSpec/ScatteredLet:
  Enabled: false

# Offense count: 23
# Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector.
# SupportedInflectors: default, active_support
RSpec/SpecFilePathFormat:
  Enabled: false

# Offense count: 79
RSpec/StubbedMock:
  Enabled: false

# Offense count: 6
RSpec/SubjectDeclaration:
  Exclude:
    - 'spec/mongo/auth/aws/credential_cache_spec.rb'
    - 'spec/mongo/auth/aws/credentials_retriever_spec.rb'
    - 'spec/mongo/bulk_write/result_spec.rb'
    - 'spec/mongo/crypt/encryption_io_spec.rb'
    - 'spec/mongo/server/connection_common_spec.rb'

# Offense count: 5
RSpec/SubjectStub:
  Exclude:
    - 'spec/mongo/auth/aws/credentials_retriever_spec.rb'
    - 'spec/mongo/crypt/encryption_io_spec.rb'

# Offense count: 5
# Configuration parameters: EnforcedStyle, AllowedPatterns.
# SupportedStyles: snake_case, camelCase
RSpec/VariableName:
  Exclude:
    - 'spec/mongo/auth/user/view_spec.rb'
    - 'spec/mongo/client_spec.rb'

# Offense count: 195
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
RSpec/VerifiedDoubles:
  Enabled: false

# Offense count: 2
Security/CompoundHash:
  Exclude:
    - 'lib/mongo/collection/view.rb'

# Offense count: 15
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle, AllowModifiersOnSymbols, AllowModifiersOnAttrs, AllowModifiersOnAliasMethod.
# SupportedStyles: inline, group
Style/AccessModifierDeclarations:
  Exclude:
    - 'lib/mongo.rb'
    - 'lib/mongo/auth/credential_cache.rb'
    - 'lib/mongo/error/read_write_retryable.rb'
    - 'lib/mongo/monitoring/event/command_started.rb'
    - 'lib/mongo/operation/find/builder/command.rb'
    - 'lib/mongo/operation/find/builder/flags.rb'
    - 'lib/mongo/operation/find/builder/modifiers.rb'
    - 'lib/mongo/operation/result.rb'
    - 'lib/mongo/protocol/message.rb'
    - 'lib/mongo/query_cache.rb'
    - 'lib/mongo/server/connection.rb'
    - 'lib/mongo/server_selector/base.rb'
    - 'lib/mongo/socket/ocsp_cache.rb'
    - 'lib/mongo/utils.rb'
    - 'spec/runners/connection_string.rb'

# Offense count: 8
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, conditionals
Style/AndOr:
  Exclude:
    - 'lib/mongo/auth/stringprep/unicode_normalize/normalize.rb'

# Offense count: 6
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowOnConstant, AllowOnSelfClass.
Style/CaseEquality:
  Exclude:
    - 'lib/mongo/retryable/base_worker.rb'
    - 'spec/integration/change_stream_spec.rb'
    - 'spec/mongo/socket_spec.rb'
    - 'spec/support/shared/session.rb'

# Offense count: 4
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: MinBranchesCount.
Style/CaseLikeIf:
  Exclude:
    - 'lib/mongo/protocol/compressed.rb'
    - 'spec/integration/client_side_encryption/corpus_spec.rb'
    - 'spec/runners/unified/test.rb'

# Offense count: 4
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle, EnforcedStyleForClasses, EnforcedStyleForModules.
# SupportedStyles: nested, compact
# SupportedStylesForClasses: ~, nested, compact
# SupportedStylesForModules: ~, nested, compact
Style/ClassAndModuleChildren:
  Exclude:
    - 'lib/mongo/cluster/sdam_flow.rb'
    - 'lib/mongo/error/operation_failure.rb'
    - 'spec/spec_tests/sdam_spec.rb'

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedMethods, AllowedPatterns.
# AllowedMethods: ==, equal?, eql?
Style/ClassEqualityComparison:
  Exclude:
    - 'lib/mongo/monitoring/topology_changed_log_subscriber.rb'
    - 'spec/runners/transactions/test.rb'

# Offense count: 3
Style/ClassVars:
  Exclude:
    - 'lib/mongo/id.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/CommentedKeyword:
  Exclude:
    - 'lib/mongo/auth/stringprep/unicode_normalize/normalize.rb'

# Offense count: 16
# Configuration parameters: AllowedConstants.
Style/Documentation:
  Exclude:
    - 'spec/**/*'
    - 'lib/mongo.rb'
    - 'lib/mongo/auth/aws.rb'
    - 'lib/mongo/auth/aws/request.rb'
    - 'lib/mongo/bulk_write.rb'
    - 'lib/mongo/cluster/topology.rb'
    - 'lib/mongo/cluster/topology/no_replica_set_options.rb'
    - 'lib/mongo/crypt.rb'
    - 'lib/mongo/crypt/binding.rb'
    - 'lib/mongo/error/kms_error.rb'
    - 'lib/mongo/error/server_not_usable.rb'
    - 'lib/mongo/operation/shared/polymorphic_result.rb'
    - 'lib/mongo/query_cache.rb'
    - 'lib/mongo/server_selector/base.rb'
    - 'lib/mongo/socket/ocsp_verifier.rb'
    - 'lib/mongo/utils.rb'

# Offense count: 13
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: allowed_in_returns, forbidden
Style/DoubleNegation:
  Exclude:
    - 'lib/mongo/address.rb'
    - 'lib/mongo/bulk_write.rb'
    - 'lib/mongo/client.rb'
    - 'lib/mongo/cluster.rb'
    - 'lib/mongo/crypt/handle.rb'
    - 'lib/mongo/error/operation_failure.rb'
    - 'lib/mongo/monitoring/event/server_heartbeat_failed.rb'
    - 'lib/mongo/monitoring/event/server_heartbeat_succeeded.rb'
    - 'lib/mongo/server.rb'
    - 'lib/mongo/server/description.rb'
    - 'spec/runners/crud/requirement.rb'

# Offense count: 4
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, AllowComments.
# SupportedStyles: empty, nil, both
Style/EmptyElse:
  Exclude:
    - 'lib/mongo/collection/view/change_stream.rb'
    - 'lib/mongo/cursor.rb'
    - 'lib/mongo/operation/shared/sessions_supported.rb'
    - 'lib/mongo/server.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: format, sprintf, percent
Style/FormatString:
  Exclude:
    - 'lib/mongo/cluster.rb'
    - 'lib/mongo/monitoring/command_log_subscriber.rb'

# Offense count: 4
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Style/FrozenStringLiteralComment:
  Exclude:
    - '**/*.arb'
    - 'spec/integration/bulk_write_error_message_spec.rb'
    - 'spec/integration/operation_failure_message_spec.rb'
    - 'spec/integration/secondary_reads_spec.rb'
    - 'spec/support/shared/auth_context.rb'

# Offense count: 13
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/GlobalStdStream:
  Exclude:
    - 'lib/mongo/logger.rb'
    - 'spec/integration/reconnect_spec.rb'
    - 'spec/integration/srv_monitoring_spec.rb'
    - 'spec/lite_spec_helper.rb'
    - 'spec/mongo/crypt/auto_decryption_context_spec.rb'
    - 'spec/mongo/crypt/auto_encryption_context_spec.rb'
    - 'spec/mongo/crypt/explicit_decryption_context_spec.rb'
    - 'spec/mongo/crypt/explicit_encryption_context_spec.rb'
    - 'spec/mongo/logger_spec.rb'
    - 'spec/stress/push_monitor_close_spec.rb'

# Offense count: 33
# Configuration parameters: AllowedVariables.
Style/GlobalVars:
  Exclude:
    - 'lib/mongo/retryable/base_worker.rb'
    - 'spec/runners/crud.rb'
    - 'spec/runners/crud/operation.rb'
    - 'spec/runners/transactions.rb'
    - 'spec/runners/transactions/operation.rb'
    - 'spec/runners/transactions/test.rb'
    - 'spec/runners/unified/support_operations.rb'
    - 'spec/runners/unified/test.rb'
    - 'spec/support/sdam_formatter_integration.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
Style/GuardClause:
  Exclude:
    - 'lib/mongo/srv/result.rb'

# Offense count: 10
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowSplatArgument.
Style/HashConversion:
  Exclude:
    - 'lib/mongo/address.rb'
    - 'lib/mongo/auth/scram_conversation_base.rb'
    - 'lib/mongo/client.rb'
    - 'lib/mongo/collection.rb'
    - 'lib/mongo/monitoring/event/command_started.rb'
    - 'lib/mongo/utils.rb'
    - 'spec/runners/auth.rb'
    - 'spec/runners/transactions/test.rb'

# Offense count: 17
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedReceivers.
# AllowedReceivers: Thread.current
Style/HashEachMethods:
  Exclude:
    - 'lib/mongo/client.rb'
    - 'lib/mongo/cluster/topology/base.rb'
    - 'lib/mongo/collection.rb'
    - 'lib/mongo/protocol/query.rb'
    - 'lib/mongo/server/connection_pool/generation_manager.rb'
    - 'lib/mongo/server/description/features.rb'
    - 'spec/runners/crud/verifier.rb'
    - 'spec/runners/sdam/verifier.rb'
    - 'spec/runners/unified/entity_map.rb'
    - 'spec/runners/unified/test.rb'
    - 'spec/support/client_registry.rb'
    - 'spec/support/cluster_tools.rb'
    - 'spec/support/common_shortcuts.rb'

# Offense count: 4
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/HashSlice:
  Exclude:
    - 'spec/mongo/options/redacted_spec.rb'
    - 'spec/runners/auth.rb'

# Offense count: 174
# This cop supports safe autocorrection (--autocorrect).
Style/IfUnlessModifier:
  Enabled: false

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedMethods.
# AllowedMethods: infinite?, nonzero?
Style/IfWithBooleanLiteralBranches:
  Exclude:
    - 'lib/mongo/cluster_time.rb'
    - 'lib/mongo/error/sdam_error_detection.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/InfiniteLoop:
  Exclude:
    - 'lib/mongo/crypt/context.rb'

# Offense count: 10
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: InverseMethods, InverseBlocks.
Style/InverseMethods:
  Exclude:
    - 'spec/runners/crud/verifier.rb'
    - 'spec/runners/unified.rb'
    - 'spec/runners/unified/test.rb'
    - 'spec/spec_tests/sdam_spec.rb'
    - 'spec/support/spec_config.rb'

# Offense count: 1
Style/ItAssignment:
  Exclude:
    - 'spec/integration/cursor_pinning_spec.rb'

# Offense count: 153
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/LineEndConcatenation:
  Enabled: false

# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/MapIntoArray:
  Exclude:
    - 'spec/integration/query_cache_spec.rb'
    - 'spec/mongo/session/session_pool_spec.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/MapJoin:
  Exclude:
    - 'spec/runners/crud/requirement.rb'

# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/MapToHash:
  Exclude:
    - 'spec/runners/transactions/test.rb'
    - 'spec/runners/unified/test.rb'

# Offense count: 1
Style/MixinUsage:
  Exclude:
    - 'bin/mongo_console'

# Offense count: 12
Style/MultilineBlockChain:
  Exclude:
    - 'lib/mongo/bulk_write.rb'
    - 'lib/mongo/client.rb'
    - 'lib/mongo/grid/stream/read.rb'
    - 'lib/mongo/server/connection_pool.rb'
    - 'lib/mongo/server_selector/base.rb'
    - 'lib/mongo/socket/ocsp_verifier.rb'
    - 'spec/mongo/operation/read_preference_legacy_spec.rb'
    - 'spec/mongo/operation/read_preference_op_msg_spec.rb'
    - 'spec/mongo/server/connection_spec.rb'
    - 'spec/runners/unified/event_subscriber.rb'
    - 'spec/runners/unified/test.rb'

# Offense count: 27
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: literals, strict
Style/MutableConstant:
  Enabled: false

# Offense count: 75
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
# SupportedStyles: predicate, comparison
Style/NumericPredicate:
  Enabled: false

# Offense count: 11
# Configuration parameters: AllowedClasses.
Style/OneClassPerFile:
  Exclude:
    - 'lib/mongo/auth/aws/request.rb'
    - 'lib/mongo/cluster/topology.rb'
    - 'lib/mongo/socket/ocsp_verifier.rb'
    - 'spec/lite_spec_helper.rb'
    - 'spec/mongo/retryable_spec.rb'
    - 'spec/runners/sdam.rb'
    - 'spec/support/aws_utils.rb'
    - 'spec/support/background_thread_registry.rb'
    - 'spec/support/client_registry.rb'

# Offense count: 1
Style/OpenStructUse:
  Exclude:
    - 'spec/support/background_thread_registry.rb'

# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/PredicateWithKind:
  Exclude:
    - 'lib/mongo.rb'
    - 'lib/mongo/crypt/data_key_context.rb'
    - 'spec/support/client_registry_macros.rb'

# Offense count: 12
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: short, verbose
Style/PreferredHashMethods:
  Exclude:
    - 'lib/mongo/auth.rb'
    - 'lib/mongo/auth/stringprep.rb'
    - 'lib/mongo/client.rb'
    - 'lib/mongo/operation/result.rb'
    - 'spec/mongo/auth/x509/conversation_spec.rb'
    - 'spec/mongo/grid/stream/write_spec.rb'
    - 'spec/mongo/options/redacted_spec.rb'

# Offense count: 104
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle, AllowedCompactTypes.
# SupportedStyles: compact, exploded
Style/RaiseArgs:
  Enabled: false

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/ReduceToHash:
  Exclude:
    - 'spec/mongo/monitoring/command_log_subscriber_spec.rb'

# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Methods.
Style/RedundantArgument:
  Exclude:
    - 'lib/mongo/auth/scram_conversation_base.rb'
    - 'lib/mongo/auth/stringprep/unicode_normalize/normalize.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowedMethods.
# AllowedMethods: infinite?, nonzero?
Style/RedundantCondition:
  Exclude:
    - 'lib/mongo/session.rb'

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/RedundantEach:
  Exclude:
    - 'lib/mongo/client.rb'
    - 'lib/mongo/operation/find/builder/flags.rb'

# Offense count: 5
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowComments.
Style/RedundantInitialize:
  Exclude:
    - 'lib/mongo/error/failed_string_prep_validation.rb'
    - 'lib/mongo/error/insufficient_iteration_count.rb'
    - 'lib/mongo/error/invalid_server_preference.rb'
    - 'lib/mongo/error/invalid_session.rb'
    - 'lib/mongo/error/sessions_not_supported.rb'

# Offense count: 5
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/RedundantInterpolation:
  Exclude:
    - 'spec/kerberos/kerberos_spec.rb'
    - 'spec/mongo/uri/srv_protocol_spec.rb'
    - 'spec/mongo/uri_option_parsing_spec.rb'
    - 'spec/spec_tests/uri_options_spec.rb'

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedMethods, AllowedPatterns.
Style/ReturnNilInPredicateMethodDefinition:
  Exclude:
    - 'lib/mongo/collection/view/builder/map_reduce.rb'
    - 'lib/mongo/session/session_pool.rb'

# Offense count: 57
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
# AllowedMethods: present?, blank?, presence, try, try!
Style/SafeNavigation:
  Enabled: false

# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/SelectByKind:
  Exclude:
    - 'spec/integration/step_down_spec.rb'
    - 'spec/mongo/server/connection_pool_spec.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/SelectByRegexp:
  Exclude:
    - 'spec/spec_tests/transactions_unified_spec.rb'

# Offense count: 13
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/SlicingWithRange:
  Exclude:
    - 'lib/mongo/auth/stringprep/unicode_normalize/normalize.rb'
    - 'lib/mongo/socket.rb'
    - 'lib/mongo/srv/result.rb'
    - 'spec/mongo/protocol/kill_cursors_spec.rb'
    - 'spec/mongo/protocol/msg_spec.rb'
    - 'spec/mongo/protocol/query_spec.rb'
    - 'spec/runners/unified/support_operations.rb'

# Offense count: 39
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Mode.
Style/StringConcatenation:
  Enabled: false

# Offense count: 55
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments.
# AllowedMethods: define_method
Style/SymbolProc:
  Enabled: false

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
Style/WhileUntilModifier:
  Exclude:
    - 'spec/stress/fork_reconnect_stress_spec.rb'

# Offense count: 5
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: forbid_for_all_comparison_operators, forbid_for_equality_operators_only, require_for_all_comparison_operators, require_for_equality_operators_only
Style/YodaCondition:
  Exclude:
    - 'lib/mongo/auth/stringprep/unicode_normalize/normalize.rb'
    - 'spec/support/constraints.rb'

# Offense count: 11
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/ZeroLengthPredicate:
  Exclude:
    - 'lib/mongo/address/validator.rb'
    - 'lib/mongo/error/bulk_write_error.rb'
    - 'lib/mongo/grid/stream/read.rb'
    - 'lib/mongo/socket.rb'
    - 'lib/mongo/uri.rb'
    - 'lib/mongo/uri/srv_protocol.rb'
    - 'spec/integration/connection_pool_populator_spec.rb'
    - 'spec/mongo/server/connection_pool_spec.rb'

# Offense count: 1145
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
# URISchemes: http, https
Layout/LineLength:
  Max: 1632
