mongoid_fulltext 0.8.2 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/danger-comment.yml +19 -0
  3. data/.github/workflows/danger.yml +21 -0
  4. data/.github/workflows/lint.yml +29 -0
  5. data/.github/workflows/release.yml +30 -0
  6. data/.github/workflows/test.yml +81 -0
  7. data/.gitignore +2 -0
  8. data/.rubocop.yml +149 -3
  9. data/.rubocop_todo.yml +104 -59
  10. data/.spellcheck.txt +181 -0
  11. data/CHANGELOG.md +54 -33
  12. data/Dangerfile +5 -1
  13. data/Gemfile +22 -20
  14. data/Gemfile.danger +5 -0
  15. data/README.md +171 -178
  16. data/RELEASING.md +47 -30
  17. data/Rakefile +21 -3
  18. data/UPGRADING.md +43 -0
  19. data/lib/mongoid/full_text_search/field_scores.rb +48 -0
  20. data/lib/mongoid/full_text_search/index_definition.rb +31 -0
  21. data/lib/mongoid/full_text_search/ngrams.rb +93 -0
  22. data/lib/mongoid/full_text_search/version.rb +1 -1
  23. data/lib/mongoid/full_text_search.rb +94 -125
  24. data/mongoid_fulltext.gemspec +2 -3
  25. data/script/release.rb +13 -0
  26. data/spec/models/chinese_artwork.rb +7 -0
  27. data/spec/models/localized_artwork.rb +29 -0
  28. data/spec/models/multilingual_artwork.rb +7 -0
  29. data/spec/models/russian_artwork.rb +0 -1
  30. data/spec/models/scoped_artwork.rb +14 -0
  31. data/spec/models/tagged_artwork.rb +9 -0
  32. data/spec/models/weighted_artwork.rb +34 -0
  33. data/spec/mongoid/array_fields_spec.rb +43 -0
  34. data/spec/mongoid/bulk_indexing_spec.rb +56 -0
  35. data/spec/mongoid/candidate_limits_spec.rb +19 -0
  36. data/spec/mongoid/criteria_search_spec.rb +73 -0
  37. data/spec/mongoid/full_text_search_spec.rb +31 -6
  38. data/spec/mongoid/localized_fields_spec.rb +197 -0
  39. data/spec/mongoid/ngram_sampling_spec.rb +55 -0
  40. data/spec/mongoid/non_latin_spec.rb +50 -0
  41. data/spec/mongoid/timeout_option_spec.rb +18 -0
  42. data/spec/mongoid/weighted_fields_spec.rb +102 -0
  43. data/spec/release/release_spec.rb +60 -0
  44. data/spec/spec_helper.rb +15 -3
  45. data/spec/unit/field_scores_spec.rb +54 -0
  46. data/spec/unit/index_definition_spec.rb +48 -0
  47. data/spec/unit/ngrams_spec.rb +73 -0
  48. data/spec/version_spec.rb +7 -0
  49. metadata +41 -11
  50. data/.travis.yml +0 -33
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 177a2fc11491445aa0dfeaba3932e40fd2a2c37e89914dc7a1849ecfa6904e8c
4
- data.tar.gz: 1ad51ce427c54fea7b7feed000bd2443b66d33d901c3713d72707e36620c32da
3
+ metadata.gz: f9138faa10a45309c1ed9e46292b5fe6ff2ce1c3ef5daa3a8694cc27d3de2e8b
4
+ data.tar.gz: 6eaa26fee38b089e1e830aee75970b5733e31e4edac19d164e232db7b89cd326
5
5
  SHA512:
