blacklight 7.10.0 → 7.13.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (238) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +89 -0
  3. data/.rubocop.yml +65 -5
  4. data/.rubocop_todo.yml +113 -98
  5. data/.solr_wrapper.yml +5 -0
  6. data/Gemfile +0 -7
  7. data/README.md +1 -0
  8. data/VERSION +1 -1
  9. data/app/assets/javascripts/blacklight/blacklight.js +1 -2
  10. data/app/builders/blacklight/action_builder.rb +6 -0
  11. data/app/components/blacklight/constraint_component.html.erb +5 -0
  12. data/app/components/blacklight/constraint_component.rb +13 -0
  13. data/app/components/blacklight/constraint_layout_component.rb +2 -1
  14. data/app/components/blacklight/constraints_component.html.erb +10 -0
  15. data/app/components/blacklight/constraints_component.rb +67 -0
  16. data/app/components/blacklight/document/action_component.html.erb +9 -0
  17. data/app/components/blacklight/document/action_component.rb +38 -0
  18. data/app/components/blacklight/document/actions_component.html.erb +13 -0
  19. data/app/components/blacklight/document/actions_component.rb +26 -0
  20. data/app/components/blacklight/document/bookmark_component.html.erb +16 -0
  21. data/app/components/blacklight/document/bookmark_component.rb +27 -0
  22. data/app/components/blacklight/document/citation_component.html.erb +11 -0
  23. data/app/components/blacklight/document/citation_component.rb +31 -0
  24. data/app/components/blacklight/document/group_component.html.erb +9 -0
  25. data/app/components/blacklight/document/group_component.rb +26 -0
  26. data/app/components/blacklight/document/more_like_this_component.html.erb +12 -0
  27. data/app/components/blacklight/document/more_like_this_component.rb +23 -0
  28. data/app/components/blacklight/document/thumbnail_component.html.erb +12 -0
  29. data/app/components/blacklight/document/thumbnail_component.rb +25 -0
  30. data/app/components/blacklight/document_component.html.erb +30 -0
  31. data/app/components/blacklight/document_component.rb +135 -0
  32. data/app/components/blacklight/document_metadata_component.html.erb +5 -0
  33. data/app/components/blacklight/document_metadata_component.rb +21 -0
  34. data/app/components/blacklight/facet_field_component.html.erb +1 -0
  35. data/app/components/blacklight/facet_field_filter_component.html.erb +12 -0
  36. data/app/components/blacklight/facet_field_filter_component.rb +25 -0
  37. data/app/components/blacklight/facet_field_pagination_component.html.erb +19 -0
  38. data/app/components/blacklight/facet_field_pagination_component.rb +17 -0
  39. data/app/components/blacklight/facet_item_component.rb +10 -14
  40. data/app/components/blacklight/metadata_field_component.html.erb +8 -0
  41. data/app/components/blacklight/metadata_field_component.rb +31 -0
  42. data/app/components/blacklight/metadata_field_layout_component.html.erb +2 -0
  43. data/app/components/blacklight/metadata_field_layout_component.rb +16 -0
  44. data/app/components/blacklight/response/facet_group_component.html.erb +27 -0
  45. data/app/components/blacklight/response/facet_group_component.rb +26 -0
  46. data/app/components/blacklight/response/pagination_component.html.erb +3 -0
  47. data/app/components/blacklight/response/pagination_component.rb +20 -0
  48. data/app/components/blacklight/response/sort_component.html.erb +6 -0
  49. data/app/components/blacklight/response/sort_component.rb +16 -0
  50. data/app/components/blacklight/response/spellcheck_component.html.erb +7 -0
  51. data/app/components/blacklight/response/spellcheck_component.rb +27 -0
  52. data/app/components/blacklight/response/view_type_component.html.erb +11 -0
  53. data/app/components/blacklight/response/view_type_component.rb +36 -0
  54. data/app/components/blacklight/search_bar_component.html.erb +29 -0
  55. data/app/components/blacklight/search_bar_component.rb +51 -0
  56. data/app/components/blacklight/search_context_component.html.erb +10 -0
  57. data/app/components/blacklight/search_context_component.rb +34 -0
  58. data/app/components/blacklight/system/dropdown_component.html.erb +12 -0
  59. data/app/components/blacklight/system/dropdown_component.rb +42 -0
  60. data/app/components/blacklight/system/flash_message_component.html.erb +4 -0
  61. data/app/components/blacklight/system/flash_message_component.rb +24 -0
  62. data/app/components/blacklight/system/modal_component.html.erb +25 -0
  63. data/app/components/blacklight/system/modal_component.rb +9 -0
  64. data/app/controllers/concerns/blacklight/catalog.rb +12 -5
  65. data/app/controllers/concerns/blacklight/controller.rb +12 -3
  66. data/app/controllers/concerns/blacklight/default_component_configuration.rb +2 -2
  67. data/app/controllers/concerns/blacklight/facet.rb +19 -5
  68. data/app/controllers/concerns/blacklight/search_context.rb +1 -1
  69. data/app/controllers/concerns/blacklight/search_fields.rb +7 -1
  70. data/app/controllers/concerns/blacklight/searchable.rb +12 -1
  71. data/app/helpers/blacklight/blacklight_helper_behavior.rb +141 -20
  72. data/app/helpers/blacklight/catalog_helper_behavior.rb +37 -5
  73. data/app/helpers/blacklight/component_helper_behavior.rb +36 -6
  74. data/app/helpers/blacklight/configuration_helper_behavior.rb +39 -11
  75. data/app/helpers/blacklight/facets_helper_behavior.rb +40 -11
  76. data/app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb +5 -0
  77. data/app/helpers/blacklight/icon_helper_behavior.rb +2 -2
  78. data/app/helpers/blacklight/render_constraints_helper_behavior.rb +35 -16
  79. data/app/helpers/blacklight/render_partials_helper_behavior.rb +8 -3
  80. data/app/helpers/blacklight/search_history_constraints_helper_behavior.rb +11 -12
  81. data/app/helpers/blacklight/suggest_helper_behavior.rb +1 -0
  82. data/app/helpers/blacklight/url_helper_behavior.rb +26 -6
  83. data/app/javascript/blacklight/search_context.js +0 -1
  84. data/app/models/blacklight/icon.rb +1 -1
  85. data/app/models/concerns/blacklight/document.rb +2 -1
  86. data/app/models/concerns/blacklight/suggest/response.rb +1 -1
  87. data/app/presenters/blacklight/document_presenter.rb +53 -2
  88. data/app/presenters/blacklight/facet_field_presenter.rb +3 -1
  89. data/app/presenters/blacklight/facet_item_presenter.rb +14 -2
  90. data/app/presenters/blacklight/field_presenter.rb +10 -6
  91. data/app/presenters/blacklight/index_presenter.rb +2 -2
  92. data/app/presenters/blacklight/json_presenter.rb +3 -1
  93. data/app/presenters/blacklight/rendering/link_to_facet.rb +3 -1
  94. data/app/presenters/blacklight/rendering/microdata.rb +1 -1
  95. data/app/presenters/blacklight/show_presenter.rb +4 -34
  96. data/app/presenters/blacklight/thumbnail_presenter.rb +5 -1
  97. data/app/services/blacklight/document_factory.rb +3 -0
  98. data/app/services/blacklight/field_retriever.rb +19 -4
  99. data/app/services/blacklight/search_service.rb +14 -12
  100. data/app/views/bookmarks/_tools.html.erb +12 -7
  101. data/app/views/catalog/_bookmark_control.html.erb +1 -36
  102. data/app/views/catalog/_citation.html.erb +4 -25
  103. data/app/views/catalog/_constraints.html.erb +12 -7
  104. data/app/views/catalog/_did_you_mean.html.erb +1 -5
  105. data/app/views/catalog/_document.atom.builder +12 -9
  106. data/app/views/catalog/_document.html.erb +5 -5
  107. data/app/views/catalog/_document.rss.builder +4 -2
  108. data/app/views/catalog/_facet_group.html.erb +5 -19
  109. data/app/views/catalog/_facet_index_navigation.html.erb +1 -10
  110. data/app/views/catalog/_facet_pagination.html.erb +1 -19
  111. data/app/views/catalog/_facets.html.erb +1 -1
  112. data/app/views/catalog/_group.html.erb +1 -9
  113. data/app/views/catalog/_index.html.erb +1 -10
  114. data/app/views/catalog/_paginate_compact.html.erb +6 -6
  115. data/app/views/catalog/_per_page_widget.html.erb +9 -12
  116. data/app/views/catalog/_previous_next_doc.html.erb +1 -12
  117. data/app/views/catalog/_results_pagination.html.erb +1 -3
  118. data/app/views/catalog/_search_form.html.erb +6 -27
  119. data/app/views/catalog/_search_results.html.erb +1 -1
  120. data/app/views/catalog/_show.html.erb +6 -8
  121. data/app/views/catalog/_show_header.html.erb +1 -1
  122. data/app/views/catalog/_show_main_content.html.erb +20 -14
  123. data/app/views/catalog/_show_sidebar.html.erb +1 -11
  124. data/app/views/catalog/_show_tools.html.erb +12 -8
  125. data/app/views/catalog/_sort_widget.html.erb +5 -12
  126. data/app/views/catalog/_start_over.html.erb +1 -1
  127. data/app/views/catalog/_thumbnail.html.erb +1 -5
  128. data/app/views/catalog/_view_type_group.html.erb +5 -13
  129. data/app/views/catalog/email.html.erb +7 -7
  130. data/app/views/catalog/email_success.html.erb +5 -12
  131. data/app/views/catalog/facet.html.erb +14 -17
  132. data/app/views/catalog/index.atom.builder +0 -1
  133. data/app/views/catalog/index.json.jbuilder +10 -6
  134. data/app/views/catalog/show.json.jbuilder +1 -1
  135. data/app/views/catalog/sms.html.erb +7 -7
  136. data/app/views/catalog/sms_success.html.erb +5 -12
  137. data/app/views/shared/_flash_msg.html.erb +1 -15
  138. data/blacklight.gemspec +4 -2
  139. data/config/i18n-tasks.yml +3 -0
  140. data/config/locales/blacklight.ar.yml +2 -0
  141. data/config/locales/blacklight.ca.yml +241 -0
  142. data/config/locales/blacklight.de.yml +2 -0
  143. data/config/locales/blacklight.en.yml +2 -0
  144. data/config/locales/blacklight.es.yml +4 -2
  145. data/config/locales/blacklight.fr.yml +2 -0
  146. data/config/locales/blacklight.hu.yml +2 -0
  147. data/config/locales/blacklight.it.yml +2 -0
  148. data/config/locales/blacklight.nl.yml +2 -0
  149. data/config/locales/blacklight.pt-BR.yml +2 -0
  150. data/config/locales/blacklight.sq.yml +2 -0
  151. data/config/locales/blacklight.zh.yml +2 -0
  152. data/lib/blacklight.rb +10 -0
  153. data/lib/blacklight/abstract_repository.rb +13 -4
  154. data/lib/blacklight/configuration.rb +19 -8
  155. data/lib/blacklight/configuration/display_field.rb +50 -0
  156. data/lib/blacklight/configuration/facet_field.rb +65 -1
  157. data/lib/blacklight/configuration/field.rb +13 -0
  158. data/lib/blacklight/configuration/fields.rb +5 -7
  159. data/lib/blacklight/configuration/index_field.rb +5 -0
  160. data/lib/blacklight/configuration/search_field.rb +8 -0
  161. data/lib/blacklight/configuration/show_field.rb +5 -0
  162. data/lib/blacklight/configuration/sort_field.rb +3 -0
  163. data/lib/blacklight/configuration/tool_config.rb +5 -0
  164. data/lib/blacklight/configuration/view_config.rb +37 -0
  165. data/lib/blacklight/engine.rb +1 -1
  166. data/lib/blacklight/nested_open_struct_with_hash_access.rb +2 -1
  167. data/lib/blacklight/search_builder.rb +13 -23
  168. data/lib/blacklight/search_state.rb +107 -79
  169. data/lib/blacklight/search_state/filter_field.rb +122 -0
  170. data/lib/blacklight/solr/repository.rb +1 -1
  171. data/lib/blacklight/solr/response.rb +1 -0
  172. data/lib/blacklight/solr/response/facets.rb +9 -8
  173. data/lib/blacklight/solr/search_builder_behavior.rb +71 -51
  174. data/lib/generators/blacklight/models_generator.rb +2 -0
  175. data/lib/generators/blacklight/templates/catalog_controller.rb +8 -7
  176. data/lib/generators/blacklight/templates/config/blacklight.yml +1 -0
  177. data/lib/railties/blacklight.rake +18 -13
  178. data/package.json +5 -1
  179. data/spec/components/blacklight/constraint_layout_component_spec.rb +1 -0
  180. data/spec/components/blacklight/document/action_component_spec.rb +43 -0
  181. data/spec/components/blacklight/document/group_component_spec.rb +45 -0
  182. data/spec/components/blacklight/document_component_spec.rb +152 -0
  183. data/spec/components/blacklight/document_metadata_component_spec.rb +0 -0
  184. data/spec/components/blacklight/facet_item_pivot_component_spec.rb +0 -1
  185. data/spec/components/blacklight/metadata_field_component_spec.rb +41 -0
  186. data/spec/components/blacklight/system/flash_message_component_spec.rb +54 -0
  187. data/spec/controllers/blacklight/search_fields_spec.rb +4 -2
  188. data/spec/controllers/catalog_controller_spec.rb +22 -0
  189. data/spec/features/search_context_spec.rb +12 -2
  190. data/spec/features/search_filters_spec.rb +4 -0
  191. data/spec/features/search_results_spec.rb +1 -0
  192. data/spec/features/search_spec.rb +0 -5
  193. data/spec/features/sitelinks_search_box.rb +1 -0
  194. data/spec/helpers/blacklight/configuration_helper_behavior_spec.rb +4 -2
  195. data/spec/helpers/blacklight/facets_helper_behavior_spec.rb +6 -1
  196. data/spec/helpers/blacklight/hash_as_hidden_fields_behavior_spec.rb +2 -0
  197. data/spec/helpers/blacklight/render_constraints_helper_behavior_spec.rb +2 -0
  198. data/spec/helpers/blacklight/render_partials_helper_behavior_spec.rb +4 -1
  199. data/spec/helpers/blacklight/search_history_constraints_helper_behavior_spec.rb +2 -0
  200. data/spec/helpers/blacklight/url_helper_behavior_spec.rb +3 -1
  201. data/spec/helpers/blacklight_helper_spec.rb +24 -1
  202. data/spec/helpers/catalog_helper_spec.rb +5 -8
  203. data/spec/lib/blacklight/configuration/facet_field_spec.rb +17 -0
  204. data/spec/lib/blacklight/configuration/view_config_spec.rb +15 -0
  205. data/spec/lib/blacklight/nested_open_struct_with_hash_access_spec.rb +9 -0
  206. data/spec/lib/blacklight/search_state/filter_field_spec.rb +125 -0
  207. data/spec/lib/blacklight/search_state_spec.rb +164 -3
  208. data/spec/models/blacklight/configuration_spec.rb +13 -0
  209. data/spec/models/blacklight/document/cache_key_spec.rb +1 -0
  210. data/spec/models/blacklight/document/email_spec.rb +2 -0
  211. data/spec/models/blacklight/document/sms_spec.rb +2 -0
  212. data/spec/models/blacklight/facet_paginator_spec.rb +3 -0
  213. data/spec/models/blacklight/icon_spec.rb +6 -0
  214. data/spec/models/blacklight/search_builder_spec.rb +1 -1
  215. data/spec/models/blacklight/solr/document_spec.rb +10 -0
  216. data/spec/models/blacklight/solr/response/facets_spec.rb +1 -1
  217. data/spec/models/blacklight/solr/response/group_response_spec.rb +2 -0
  218. data/spec/models/blacklight/solr/search_builder_spec.rb +50 -2
  219. data/spec/models/record_mailer_spec.rb +9 -0
  220. data/spec/models/search_spec.rb +1 -0
  221. data/spec/presenters/blacklight/field_presenter_spec.rb +30 -5
  222. data/spec/presenters/blacklight/show_presenter_spec.rb +8 -0
  223. data/spec/routing/catalog_routing_spec.rb +4 -0
  224. data/spec/services/blacklight/search_service_spec.rb +7 -4
  225. data/spec/spec_helper.rb +1 -1
  226. data/spec/views/catalog/_constraints.html.erb_spec.rb +2 -1
  227. data/spec/views/catalog/_document.html.erb_spec.rb +13 -11
  228. data/spec/views/catalog/_facet_group.html.erb_spec.rb +1 -0
  229. data/spec/views/catalog/_facet_index_navigation.html.erb_spec.rb +5 -2
  230. data/spec/views/catalog/_previous_next_doc.html.erb_spec.rb +4 -0
  231. data/spec/views/catalog/_show_tools.html.erb_spec.rb +8 -8
  232. data/spec/views/catalog/index.atom.builder_spec.rb +40 -3
  233. data/spec/views/catalog/show.html.erb_spec.rb +14 -0
  234. data/spec/views/catalog/show.json.jbuilder_spec.rb +1 -0
  235. data/tasks/blacklight.rake +34 -19
  236. metadata +107 -8
  237. data/.npmignore +0 -23
  238. data/.travis.yml +0 -42
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b7f2fb6980380cf12a51209225c105a4553f662015935c12335f7f0092086d6
4
- data.tar.gz: fa8de265b2adfc5ca3e1bc6c8f94e6ed7cdbbd3d465b70516924c30aaf6d3a4b
3
+ metadata.gz: c8fb80459866144384607d4a10514e767df6a91c2b4479056ff249e036872b92
4
+ data.tar.gz: f21dceeab6bc00811799379c7082af587a019101d570071baa98fa9f1aeb9886
5
5
  SHA512:
