Skip to content

Commit

Permalink
Merge branch 'master' into remove-symbol-operators
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyshields authored May 7, 2024
2 parents cdf7af1 + 7b3ad3f commit 45c272e
Show file tree
Hide file tree
Showing 83 changed files with 1,511 additions and 825 deletions.
9 changes: 6 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@ Layout/EmptyLinesAroundClassBody:
Layout/EmptyLinesAroundModuleBody:
Enabled: false

Style/IfUnlessModifier:
Enabled: false

Performance/CollectionLiteralInLoop:
Exclude:
- 'spec/mongoid/association/embedded/embeds_many/proxy_spec.rb'
Expand All @@ -153,6 +150,9 @@ Performance/CollectionLiteralInLoop:
- 'spec/mongoid/criteria/queryable/selectable_spec.rb'
- 'spec/mongoid/criteria/queryable/selector_spec.rb'

Style/IfUnlessModifier:
Enabled: false

# --------------------------------------------------
# These cops are intentionally disabled due to incompatibility.

Expand Down Expand Up @@ -215,6 +215,9 @@ Naming/PredicateName:
- has_attribute?
- has_attribute_before_type_cast?

RSpec/IndexedLet:
Enabled: false

RSpec/NotToNot:
EnforcedStyle: to_not

Expand Down
160 changes: 135 additions & 25 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --exclude-limit 1000`
# on 2024-01-16 04:19:18 UTC using RuboCop version 1.60.0.
# on 2024-05-06 14:01:50 UTC using RuboCop version 1.63.4.
# 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
Expand All @@ -21,7 +21,7 @@ Lint/SelfAssignment:
- 'spec/integration/associations/has_one_spec.rb'
- 'spec/mongoid/association/embedded/embeds_one/proxy_spec.rb'

# Offense count: 108
# Offense count: 110
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 154
Expand All @@ -37,22 +37,22 @@ Metrics/BlockLength:
Metrics/BlockNesting:
Max: 6

# Offense count: 17
# Offense count: 18
# Configuration parameters: CountComments, CountAsOne.
Metrics/ClassLength:
Max: 337

# Offense count: 51
# Offense count: 52
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/CyclomaticComplexity:
Max: 33

# Offense count: 184
# Offense count: 185
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Max: 87

# Offense count: 22
# Offense count: 21
# Configuration parameters: CountComments, CountAsOne.
Metrics/ModuleLength:
Max: 330
Expand All @@ -63,7 +63,7 @@ Metrics/ParameterLists:
MaxOptionalParameters: 4
Max: 6

# Offense count: 40
# Offense count: 41
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/PerceivedComplexity:
Max: 20
Expand Down Expand Up @@ -262,7 +262,15 @@ RSpec/DescribeClass:
- 'spec/mongoid/railties/console_sandbox_spec.rb'
- 'spec/mongoid/tasks/database_rake_spec.rb'

# Offense count: 124
# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: CustomTransform, IgnoredWords, DisallowedExamples.
# DisallowedExamples: works
RSpec/ExampleWording:
Exclude:
- 'spec/mongoid/persistable/updatable_spec.rb'

# Offense count: 120
RSpec/ExpectInHook:
Exclude:
- 'spec/integration/associations/embedded_spec.rb'
Expand Down Expand Up @@ -301,7 +309,6 @@ RSpec/ExpectInHook:
- 'spec/mongoid/serializable_spec.rb'
- 'spec/mongoid/tasks/database_rake_spec.rb'
- 'spec/mongoid/tasks/encryption_spec.rb'
- 'spec/mongoid/validatable/associated_spec.rb'
- 'spec/mongoid/validatable/presence_spec.rb'
- 'spec/support/immutable_ids.rb'

Expand Down Expand Up @@ -335,13 +342,14 @@ RSpec/FilePath:
- 'spec/mongoid/validatable/uniqueness_spec.rb'
- 'spec/mongoid/version_spec.rb'

# Offense count: 18
# Offense count: 21
RSpec/IteratedExpectation:
Exclude:
- 'spec/mongoid/association/referenced/belongs_to/eager_spec.rb'
- 'spec/mongoid/association/referenced/has_many/eager_spec.rb'
- 'spec/mongoid/association/referenced/has_many/enumerable_spec.rb'
- 'spec/mongoid/association/referenced/has_one/eager_spec.rb'
- 'spec/mongoid/clients_spec.rb'
- 'spec/mongoid/contextual/memory_spec.rb'
- 'spec/mongoid/contextual/mongo_spec.rb'
- 'spec/mongoid/criteria_spec.rb'
Expand Down Expand Up @@ -481,7 +489,7 @@ RSpec/LetSetup:
- 'spec/mongoid/touchable_spec.rb'
- 'spec/mongoid/validatable/uniqueness_spec.rb'

# Offense count: 308
# Offense count: 306
# Configuration parameters: .
# SupportedStyles: have_received, receive
RSpec/MessageSpies:
Expand Down Expand Up @@ -516,7 +524,7 @@ RSpec/NamedSubject:
RSpec/NestedGroups:
Max: 13

# Offense count: 31
# Offense count: 32
# Configuration parameters: AllowedPatterns.
# AllowedPatterns: ^expect_, ^assert_
RSpec/NoExpectationExample:
Expand All @@ -531,6 +539,7 @@ RSpec/NoExpectationExample:
- 'spec/mongoid/collection_configurable_spec.rb'
- 'spec/mongoid/document_spec.rb'
- 'spec/mongoid/errors/mongoid_error_spec.rb'
- 'spec/mongoid/inspectable_spec.rb'
- 'spec/mongoid/persistence_context_spec.rb'
- 'spec/mongoid/scopable_spec.rb'
- 'spec/mongoid/tasks/database_rake_spec.rb'
Expand All @@ -543,18 +552,52 @@ RSpec/OverwritingSetup:
- 'spec/mongoid/interceptable_spec.rb'
- 'spec/mongoid/serializable_spec.rb'

# Offense count: 17
# Offense count: 3
RSpec/PendingWithoutReason:
Exclude:
- 'spec/mongoid/criteria/queryable/aggregable_spec.rb'
- 'spec/mongoid/serializable_spec.rb'

# Offense count: 8
# This cop supports safe autocorrection (--autocorrect).
RSpec/RedundantPredicateMatcher:
Exclude:
- 'spec/mongoid/copyable_spec.rb'
- 'spec/mongoid/document_spec.rb'
- 'spec/mongoid/equality_spec.rb'

# Offense count: 105
RSpec/RemoveConst:
Exclude:
- 'spec/integration/discriminator_key_spec.rb'
- 'spec/mongoid/association/auto_save_spec.rb'
- 'spec/mongoid/association/embedded/embedded_in_spec.rb'
- 'spec/mongoid/association/embedded/embeds_many_spec.rb'
- 'spec/mongoid/association/embedded/embeds_one_spec.rb'
- 'spec/mongoid/association/embedded/embeds_many/proxy_spec.rb'
- 'spec/mongoid/association/macros_spec.rb'
- 'spec/mongoid/association/options_spec.rb'
- 'spec/mongoid/association/referenced/belongs_to/proxy_spec.rb'
- 'spec/mongoid/association/referenced/belongs_to_spec.rb'
- 'spec/mongoid/association/referenced/has_and_belongs_to_many_spec.rb'
- 'spec/mongoid/association/referenced/has_many_spec.rb'
- 'spec/mongoid/association/referenced/has_one/proxy_spec.rb'
- 'spec/mongoid/association/referenced/has_one_spec.rb'
- 'spec/mongoid/criteria/queryable/aggregable_spec.rb'
- 'spec/mongoid/serializable_spec.rb'
- 'spec/mongoid/association/syncable_spec.rb'
- 'spec/mongoid/clients_spec.rb'
- 'spec/mongoid/collection_configurable_spec.rb'
- 'spec/mongoid/copyable_spec.rb'
- 'spec/mongoid/criteria/includable_spec.rb'
- 'spec/mongoid/criteria/queryable/options_spec.rb'
- 'spec/mongoid/criteria/queryable/selectable_spec.rb'
- 'spec/mongoid/criteria/queryable/selectable_where_spec.rb'
- 'spec/mongoid/criteria/queryable/selector_spec.rb'
- 'spec/mongoid/document_spec.rb'
- 'spec/mongoid/fields/standard_spec.rb'
- 'spec/mongoid/scopable_spec.rb'
- 'spec/mongoid/stateful_spec.rb'
- 'spec/mongoid/tasks/database_spec.rb'
- 'spec/mongoid/timestamps/timeless_spec.rb'
- 'spec/mongoid/validatable/numericality_spec.rb'
- 'spec/support/feature_sandbox.rb'

# Offense count: 17
RSpec/RepeatedDescription:
Expand Down Expand Up @@ -639,6 +682,7 @@ RSpec/ScatteredLet:
- 'spec/mongoid/scopable_spec.rb'

# Offense count: 67
# This cop supports safe autocorrection (--autocorrect).
RSpec/ScatteredSetup:
Exclude:
- 'spec/integration/stringified_symbol_field_spec.rb'
Expand All @@ -650,15 +694,44 @@ RSpec/ScatteredSetup:
- 'spec/mongoid/copyable_spec.rb'
- 'spec/mongoid/persistable/deletable_spec.rb'

# Offense count: 12
# Offense count: 24
# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata.
# Include: **/*_spec.rb
RSpec/SpecFilePathFormat:
Exclude:
- 'spec/integration/atomic/modifiers_spec.rb'
- 'spec/integration/bson_regexp_raw_spec.rb'
- 'spec/integration/document_spec.rb'
- 'spec/mongoid/association/auto_save_spec.rb'
- 'spec/mongoid/association/counter_cache_spec.rb'
- 'spec/mongoid/association/eager_spec.rb'
- 'spec/mongoid/clients/transactions_spec.rb'
- 'spec/mongoid/criteria/queryable/extensions/boolean_spec.rb'
- 'spec/mongoid/criteria/queryable/extensions/numeric_spec.rb'
- 'spec/mongoid/criteria/queryable/extensions/regexp_raw_spec.rb'
- 'spec/mongoid/criteria/queryable/extensions/time_with_zone_spec.rb'
- 'spec/mongoid/criteria/queryable/queryable_spec.rb'
- 'spec/mongoid/extensions/binary_spec.rb'
- 'spec/mongoid/extensions/boolean_spec.rb'
- 'spec/mongoid/extensions/raw_value_spec.rb'
- 'spec/mongoid/extensions/stringified_symbol_spec.rb'
- 'spec/mongoid/loading_spec.rb'
- 'spec/mongoid/validatable/associated_spec.rb'
- 'spec/mongoid/validatable/format_spec.rb'
- 'spec/mongoid/validatable/length_spec.rb'
- 'spec/mongoid/validatable/numericality_spec.rb'
- 'spec/mongoid/validatable/presence_spec.rb'
- 'spec/mongoid/validatable/uniqueness_spec.rb'
- 'spec/mongoid/version_spec.rb'

# Offense count: 8
RSpec/StubbedMock:
Exclude:
- 'spec/mongoid/clients_spec.rb'
- 'spec/mongoid/errors/mongoid_error_spec.rb'
- 'spec/mongoid/persistence_context_spec.rb'
- 'spec/mongoid/tasks/database_spec.rb'
- 'spec/mongoid/tasks/encryption_spec.rb'
- 'spec/mongoid/validatable/associated_spec.rb'

# Offense count: 26
RSpec/SubjectDeclaration:
Expand All @@ -668,7 +741,7 @@ RSpec/SubjectDeclaration:
- 'spec/mongoid/collection_configurable_spec.rb'
- 'spec/mongoid/contextual/mongo/documents_loader_spec.rb'

# Offense count: 27
# Offense count: 23
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
RSpec/VerifiedDoubles:
Exclude:
Expand All @@ -684,10 +757,10 @@ RSpec/VerifiedDoubles:
- 'spec/mongoid/persistence_context_spec.rb'
- 'spec/mongoid/tasks/database_spec.rb'
- 'spec/mongoid/threaded_spec.rb'
- 'spec/mongoid/validatable/associated_spec.rb'
- 'spec/rails/mongoid_spec.rb'

# Offense count: 11
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle, AllowToTime.
# SupportedStyles: strict, flexible
Rails/Date:
Expand Down Expand Up @@ -718,6 +791,19 @@ Rails/Delegate:
- 'lib/mongoid/findable.rb'
- 'lib/mongoid/scopable.rb'

# Offense count: 11
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedMethods, AllowedPatterns.
# AllowedMethods: order, limit, select, lock
Rails/FindEach:
Exclude:
- 'spec/mongoid/association/referenced/belongs_to/eager_spec.rb'
- 'spec/mongoid/association/referenced/has_and_belongs_to_many/eager_spec.rb'
- 'spec/mongoid/association/referenced/has_many/eager_spec.rb'
- 'spec/mongoid/association/referenced/has_many/proxy_spec.rb'
- 'spec/mongoid/association/referenced/has_one/eager_spec.rb'
- 'spec/mongoid/criteria_projection_spec.rb'

# Offense count: 91
# Configuration parameters: Include.
# Include: spec/**/*.rb, test/**/*.rb
Expand All @@ -737,6 +823,24 @@ Rails/I18nLocaleAssignment:
- 'spec/mongoid/validatable/uniqueness_spec.rb'
- 'spec/support/macros.rb'

# Offense count: 28
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedReceivers.
# AllowedReceivers: ActionMailer::Preview, ActiveSupport::TimeZone
Rails/RedundantActiveRecordAllMethod:
Exclude:
- 'spec/integration/criteria/time_with_zone_spec.rb'
- 'spec/mongoid/association/referenced/belongs_to/eager_spec.rb'
- 'spec/mongoid/association/referenced/has_and_belongs_to_many/eager_spec.rb'
- 'spec/mongoid/association/referenced/has_many/eager_spec.rb'
- 'spec/mongoid/association/referenced/has_one/eager_spec.rb'
- 'spec/mongoid/contextual/aggregable/memory_spec.rb'
- 'spec/mongoid/contextual/memory_spec.rb'
- 'spec/mongoid/criteria/includable_spec.rb'
- 'spec/mongoid/criteria/queryable/selectable_logical_spec.rb'
- 'spec/mongoid/criteria_spec.rb'
- 'spec/mongoid/serializable_spec.rb'

# Offense count: 133
# Configuration parameters: ForbiddenMethods, AllowedMethods.
# ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all
Expand Down Expand Up @@ -765,7 +869,7 @@ Rails/SkipsModelValidations:
- 'spec/mongoid/touchable_spec.rb'
- 'spec/support/models/server.rb'

# Offense count: 151
# Offense count: 134
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: strict, flexible
Expand All @@ -775,7 +879,6 @@ Rails/TimeZone:
- 'lib/mongoid/extensions/date.rb'
- 'lib/mongoid/extensions/string.rb'
- 'lib/mongoid/extensions/time.rb'
- 'lib/mongoid/timestamps/updated.rb'
- 'spec/integration/criteria/date_field_spec.rb'
- 'spec/integration/criteria/raw_value_spec.rb'
- 'spec/integration/persistence/range_field_spec.rb'
Expand Down Expand Up @@ -804,15 +907,22 @@ Rails/TimeZone:
- 'spec/mongoid/touchable_spec.rb'
- 'spec/support/models/post.rb'

# Offense count: 4
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: exists, where
Rails/WhereExists:
Exclude:
- 'lib/mongoid/association/referenced/has_many/enumerable.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowOnlyRestArgument, UseAnonymousForwarding, RedundantRestArgumentNames, RedundantKeywordRestArgumentNames, RedundantBlockArgumentNames.
# RedundantRestArgumentNames: args, arguments
# RedundantKeywordRestArgumentNames: kwargs, options, opts
# RedundantBlockArgumentNames: blk, block, proc
Style/ArgumentsForwarding:
Exclude:
- 'lib/mongoid/association/referenced/has_many/enumerable.rb'
- 'lib/mongoid/association/referenced/has_many/proxy.rb'

# Offense count: 5
Expand Down
15 changes: 15 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Conduct of Code

1. "I fight for the Users." - Tron

2. "Talk is cheap. Show me the code." - Linus Torvalds

3. "Everything should be made as simple as possible, but not simpler." - Albert Einstein

4. "The most dangerous phrase in the language is: We've always done it this way." - Grace Hopper

5. "A feeling of aversion or attachment toward something is your clue that there's work to be done." - Ram Dass

6. "I'm smart enough to know that I'm dumb." - Richard Feynman

7. "Be excellent to each other." - Abraham Lincoln
3 changes: 0 additions & 3 deletions docs/index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,3 @@ for MongoDB in Ruby.
contributing
additional-resources
ecosystem


For documentation on Mongoid 3 and 4, see `<http://mongoid.github.io>`_.
Loading

0 comments on commit 45c272e

Please sign in to comment.