6
- metadata.gz: c48d9412a4141c93888b67cb8c3bac7bae22c35a19cf20612be770c152af77502f408316b21a98802dc7417235067bf6d3114501d22e7be3ec2fc9870cd38bde
7
- data.tar.gz: 1337bddf536cbda56b5d638e5e4f3c1458dc145043d45d1a810ec386ad0d6c13d5f27760503a2cd0da3bb596af572f02ae4198d00139b58a52c9c17ac11b1d80
6
+ metadata.gz: ea7490ba4ae8c0b07d5861c74b200b9e7ac0310d391bf77c05dbec5c49ec8d96e83a88e54992e5e52c949a59254d7978a6a31e6dcaedcfc7b382d4649a0b6f29
7
+ data.tar.gz: add245fc0c1424bc31247f1e6d03f749f9c8894eca6d092be99b9a32aa99fd0e49ce7974cfed3a12c33b3859d9f028b507f59cbe5da305564125e181d3acb789
@@ -0,0 +1,19 @@
1
+ name: Danger Comment
2
+
3
+ on:
4
+ workflow_run:
5
+ workflows: [Danger]
6
+ types: [completed]
7
+
8
+ permissions:
9
+ actions: read
10
+ issues: write
11
+ pull-requests: write
12
+
13
+ jobs:
14
+ comment:
15
+ name: Post Review Comment
16
+ uses: danger/danger-pr-comment/.github/workflows/danger-comment.yml@645e89bcc7be89ee7e8362166110b05cbced8e59 # v0.3.0
17
+ with:
18
+ base-branch: '*'
19
+ comment-empty: false
@@ -0,0 +1,21 @@
1
+ name: Danger
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, reopened, edited, synchronize]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ concurrency:
11
+ group: ${{ github.workflow }}-${{ github.ref }}
12
+ cancel-in-progress: true
13
+
14
+ jobs:
15
+ danger:
16
+ name: Review Pull Request
17
+ uses: danger/danger-pr-comment/.github/workflows/danger-run.yml@645e89bcc7be89ee7e8362166110b05cbced8e59 # v0.3.0
18
+ with:
19
+ ruby-version: '3.4'
20
+ bundler-cache: true
21
+ gemfile: Gemfile.danger
@@ -0,0 +1,29 @@
1
+ name: Lint
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+
8
+ concurrency:
9
+ group: ${{ github.workflow }}-${{ github.ref }}
10
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ jobs:
16
+ lint:
17
+ name: Lint Code and Documentation
18
+ runs-on: ubuntu-latest
19
+ timeout-minutes: 10
20
+ steps:
21
+ - name: Check Out Code
22
+ uses: actions/checkout@v7
23
+ - name: Set Up Ruby
24
+ uses: ruby/setup-ruby@v1
25
+ with:
26
+ ruby-version: '4.0'
27
+ bundler-cache: true
28
+ - name: Run Lint
29
+ run: bundle exec rake lint
@@ -0,0 +1,30 @@
1
+ name: Release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ version:
7
+ description: Optional release version overriding the checked-in version.
8
+ type: string
9
+ required: false
10
+ dry-run:
11
+ description: Check release prerequisites, such as RubyGems Trusted Publishing, without releasing.
12
+ type: boolean
13
+ default: false
14
+
15
+ permissions:
16
+ contents: write
17
+ id-token: write
18
+
19
+ jobs:
20
+ release:
21
+ if: github.repository == 'mongoid/mongoid_fulltext' && github.ref == 'refs/heads/master'
22
+ uses: dblock/ruby-gem-release/.github/workflows/release.yml@v0.9.0
23
+ with:
24
+ ruby-version: '3.3'
25
+ version: ${{ inputs.version }}
26
+ dry-run: ${{ inputs.dry-run }}
27
+ test: |
28
+ docker run --detach --name mongodb --publish 27017:27017 mongo:8.0
29
+ timeout 60 bash -c 'until docker exec mongodb mongosh --quiet --eval "db.adminCommand({ping: 1})"; do sleep 1; done'
30
+ bundle exec rake
@@ -0,0 +1,81 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ concurrency:
8
+ group: ${{ github.workflow }}-${{ github.ref }}
9
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ test:
16
+ name: Ruby ${{ matrix.ruby }} / Mongoid ${{ matrix.mongoid }} / MongoDB ${{ matrix.mongodb }}
17
+ runs-on: ubuntu-22.04
18
+ timeout-minutes: 15
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ include:
23
+ - { ruby: '2.1.9', mongoid: '~> 3.0.0', mongodb: '3.6', bundler: '1.17.3' }
24
+ - { ruby: '2.3.8', mongoid: '~> 3.1.0', mongodb: '3.6', bundler: '2.3.26', coverage: true }
25
+ - { ruby: '2.3.8', mongoid: '4', mongodb: '3.6', bundler: '2.3.26' }
26
+ - { ruby: '2.3.8', mongoid: '5', mongodb: '4.0', bundler: '2.3.26' }
27
+ - { ruby: '2.5.9', mongoid: '6', mongodb: '4.0', bundler: default }
28
+ - { ruby: '2.7.8', mongoid: '7', mongodb: '4.4', bundler: '2.4.22' }
29
+ - { ruby: '3.2', mongoid: '8', mongodb: '6.0', bundler: default }
30
+ - { ruby: '3.3', mongoid: '9', mongodb: '7.0', bundler: default }
31
+ - { ruby: '3.4', mongoid: '9', mongodb: '8.0', bundler: default }
32
+ - { ruby: '4.0', mongoid: '9', mongodb: '8.0', bundler: default, coverage: true }
33
+ env:
34
+ MONGOID_VERSION: ${{ matrix.mongoid }}
35
+ COVERAGE: ${{ matrix.coverage }}
36
+ services:
37
+ mongodb:
38
+ image: mongo:${{ matrix.mongodb }}
39
+ ports: ['27017:27017']
40
+ options: >-
41
+ --health-cmd "bash -c 'echo > /dev/tcp/127.0.0.1/27017'"
42
+ --health-interval 5s --health-timeout 5s --health-retries 20
43
+ steps:
44
+ - uses: actions/checkout@v6
45
+ - uses: ruby/setup-ruby@v1
46
+ with:
47
+ ruby-version: ${{ matrix.ruby }}
48
+ bundler: ${{ matrix.bundler }}
49
+ bundler-cache: true
50
+ - run: bundle exec rake spec
51
+ - name: Report coverage to Coveralls
52
+ if: matrix.coverage
53
+ uses: coverallsapp/github-action@v2
54
+ with:
55
+ github-token: ${{ secrets.GITHUB_TOKEN }}
56
+ file: coverage/.resultset.json
57
+ format: simplecov
58
+ parallel: true
59
+ flag-name: ruby-${{ matrix.ruby }}
60
+
61
+ coverage:
62
+ needs: test
63
+ if: ${{ always() && needs.test.result == 'success' }}
64
+ runs-on: ubuntu-latest
65
+ timeout-minutes: 20
66
+ steps:
67
+ - uses: coverallsapp/github-action@v2
68
+ with:
69
+ github-token: ${{ secrets.GITHUB_TOKEN }}
70
+ parallel-finished: true
71
+
72
+ lint:
73
+ runs-on: ubuntu-22.04
74
+ timeout-minutes: 20
75
+ steps:
76
+ - uses: actions/checkout@v6
77
+ - uses: ruby/setup-ruby@v1
78
+ with:
79
+ ruby-version: '3.3'
80
+ bundler-cache: true
81
+ - run: bundle exec rake rubocop
data/.gitignore CHANGED
@@ -45,3 +45,5 @@ tmtags
45
45
  *.swp