6
- metadata.gz: 3b2a6adc3e2affcfb8e0a193493b37e5b1fac9ccf98c5145a985b4bd8166b1cf2e525d7f603eb1fbca7170ea6f1c32823e9acd6b0f55fa103fe637cba5628ccb
7
- data.tar.gz: 126dff3afa6c1db27e4b707952b9ce82926ca66c5882164739e0a5ba63a95c1f8af9c069a151fd0f031705d8757dac57c9013b9c7c64dbd6d6a4ec05fbbff4ab
6
+ metadata.gz: 9613e0b9fbfbf15765fd21175c942f3f65c208cfdcaf8ded9158520a44ea507896e7419a53085071badf1e0452071b81d99cd2013cbdb727c85f944e87524fc1
7
+ data.tar.gz: 684cbee2ba2125ac367445bad68ac18d1d2d437c724ad0f0c6a3ac2648705a933e1edb6631193499b4836035e3c6da5b3528a988e555a34b3f1b529b90429e86
@@ -0,0 +1,89 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: CI
9
+
10
+ on:
11
+ push:
12
+ branches: [ master ]
13
+ pull_request:
14
+ branches: [ master ]
15
+
16
+ jobs:
17
+ lint:
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@v2
21
+ - name: Set up Ruby
22
+ uses: ruby/setup-ruby@v1
23
+ with:
24
+ ruby-version: 2.7
25
+ - name: Install dependencies
26
+ run: bundle install
27
+ - name: Run linter
28
+ run: bundle exec rake rubocop
29
+ test:
30
+ runs-on: ubuntu-latest
31
+ strategy:
32
+ matrix:
33
+ ruby: [2.6, 2.7]
34
+ steps:
35
+ - uses: actions/checkout@v2
36
+ - name: Set up Ruby
37
+ uses: ruby/setup-ruby@v1
38
+ with:
39
+ ruby-version: ${{ matrix.ruby }}
40
+ - name: Install dependencies
41
+ run: bundle install
42
+ - name: Run tests
43
+ run: bundle exec rake ci
44
+ env:
45
+ ENGINE_CART_RAILS_OPTIONS: '--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-test'
46
+ test_rails5:
47
+ runs-on: ubuntu-latest
48
+ strategy:
49
+ matrix:
50
+ ruby: [2.5, 2.6]
51
+ steps:
52
+ - uses: actions/checkout@v2
53
+ - name: Set up Ruby
54
+ uses: ruby/setup-ruby@v1
55
+ with:
56
+ ruby-version: ${{ matrix.ruby }}
57
+ - name: Install dependencies
58
+ run: bundle install
59
+ env:
60
+ RAILS_VERSION: 5.2.4.2
61
+ - name: Run tests
62
+ run: bundle exec rake ci
63
+ env:
64
+ RAILS_VERSION: 5.2.4.2
65
+ ENGINE_CART_RAILS_OPTIONS: '--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-test'
66
+ api_test:
67
+ runs-on: ubuntu-latest
68
+ strategy:
69
+ matrix:
70
+ ruby: [2.7]
71
+ steps:
72
+ - uses: actions/checkout@v2
73
+ - name: Set up Ruby
74
+ uses: ruby/setup-ruby@v1
75
+ with:
76
+ ruby-version: ${{ matrix.ruby }}
77
+ - name: Install dependencies
78
+ run: bundle install
79
+ - name: Run tests
80
+ run: bundle exec rake ci
81
+ env:
82
+ BLACKLIGHT_API_TEST: true
83
+ ENGINE_CART_RAILS_OPTIONS: '--api --skip-git --skip-bundle --skip-listen --skip-spring --skip-yarn --skip-keeps --skip-action-cable --skip-coffee --skip-test'
84
+ docker_build:
85
+ runs-on: ubuntu-latest
86
+ steps:
87
+ - uses: actions/checkout@v2
88
+ - name: Build docker image
89
+ run: docker-compose build app
@@ -1,11 +1,14 @@
1
- require: rubocop-rspec
1
+ require:
2
+ - rubocop-rspec
3
+ - rubocop-rails
4
+
2
5
 