46
46
 
47
47
  Gemfile.lock
48
+ Gemfile.danger.lock
49
+ /vendor/bundle
data/.rubocop.yml CHANGED
@@ -1,6 +1,152 @@
1
+ plugins:
2
+ - rubocop-md
3
+ - rubocop-prose
4
+ - rubocop-rake
5
+ - rubocop-spellcheck
6
+ - rubocop-yaml
7
+
8
+ inherit_from: ".rubocop_todo.yml"
9
+
1
10
  AllCops:
11
+ TargetRubyVersion: 2.1
12
+ NewCops: disable
13
+ Exclude:
14
+ - vendor/**/*
15
+ - bin/**/*
16
+ - coverage/**/*
17
+ - pkg/**/*
18
+ SuggestExtensions: false
19
+ inherit_mode:
20
+ merge:
21
+ - Include
22
+ Include:
23
+ - ".github/**/*.yml"
24
+ - ".rubocop.yml"
25
+
26
+ YAML/Lint/InvalidSyntax:
27
+ Include:
28
+ - "**/*.yml"
29
+ - "**/*.yaml"
30
+
31
+ YAML/Lint/DuplicateKey:
32
+ Include:
33
+ - "**/*.yml"
34
+ - "**/*.yaml"
35
+
36
+ Naming/FileName:
37
+ inherit_mode:
38
+ merge:
39
+ - Exclude
40
+ Exclude:
41
+ - "**/*.md"
42
+ - ".github/workflows/*.yml"
43
+
44
+ Metrics/MethodLength:
45
+ inherit_mode:
46
+ merge:
47
+ - Exclude
48
+ Exclude:
49
+ - "**/*.md"
50
+
51
+ Metrics/AbcSize:
52
+ inherit_mode:
53
+ merge:
54
+ - Exclude
2
55
  Exclude:
3
- - vendor/**/*
4
- - bin/**/*
56
+ - "**/*.md"
5
57
 
6
- inherit_from: .rubocop_todo.yml
58
+ Naming/HeredocDelimiterNaming:
59
+ inherit_mode:
60
+ merge:
61
+ - Exclude
62
+ Exclude:
63
+ - "**/*.md"
64
+
65
+ Style/SafeNavigation:
66
+ inherit_mode:
67
+ merge:
68
+ - Exclude
69
+ Exclude:
70
+ - "**/*.md"
71
+
72
+ Style/OneClassPerFile:
73
+ inherit_mode:
74
+ merge:
75
+ - Exclude
76
+ Exclude:
77
+ - "**/*.md"
78
+
79
+ Style/Documentation:
80
+ inherit_mode:
81
+ merge:
82
+ - Exclude
83
+ Exclude:
84
+ - "**/*.md"
85
+
86
+ Lint/UselessAssignment:
87
+ inherit_mode:
88
+ merge:
89
+ - Exclude
90
+ Exclude:
91
+ - "**/*.md"
92
+
93
+ Style/MultilineBlockChain:
94
+ inherit_mode:
95
+ merge:
96
+ - Exclude
97
+ Exclude:
98
+ - "**/*.md"
99
+
100
+ Style/SymbolProc:
101
+ inherit_mode:
102
+ merge:
103
+ - Exclude
104
+ Exclude:
105
+ - "**/*.md"
106
+
107
+ Lint/Void:
108
+ inherit_mode:
109
+ merge:
110
+ - Exclude
111
+ Exclude:
112
+ - "**/*.md"
113
+
114
+ Metrics/BlockLength:
115
+ inherit_mode:
116
+ merge:
117
+ - Exclude
118
+ Exclude:
119
+ - Gemfile
120
+
121
+ Layout/LineLength:
122
+ inherit_mode:
123
+ merge:
124
+ - Exclude
125
+ Exclude:
126
+ - ".github/workflows/*.yml"
127
+
128
+ Markdown/HeadingCapitalization:
129
+ Enabled: true
130
+ Style: title_case
131
+
132
+ Prose/MaxLength:
133
+ Max: false
134
+ Exclude:
135
+ - LICENSE
136
+
137
+ Spellcheck:
138
+ DictionaryFiles:
139
+ en:
140
+ - gem:rubocop-spellcheck/data/en/en.dic
141
+ - ".spellcheck.txt"
142
+
143
+ Spellcheck/Spelling:
144
+ Exclude:
145
+ - LICENSE
146
+
147
+ Naming/VariableNumber:
148
+ inherit_mode:
149
+ merge:
150
+ - Exclude
151
+ Exclude:
152
+ - "**/*.md"
data/.rubocop_todo.yml CHANGED
@@ -1,105 +1,125 @@
1
1
  # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2018-05-08 14:54:25 +0200 using RuboCop version 0.55.0.
2
+ # `rubocop --auto-gen-config --no-exclude-limit --no-offense-counts --no-auto-gen-timestamp`
3
+ # using RuboCop version 1.92.3.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 6
10
- # Configuration parameters: Include.
11
- # Include: **/*.gemfile, **/Gemfile, **/gems.rb
12
- Bundler/DuplicatedGem:
9
+ Gemspec/RequiredRubyVersion:
13
10
  Exclude:
14
- - 'Gemfile'
11
+ - 'mongoid_fulltext.gemspec'
15
12
 
16
- # Offense count: 1
17
- # Cop supports --auto-correct.
18
- # Configuration parameters: EnforcedStyleAlignWith, AutoCorrect, Severity.
13
+ # This cop supports safe autocorrection (--autocorrect).
14
+ # Configuration parameters: EnforcedStyleAlignWith.
19
15
  # SupportedStylesAlignWith: keyword, variable, start_of_line
20
16
  Layout/EndAlignment:
21
17
  Exclude:
22
18
  - 'lib/mongoid/full_text_search.rb'
23
19
 
24
- # Offense count: 1
20
+ # This cop supports unsafe autocorrection (--autocorrect-all).
25
21
  # Configuration parameters: AllowSafeAssignment.
26
22
  Lint/AssignmentInCondition:
27
23
  Exclude:
28
24
  - 'lib/mongoid/full_text_search.rb'
29
25
 
30
- # Offense count: 2
31
- Lint/HandleExceptions:
26
+ # This cop supports unsafe autocorrection (--autocorrect-all).
27
+ Lint/NonDeterministicRequireOrder:
32
28
  Exclude:
33
- - 'lib/mongoid/full_text_search.rb'
34
- - 'spec/mongoid/full_text_search_spec.rb'
29
+ - 'spec/spec_helper.rb'
35
30
 
36
- # Offense count: 1
37
- Lint/NonLocalExitFromIterator:
31
+ # Configuration parameters: AllowComments, AllowNil.
32
+ Lint/SuppressedException:
38
33
  Exclude:
39
- - 'lib/mongoid/full_text_search.rb'
34
+ - 'spec/mongoid/full_text_search_spec.rb'
40
35
 
41
- # Offense count: 4
36
+ # This cop supports safe autocorrection (--autocorrect).
42
37
  Lint/UselessAssignment:
43
38
  Exclude:
44
39
  - 'spec/mongoid/full_text_search_spec.rb'
45
40
 
46
- # Offense count: 5
41
+ # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
47
42
  Metrics/AbcSize:
48
- Max: 104
43
+ Exclude:
44
+ - 'lib/mongoid/full_text_search.rb'
45
+ - 'lib/mongoid/full_text_search/field_scores.rb'
46
+ - 'lib/mongoid/full_text_search/index_definition.rb'
47
+ - 'lib/mongoid/full_text_search/ngrams.rb'
49
48
 
50
- # Offense count: 7
51
- # Configuration parameters: CountComments, ExcludedMethods.
49
+ # Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
50
+ # AllowedMethods: refine
52
51
  Metrics/BlockLength:
53
- Max: 622
54
-
55
- # Offense count: 4
52
+ Exclude:
53
+ - 'lib/mongoid/full_text_search.rb'
54
+ - 'spec/mongoid/array_fields_spec.rb'
55
+ - 'spec/mongoid/bulk_indexing_spec.rb'
56
+ - 'spec/mongoid/criteria_search_spec.rb'
57
+ - 'spec/mongoid/full_text_search_spec.rb'
58
+ - 'spec/mongoid/localized_fields_spec.rb'
59
+ - 'spec/mongoid/ngram_sampling_spec.rb'
60
+ - 'spec/mongoid/non_latin_spec.rb'
61
+ - 'spec/mongoid/weighted_fields_spec.rb'
62
+ - 'spec/release/release_spec.rb'
63
+ - 'spec/unit/field_scores_spec.rb'
64
+ - 'spec/unit/index_definition_spec.rb'
65
+ - 'spec/unit/ngrams_spec.rb'
66
+
67
+ # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
56
68
  Metrics/CyclomaticComplexity:
57
- Max: 22
69
+ Exclude:
70
+ - 'lib/mongoid/full_text_search.rb'
71
+ - 'lib/mongoid/full_text_search/field_scores.rb'
72
+ - 'lib/mongoid/full_text_search/index_definition.rb'
73
+ - 'lib/mongoid/full_text_search/ngrams.rb'
58
74
 
59
- # Offense count: 5
60
- # Configuration parameters: CountComments.
75
+ # Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
61
76
  Metrics/MethodLength:
62
- Max: 50
77
+ Exclude:
78
+ - 'lib/mongoid/full_text_search.rb'
79
+ - 'lib/mongoid/full_text_search/field_scores.rb'
80
+ - 'lib/mongoid/full_text_search/index_definition.rb'
81
+ - 'lib/mongoid/full_text_search/ngrams.rb'
63
82
 
64
- # Offense count: 1
65
- # Configuration parameters: CountComments.
83
+ # Configuration parameters: CountComments, Max, CountAsOne.
66
84
  Metrics/ModuleLength:
67
- Max: 223
85
+ Exclude:
86
+ - 'lib/mongoid/full_text_search.rb'
68
87
 
69
- # Offense count: 4
88
+ # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
70
89
  Metrics/PerceivedComplexity:
71
- Max: 25
90
+ Exclude:
91
+ - 'lib/mongoid/full_text_search.rb'
92
+ - 'lib/mongoid/full_text_search/field_scores.rb'
93
+ - 'lib/mongoid/full_text_search/ngrams.rb'
72
94
 
73
- # Offense count: 1
74
95
  Naming/ConstantName:
75
96
  Exclude:
76
97
  - 'spec/models/russian_artwork.rb'
77
98
 
78
- # Offense count: 1
79
- # Configuration parameters: AllowedChars.
80
- Style/AsciiComments:
99
+ # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
100
+ # SupportedStyles: snake_case, normalcase, non_integer
101
+ # AllowedIdentifiers: TLS1_1, TLS1_2, capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
102
+ Naming/VariableNumber:
81
103
  Exclude:
82
104
  - 'spec/mongoid/full_text_search_spec.rb'
83
105
 