3
6
  inherit_from:
4
7
  - .rubocop_todo.yml
5
8
 
6
9
  AllCops:
7
10
  DisplayCopNames: true
8
- TargetRubyVersion: 2.3
11
+ TargetRubyVersion: 2.5
9
12
  Exclude:
10
13
  - "lib/generators/blacklight/templates/**/*"
11
14
  - "blacklight.gemspec"
@@ -26,6 +29,7 @@ Layout/IndentationConsistency:
26
29
  Metrics/BlockLength:
27
30
  Exclude:
28
31
  - "app/views/catalog/index.json.jbuilder"
32
+ - "app/views/catalog/_document.atom.builder"
29
33
  - "lib/railties/blacklight.rake"
30
34
  - "tasks/blacklight.rake"
31
35
  - "spec/**/*"
@@ -33,23 +37,35 @@ Metrics/BlockLength:
33
37
  Metrics/ClassLength:
34
38
  Exclude:
35
39
  - "lib/blacklight/configuration.rb"
40
+ - "lib/blacklight/search_builder.rb"
41
+ - "lib/blacklight/search_state.rb"
36
42
 
37
- Metrics/LineLength:
43
+ Layout/LineLength:
38
44
  Max: 200
39
45
  Exclude:
40
46
  - 'spec/**/*'
41
47
 
48
+ Metrics/ModuleLength:
49
+ Exclude:
50
+ - 'app/controllers/concerns/blacklight/catalog.rb'
51
+ - 'lib/blacklight/solr/search_builder_behavior.rb'
52
+
42
53
  Naming/HeredocDelimiterNaming:
43
54
  Enabled: false
44
55
 
56
+ Naming/MethodParameterName:
57
+ AllowedNames:
58
+ - id
59
+ - q
60
+
45
61
  Naming/PredicateName:
46
- NamePrefixBlacklist:
62
+ ForbiddenPrefixes:
47
63
  - is_
48
64
 
49
65
  Rails:
50
66
  Enabled: true
51
67
 
52
- Rails/OutputSafety:
68
+ Rails/ApplicationMailer:
53
69
  Enabled: false
54
70
 
55
71
  # https://github.com/rubocop-hq/rubocop/issues/6439
@@ -62,3 +78,47 @@ Style/MissingRespondToMissing:
62
78
 
63
79
  Style/StringLiterals:
64
80
  Enabled: false
81
+
82
+ Style/MethodDefParentheses:
83
+ Enabled: false
84
+
85
+ Layout/EmptyLinesAroundAttributeAccessor:
86
+ Enabled: true
87
+
88
+ Layout/SpaceAroundMethodCallOperator:
89
+ Enabled: true
90
+
91
+ Lint/DeprecatedOpenSSLConstant:
92
+ Enabled: true
93
+
94
+ Lint/MixedRegexpCaptureTypes:
95
+ Enabled: true
96
+
97
+ Lint/RaiseException:
98
+ Enabled: true
99
+
100
+ Lint/StructNewOverride:
101
+ Enabled: true
102
+
103
+ Style/ExponentialNotation:
104
+ Enabled: true
105
+
106
+ Style/HashEachMethods:
107
+ Enabled: true
108
+ Exclude:
109
+ - 'spec/services/blacklight/search_service_spec.rb'
110
+
111
+ Style/HashTransformKeys:
112
+ Enabled: true
113
+
114
+ Style/HashTransformValues:
115
+ Enabled: true
116
+
117
+ Style/RedundantRegexpCharacterClass:
118
+ Enabled: true
119
+
120
+ Style/RedundantRegexpEscape:
121
+ Enabled: true
122
+
123
+ Style/SlicingWithRange:
124
+ Enabled: true
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2020-03-30 10:03:33 -0700 using RuboCop version 0.63.1.
3
+ # on 2020-09-24 02:12:21 UTC using RuboCop version 0.91.1.
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
@@ -12,13 +12,13 @@ Capybara/CurrentPathExpectation:
12
12
  Exclude:
13
13
  - 'spec/features/alternate_controller_spec.rb'
14
14
 
15
- # Offense count: 2
16
- # Cop supports --auto-correct.
17
- # Configuration parameters: EnforcedStyle, IndentationWidth.
18
- # SupportedStyles: with_first_parameter, with_fixed_indentation
19
- Layout/AlignParameters:
15
+ # Offense count: 20
16
+ Capybara/VisibilityMatcher:
20
17
  Exclude:
21
- - 'app/views/catalog/_document.atom.builder'
18
+ - 'spec/features/facets_spec.rb'
19
+ - 'spec/features/search_filters_spec.rb'
20
+ - 'spec/helpers/blacklight/hash_as_hidden_fields_behavior_spec.rb'
21
+ - 'spec/helpers/blacklight_helper_spec.rb'
22
22
 
23
23
  # Offense count: 8
24
24
  # Cop supports --auto-correct.
@@ -36,14 +36,22 @@ Layout/ClosingParenthesisIndentation:
36
36
  Exclude:
37
37
  - 'app/views/catalog/index.atom.builder'
38
38
 
39
- # Offense count: 109
39
+ # Offense count: 111
40
40
  # Cop supports --auto-correct.
41
41
  Layout/EmptyLineAfterMagicComment:
42
42
  Enabled: false
43
43
 
44
+ # Offense count: 1
45
+ # Cop supports --auto-correct.
46
+ # Configuration parameters: AllowAliasSyntax, AllowedMethods.
47
+ # AllowedMethods: alias_method, public, protected, private
48
+ Layout/EmptyLinesAroundAttributeAccessor:
49
+ Exclude:
50
+ - 'app/presenters/blacklight/field_presenter.rb'
51
+
44
52
  # Offense count: 7
45
53
  # Cop supports --auto-correct.
46
- # Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
54
+ # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
47
55
  Layout/ExtraSpacing:
48
56
  Exclude:
49
57
  - 'app/models/concerns/blacklight/document/dublin_core.rb'
@@ -55,12 +63,13 @@ Layout/ExtraSpacing:
55
63
  # Cop supports --auto-correct.
56
64
  # Configuration parameters: EnforcedStyle, IndentationWidth.
57
65
  # SupportedStyles: special_inside_parentheses, consistent, align_braces
58
- Layout/IndentHash:
66
+ Layout/FirstHashElementIndentation:
59
67
  Exclude:
60
68
  - 'lib/blacklight/configuration.rb'
61
69
 
62
70
  # Offense count: 6
63
71
  # Cop supports --auto-correct.
72
+ # Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment.
64
73
  Layout/LeadingCommentSpace:
65
74
  Exclude:
66
75
  - 'app/models/blacklight/facet_paginator.rb'
@@ -90,13 +99,12 @@ Layout/MultilineMethodCallIndentation:
90
99
  Exclude:
91
100
  - 'lib/blacklight/search_builder.rb'
92
101
 
93
- # Offense count: 11
102
+ # Offense count: 9
94
103
  # Cop supports --auto-correct.
95
104
  # Configuration parameters: EnforcedStyle, IndentationWidth.
96
105
  # SupportedStyles: aligned, indented
97
106
  Layout/MultilineOperationIndentation:
98
107
  Exclude:
99
- - 'app/helpers/blacklight/facets_helper_behavior.rb'
100
108
  - 'app/helpers/blacklight/search_history_constraints_helper_behavior.rb'
101
109
  - 'lib/blacklight/configuration/context.rb'
102
110
  - 'lib/blacklight/search_state.rb'
@@ -125,12 +133,20 @@ Layout/SpaceInsideParens:
125
133
  - 'app/views/catalog/_document.rss.builder'
126
134
  - 'app/views/catalog/index.atom.builder'
127
135
 