84
- # Offense count: 1
85
- # Cop supports --auto-correct.
86
- # Configuration parameters: AutoCorrect, EnforcedStyle.
106
+ # This cop supports unsafe autocorrection (--autocorrect-all).
107
+ # Configuration parameters: EnforcedStyle, EnforcedStyleForClasses, EnforcedStyleForModules.
87
108
  # SupportedStyles: nested, compact
109
+ # SupportedStylesForClasses: ~, nested, compact
110
+ # SupportedStylesForModules: ~, nested, compact
88
111
  Style/ClassAndModuleChildren:
89
112
  Exclude:
90
113
  - 'lib/mongoid/full_text_search.rb'
91
114
 
92
- # Offense count: 4
115
+ # Configuration parameters: AllowedConstants.
93
116
  Style/Documentation:
94
117
  Exclude:
95
- - 'spec/**/*'
96
- - 'test/**/*'
97
118
  - 'lib/mongoid/full_text_search.rb'
98
119
  - 'lib/mongoid/full_text_search/indexable.rb'
99
120
  - 'lib/mongoid/full_text_search/indexes.rb'
100
121
 
101
- # Offense count: 3
102
- # Cop supports --auto-correct.
122
+ # This cop supports safe autocorrection (--autocorrect).
103
123
  # Configuration parameters: EnforcedStyle.
104
124
  # SupportedStyles: format, sprintf, percent
105
125
  Style/FormatString:
@@ -107,30 +127,55 @@ Style/FormatString:
107
127
  - 'lib/mongoid/full_text_search.rb'
108
128
  - 'spec/models/external_artwork_no_fields_supplied.rb'
109
129
 
110
- # Offense count: 6
111
- # Configuration parameters: EnforcedStyle.
130
+ # This cop supports safe autocorrection (--autocorrect).
131
+ # Configuration parameters: MaxUnannotatedPlaceholdersAllowed, Mode, AllowedMethods, AllowedPatterns.
112
132
  # SupportedStyles: annotated, template, unannotated
113
133
  Style/FormatStringToken:
134
+ EnforcedStyle: unannotated
135
+
136
+ # This cop supports safe autocorrection (--autocorrect).
137
+ Style/IfUnlessModifier:
114
138
  Exclude:
115
139
  - 'lib/mongoid/full_text_search.rb'
116
- - 'spec/models/external_artwork_no_fields_supplied.rb'
140
+ - 'lib/mongoid/full_text_search/field_scores.rb'
141
+ - 'spec/mongoid/full_text_search_spec.rb'
117
142
 
118
- # Offense count: 2
119
143
  Style/MultilineBlockChain:
120
144
  Exclude:
121
145
  - 'lib/mongoid/full_text_search.rb'
122
146
 
123
- # Offense count: 2
124
- # Cop supports --auto-correct.
125
- # Configuration parameters: AutoCorrect, EnforcedStyle.
147
+ # This cop supports unsafe autocorrection (--autocorrect-all).
148
+ # Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
126
149
  # SupportedStyles: predicate, comparison
127
150
  Style/NumericPredicate:
128
151
  Exclude:
129
- - 'spec/**/*'
130
152
  - 'lib/mongoid/full_text_search.rb'
131
153
 
132
- # Offense count: 262
133
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
154
+ # Configuration parameters: AllowedMethods.
155
+ # AllowedMethods: respond_to_missing?
156
+ Style/OptionalBooleanParameter:
157
+ Exclude:
158
+ - 'lib/mongoid/full_text_search.rb'
159
+ - 'lib/mongoid/full_text_search/ngrams.rb'
160
+
161
+ # This cop supports unsafe autocorrection (--autocorrect-all).
162
+ # Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments.
163
+ # AllowedMethods: define_method
164
+ Style/SymbolProc:
165
+ Exclude:
166
+ - 'spec/models/filtered_artwork.rb'
167
+
168
+ # This cop supports safe autocorrection (--autocorrect).
169
+ # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
134
170
  # URISchemes: http, https
135
- Metrics/LineLength:
136
- Max: 174
171
+ # AllowedPatterns: (?-mix:^\#)
172
+ Layout/LineLength:
173
+ Exclude:
174
+ - 'lib/mongoid/full_text_search.rb'
175
+ - 'lib/mongoid/full_text_search/field_scores.rb'
176
+ - 'script/release.rb'
177
+ - 'spec/mongoid/full_text_search_spec.rb'
178
+ - 'spec/mongoid/localized_fields_spec.rb'
179
+ - 'spec/mongoid/weighted_fields_spec.rb'
180
+ - 'spec/release/release_spec.rb'
181
+ - 'spec/unit/index_definition_spec.rb'