136
+ # Offense count: 1
137
+ # Cop supports --auto-correct.
138
+ # Configuration parameters: AllowInHeredoc.
139
+ Layout/TrailingWhitespace:
140
+ Exclude:
141
+ - 'lib/blacklight/configuration.rb'
142
+
128
143
  # Offense count: 1
129
144
  Lint/AmbiguousBlockAssociation:
130
145
  Exclude:
131
146
  - 'lib/blacklight/solr/search_builder_behavior.rb'
132
147
 
133
148
  # Offense count: 8
149
+ # Cop supports --auto-correct.
134
150
  Lint/AmbiguousOperator:
135
151
  Exclude:
136
152
  - 'spec/helpers/blacklight/facets_helper_behavior_spec.rb'
@@ -142,6 +158,7 @@ Lint/AmbiguousOperator:
142
158
  - 'spec/services/blacklight/search_service_spec.rb'
143
159
 
144
160
  # Offense count: 55
161
+ # Cop supports --auto-correct.
145
162
  Lint/AmbiguousRegexpLiteral:
146
163
  Exclude:
147
164
  - 'spec/controllers/catalog_controller_spec.rb'
@@ -156,10 +173,10 @@ Lint/AmbiguousRegexpLiteral:
156
173
  - 'spec/views/catalog/index.html.erb_spec.rb'
157
174
  - 'spec/views/catalog/show.html.erb_spec.rb'
158
175
 
159
- # Offense count: 30
176
+ # Offense count: 29
177
+ # Cop supports --auto-correct.
160
178
  Lint/ParenthesesAsGroupedExpression:
161
179
  Exclude:
162
- - 'spec/controllers/catalog_controller_spec.rb'
163
180
  - 'spec/features/did_you_mean_spec.rb'
164
181
  - 'spec/features/search_filters_spec.rb'
165
182
  - 'spec/features/search_pagination_spec.rb'
@@ -172,17 +189,13 @@ Lint/ShadowingOuterLocalVariable:
172
189
  Exclude:
173
190
  - 'spec/models/blacklight/configuration_spec.rb'
174
191
 
175
- # Offense count: 1
176
- Lint/UselessComparison:
177
- Exclude:
178
- - 'spec/models/blacklight/document/active_model_shim_spec.rb'
179
-
180
- # Offense count: 60
192
+ # Offense count: 57
193
+ # Configuration parameters: IgnoredMethods.
181
194
  Metrics/AbcSize:
182
- Max: 49
195
+ Max: 59
183
196
 
184
197
  # Offense count: 2
185
- # Configuration parameters: CountComments, ExcludedMethods.
198
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
186
199
  # ExcludedMethods: refine
187
200
  Metrics/BlockLength:
188
201
  Max: 30
@@ -193,32 +206,34 @@ Metrics/BlockNesting:
193
206
  Max: 4
194
207
 
195
208
  # Offense count: 2
196
- # Configuration parameters: CountComments.
209
+ # Configuration parameters: CountComments, CountAsOne.
197
210
  Metrics/ClassLength:
198
211
  Max: 169
199
212
 
200
- # Offense count: 19
213
+ # Offense count: 26
214
+ # Configuration parameters: IgnoredMethods.
201
215
  Metrics/CyclomaticComplexity:
202
- Max: 11
216
+ Max: 14
203
217
 
204
- # Offense count: 56
205
- # Configuration parameters: CountComments, ExcludedMethods.
218
+ # Offense count: 61
219
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
206
220
  Metrics/MethodLength:
207
221
  Max: 30
208
222
 
209
223
  # Offense count: 8
210
- # Configuration parameters: CountComments.
224
+ # Configuration parameters: CountComments, CountAsOne.
211
225
  Metrics/ModuleLength:
212
- Max: 212
226
+ Max: 213
213
227
 
214
- # Offense count: 5
228
+ # Offense count: 3
215
229
  # Configuration parameters: CountKeywordArgs.
216
230
  Metrics/ParameterLists:
217
- Max: 7
231
+ Max: 6
218
232
 
219
- # Offense count: 16
233
+ # Offense count: 22
234
+ # Configuration parameters: IgnoredMethods.
220
235
  Metrics/PerceivedComplexity:
221
- Max: 13
236
+ Max: 16
222
237
 
223
238
  # Offense count: 4
224
239
  # Configuration parameters: EnforcedStyleForLeadingUnderscores.
@@ -230,12 +245,11 @@ Naming/MemoizedInstanceVariableName:
230
245
  - 'app/models/concerns/blacklight/document/semantic_fields.rb'
231
246
  - 'lib/blacklight/solr/response.rb'
232
247
 
233
- # Offense count: 14
248
+ # Offense count: 13
234
249
  # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
235
- # AllowedNames: io, id, to, by, on, in, at, ip, db
236
- Naming/UncommunicativeMethodParamName:
250
+ # AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to
251
+ Naming/MethodParameterName:
237
252
  Exclude:
238
- - 'app/models/blacklight/facet_paginator.rb'
239
253
  - 'app/models/concerns/blacklight/document.rb'
240
254
  - 'app/presenters/blacklight/rendering/link_to_facet.rb'
241
255
  - 'lib/blacklight/nested_open_struct_with_hash_access.rb'
@@ -253,19 +267,6 @@ Naming/VariableNumber:
253
267
  - 'spec/views/catalog/_index.html.erb_spec.rb'
254
268
  - 'spec/views/catalog/_show.html.erb_spec.rb'
255
269
 
256
- # Offense count: 1
257
- # Cop supports --auto-correct.
258
- # Configuration parameters: AutoCorrect.
259
- Performance/TimesMap:
260
- Exclude:
261
- - 'spec/views/catalog/index.atom.builder_spec.rb'
262
-
263
- # Offense count: 2
264
- Performance/UnfreezeString:
265
- Exclude:
266
- - 'lib/generators/blacklight/install_generator.rb'
267
- - 'spec/helpers/blacklight_helper_spec.rb'
268
-
269
270
  # Offense count: 9
270
271
  RSpec/BeforeAfterAll:
271
272
  Exclude:
@@ -281,23 +282,24 @@ RSpec/BeforeAfterAll:
281
282
  - 'spec/models/blacklight/document/sms_spec.rb'
282
283
  - 'spec/models/blacklight/solr/document_spec.rb'
283
284
 
284
- # Offense count: 77
285
+ # Offense count: 81
285
286
  # Configuration parameters: Prefixes.
286
287
  # Prefixes: when, with, without
287
288
  RSpec/ContextWording:
288
289
  Enabled: false
289
290
 
290
- # Offense count: 56
291
+ # Offense count: 42
291
292
  RSpec/DescribeClass:
292
293
  Enabled: false
293
294
 
294
- # Offense count: 1
295
+ # Offense count: 2
295
296
  # Configuration parameters: CustomIncludeMethods.
296
297
  RSpec/EmptyExampleGroup:
297
298
  Exclude:
299
+ - 'spec/helpers/blacklight_helper_spec.rb'
298
300
  - 'spec/models/blacklight/solr/search_builder_spec.rb'
299
301
 
300
- # Offense count: 130
302
+ # Offense count: 134
301
303
  # Configuration parameters: Max.
302
304
  RSpec/ExampleLength:
303
305
  Enabled: false
@@ -312,7 +314,7 @@ RSpec/ExpectInHook:
312
314
  - 'spec/helpers/catalog_helper_spec.rb'
313
315
 
314
316
  # Offense count: 5
315
- # Configuration parameters: CustomTransform, IgnoreMethods.
317
+ # Configuration parameters: CustomTransform, IgnoreMethods, SpecSuffixOnly.
316
318
  RSpec/FilePath:
317
319
  Exclude:
318
320
  - 'spec/controllers/blacklight/catalog/component_configuration_spec.rb'
@@ -371,12 +373,16 @@ RSpec/MessageSpies:
371
373
  - 'spec/presenters/blacklight/field_presenter_spec.rb'
372
374
  - 'spec/presenters/thumbnail_presenter_spec.rb'
373
375
 
374
- # Offense count: 343
375
- # Configuration parameters: AggregateFailuresByDefault.
376
+ # Offense count: 363
376
377
  RSpec/MultipleExpectations:
377
378
  Max: 16
378
379
 
379
- # Offense count: 341
380
+ # Offense count: 160
381
+ # Configuration parameters: AllowSubject.
382
+ RSpec/MultipleMemoizedHelpers:
383
+ Max: 14
384
+
385
+ # Offense count: 337
380
386
  # Configuration parameters: IgnoreSharedExamples.
381
387
  RSpec/NamedSubject:
382
388
  Enabled: false
@@ -385,7 +391,7 @@ RSpec/NamedSubject:
385
391
  RSpec/NestedGroups:
386
392
  Max: 5
387
393
 
388
- # Offense count: 8
394
+ # Offense count: 11
389
395
  RSpec/RepeatedDescription:
390
396
  Exclude:
391
397
  - 'spec/features/search_results_spec.rb'
@@ -399,20 +405,29 @@ RSpec/RepeatedExample:
399
405
  - 'spec/models/blacklight/solr/document_spec.rb'
400
406
 
401
407
  # Offense count: 4
408
+ RSpec/RepeatedExampleGroupDescription:
409
+ Exclude:
410
+ - 'spec/helpers/blacklight/facets_helper_behavior_spec.rb'
411
+ - 'spec/services/blacklight/search_service_spec.rb'
412
+
413
+ # Offense count: 4
414
+ # Cop supports --auto-correct.
402
415
  RSpec/ScatteredLet:
403
416
  Exclude:
404
417
  - 'spec/helpers/catalog_helper_spec.rb'
405
418
  - 'spec/models/blacklight/solr/search_builder_spec.rb'
406
419
  - 'spec/views/catalog/index.atom.builder_spec.rb'
407
420
 
408
- # Offense count: 10
421
+ # Offense count: 13
409
422
  RSpec/SubjectStub:
410
423
  Exclude:
424
+ - 'spec/controllers/catalog_controller_spec.rb'
411
425
  - 'spec/lib/blacklight/search_state_spec.rb'
426
+ - 'spec/models/blacklight/document/cache_key_spec.rb'
412
427
  - 'spec/models/blacklight/search_builder_spec.rb'
413
428
  - 'spec/services/blacklight/search_service_spec.rb'
414
429
 
415
- # Offense count: 118
430
+ # Offense count: 121
416
431
  # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
417
432
  RSpec/VerifiedDoubles:
418
433
  Enabled: false
@@ -422,6 +437,13 @@ RSpec/VoidExpect:
422
437
  Exclude:
423
438
  - 'spec/lib/blacklight/configuration/facet_field_spec.rb'
424
439
 
440
+ # Offense count: 8
441
+ # Cop supports --auto-correct.
442
+ Rails/ContentTag:
443
+ Exclude:
444
+ - 'app/components/blacklight/document_component.rb'
445
+ - 'app/components/blacklight/facet_item_pivot_component.rb'
446
+
425
447
  # Offense count: 4
426
448
  # Configuration parameters: EnforcedStyle.
427
449
  # SupportedStyles: strict, flexible
@@ -429,12 +451,25 @@ Rails/Date:
429
451
  Exclude:
430
452
  - 'spec/models/search_spec.rb'
431
453
 
432
- # Offense count: 1
433
- # Configuration parameters: EnforcedStyle.
434
- # SupportedStyles: strict, flexible
435
- Rails/TimeZone:
454
+ # Offense count: 31
455
+ # Configuration parameters: Include.
456
+ # Include: app/helpers/**/*.rb
457
+ Rails/HelperInstanceVariable:
436
458
  Exclude:
437
- - 'spec/models/blacklight/solr/search_builder_spec.rb'
459
+ - 'app/helpers/blacklight/blacklight_helper_behavior.rb'
460
+ - 'app/helpers/blacklight/catalog_helper_behavior.rb'
461
+ - 'app/helpers/blacklight/component_helper_behavior.rb'
462
+ - 'app/helpers/blacklight/facets_helper_behavior.rb'
463
+ - 'app/helpers/blacklight/render_partials_helper_behavior.rb'
464
+
465
+ # Offense count: 11
466
+ Rails/OutputSafety:
467
+ Exclude:
468
+ - 'app/helpers/blacklight/catalog_helper_behavior.rb'
469
+ - 'app/helpers/blacklight/configuration_helper_behavior.rb'
470
+ - 'app/helpers/blacklight/icon_helper_behavior.rb'
471
+ - 'app/helpers/blacklight/url_helper_behavior.rb'
472
+ - 'app/presenters/blacklight/rendering/join.rb'
438
473
 
439
474
  # Offense count: 13
440
475
  Security/Eval:
@@ -456,8 +491,8 @@ Style/Alias:
456
491
 
457
492
  # Offense count: 3
458
493
  # Cop supports --auto-correct.
459
- # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods.
460
- # SupportedStyles: line_count_based, semantic, braces_for_chaining
494
+ # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
495
+ # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
461
496
  # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
462
497
  # FunctionalMethods: let, let!, subject, watch
463
498
  # IgnoredMethods: lambda, proc, it
@@ -466,19 +501,9 @@ Style/BlockDelimiters:
466
501
  - 'app/views/catalog/index.rss.builder'
467
502
  - 'app/views/catalog/opensearch.xml.builder'
468
503
 
469
- # Offense count: 3
470
- # Cop supports --auto-correct.
471
- # Configuration parameters: EnforcedStyle.
472
- # SupportedStyles: braces, no_braces, context_dependent
473
- Style/BracesAroundHashParameters:
474
- Exclude:
475
- - 'lib/blacklight/solr/repository.rb'
476
- - 'lib/blacklight/solr/response/facets.rb'
477
- - 'lib/generators/blacklight/test_support_generator.rb'
478
-
479
504
  # Offense count: 51
480
505
  # Cop supports --auto-correct.
481
- # Configuration parameters: AutoCorrect, EnforcedStyle.
506
+ # Configuration parameters: EnforcedStyle.
482
507
  # SupportedStyles: nested, compact
483
508
  Style/ClassAndModuleChildren:
484
509
  Enabled: false
@@ -497,16 +522,11 @@ Style/ConditionalAssignment:
497
522
  Exclude:
498
523
  - 'lib/blacklight/solr/response/spelling.rb'
499
524
 
500
- # Offense count: 99
525
+ # Offense count: 105
501
526
  Style/Documentation:
502
527
  Enabled: false
503
528
 
504
- # Offense count: 1
505
- Style/DoubleNegation:
506
- Exclude:
507
- - 'lib/blacklight/search_builder.rb'
508
-
509
- # Offense count: 9
529
+ # Offense count: 10
510
530
  # Cop supports --auto-correct.
511
531
  Style/ExpandPathArguments:
512
532
  Exclude:
@@ -517,6 +537,7 @@ Style/ExpandPathArguments:
517
537
  - 'lib/generators/blacklight/install_generator.rb'
518
538
  - 'lib/generators/blacklight/models_generator.rb'
519
539
  - 'lib/generators/blacklight/search_builder_generator.rb'
540
+ - 'lib/generators/blacklight/solr_generator.rb'
520
541
  - 'lib/generators/blacklight/test_support_generator.rb'
521
542
  - 'lib/generators/blacklight/user_generator.rb'
522
543
 
@@ -542,13 +563,6 @@ Style/GuardClause:
542
563
  Style/IfUnlessModifier:
543
564
  Enabled: false
544
565
 
545
- # Offense count: 122
546
- # Cop supports --auto-correct.
547
- # Configuration parameters: EnforcedStyle.
548
- # SupportedStyles: require_parentheses, require_no_parentheses, require_no_parentheses_except_multiline
549
- Style/MethodDefParentheses:
550
- Enabled: false
551
-
552
566
  # Offense count: 5
553
567
  # Cop supports --auto-correct.
554
568
  Style/MultilineIfModifier:
@@ -564,13 +578,15 @@ Style/MultipleComparison:
564
578
 
565
579
  # Offense count: 2
566
580
  # Cop supports --auto-correct.
581
+ # Configuration parameters: EnforcedStyle.
582
+ # SupportedStyles: literals, strict
567
583
  Style/MutableConstant:
568
584
  Exclude:
569
585
  - 'lib/blacklight/solr/request.rb'
570
586
 
571
587
  # Offense count: 9
572
588
  # Cop supports --auto-correct.
573
- # Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods.
589
+ # Configuration parameters: EnforcedStyle, IgnoredMethods.
574
590
  # SupportedStyles: predicate, comparison
575
591
  Style/NumericPredicate:
576
592
  Exclude:
@@ -590,12 +606,11 @@ Style/ParenthesesAroundCondition:
590
606
  Exclude:
591
607
  - 'app/views/catalog/_document.atom.builder'
592
608
 
593
- # Offense count: 5
609
+ # Offense count: 3
594
610
  # Cop supports --auto-correct.
595
611
  # Configuration parameters: PreferredDelimiters.
596
612
  Style/PercentLiteralDelimiters:
597
613
  Exclude:
598
- - 'lib/blacklight/configuration.rb'
599
614
  - 'lib/blacklight/engine.rb'
600
615
  - 'lib/blacklight/solr/request.rb'
601
616
 
@@ -612,8 +627,8 @@ Style/RescueStandardError:
612
627
 
613
628
  # Offense count: 12
614
629
  # Cop supports --auto-correct.
615
- # Configuration parameters: ConvertCodeThatCanStartToReturnNil, Whitelist.
616
- # Whitelist: present?, blank?, presence, try, try!
630
+ # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods.
631
+ # AllowedMethods: present?, blank?, presence, try, try!
617
632
  Style/SafeNavigation:
618
633
  Exclude:
619
634
  - 'app/controllers/concerns/blacklight/bookmarks.rb'