decidim-decidim_awesome 0.10.3 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of decidim-decidim_awesome might be problematic. Click here for more details.

Files changed (232) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -5
  3. data/README.md +65 -67
  4. data/app/cells/concerns/decidim/decidim_awesome/global_menu_cell_override.rb +20 -0
  5. data/app/cells/concerns/decidim/decidim_awesome/proposal_l_cell_override.rb +44 -0
  6. data/app/cells/decidim/decidim_awesome/content_blocks/map/show.erb +5 -12
  7. data/app/cells/decidim/decidim_awesome/voting/proposal_metadata_cell.rb +54 -0
  8. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal/modal.erb +18 -0
  9. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal/show.erb +37 -32
  10. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal_cell.rb +9 -4
  11. data/app/commands/concerns/decidim/decidim_awesome/admin/needs_constraint_helpers.rb +1 -1
  12. data/app/commands/concerns/decidim/decidim_awesome/proposals/create_proposal_override.rb +2 -2
  13. data/app/commands/concerns/decidim/decidim_awesome/proposals/update_proposal_override.rb +2 -2
  14. data/app/commands/decidim/decidim_awesome/admin/create_constraint.rb +1 -1
  15. data/app/commands/decidim/decidim_awesome/admin/destroy_custom_redirect.rb +1 -1
  16. data/app/commands/decidim/decidim_awesome/admin/destroy_menu_hack.rb +1 -1
  17. data/app/commands/decidim/decidim_awesome/admin/rename_scope_label.rb +1 -1
  18. data/app/commands/decidim/decidim_awesome/admin/update_constraint.rb +1 -1
  19. data/app/commands/decidim/decidim_awesome/admin/update_custom_redirect.rb +2 -2
  20. data/app/commands/decidim/decidim_awesome/command.rb +1 -7
  21. data/app/controllers/concerns/decidim/decidim_awesome/admin/maintenance_context.rb +1 -1
  22. data/app/controllers/concerns/decidim/decidim_awesome/admin_accountability/admin/filterable_helper.rb +3 -4
  23. data/app/controllers/concerns/decidim/decidim_awesome/content_security_policy.rb +34 -0
  24. data/app/controllers/concerns/decidim/decidim_awesome/not_found_redirect.rb +1 -1
  25. data/app/controllers/concerns/decidim/decidim_awesome/proposals/orderable_override.rb +22 -9
  26. data/app/controllers/concerns/decidim/decidim_awesome/proposals/proposal_votes_controller_override.rb +3 -3
  27. data/app/controllers/decidim/decidim_awesome/admin/admin_accountability_controller.rb +7 -7
  28. data/app/controllers/decidim/decidim_awesome/admin/checks_controller.rb +7 -7
  29. data/app/controllers/decidim/decidim_awesome/admin/config_controller.rb +8 -10
  30. data/app/controllers/decidim/decidim_awesome/admin/constraints_controller.rb +20 -19
  31. data/app/controllers/decidim/decidim_awesome/admin/custom_redirects_controller.rb +6 -8
  32. data/app/controllers/decidim/decidim_awesome/admin/maintenance_controller.rb +2 -2
  33. data/app/controllers/decidim/decidim_awesome/admin/menu_hacks_controller.rb +6 -8
  34. data/app/controllers/decidim/decidim_awesome/admin/proposal_custom_fields_controller.rb +2 -2
  35. data/app/controllers/decidim/decidim_awesome/admin/scoped_admins_controller.rb +2 -2
  36. data/app/controllers/decidim/decidim_awesome/admin/scoped_styles_controller.rb +2 -2
  37. data/app/controllers/decidim/decidim_awesome/blank_component_controller.rb +8 -3
  38. data/app/controllers/decidim/decidim_awesome/editor_images_controller.rb +3 -3
  39. data/app/controllers/decidim/decidim_awesome/iframe_component/iframe_controller.rb +11 -5
  40. data/app/forms/concerns/decidim/decidim_awesome/proposals/proposal_wizard_create_step_form_override.rb +1 -1
  41. data/app/forms/decidim/decidim_awesome/admin/config_form.rb +13 -25
  42. data/app/forms/decidim/decidim_awesome/admin/custom_redirect_form.rb +2 -2
  43. data/app/forms/decidim/decidim_awesome/admin/intergram_form.rb +4 -0
  44. data/app/forms/decidim/decidim_awesome/admin/menu_form.rb +4 -4
  45. data/app/helpers/concerns/decidim/decidim_awesome/amendments_helper_override.rb +8 -1
  46. data/app/helpers/concerns/decidim/decidim_awesome/breadcrumb_helper_override.rb +23 -0
  47. data/app/helpers/concerns/decidim/decidim_awesome/proposals/application_helper_override.rb +23 -39
  48. data/app/helpers/decidim/decidim_awesome/admin/config_constraints_helpers.rb +2 -2
  49. data/app/helpers/decidim/decidim_awesome/map_helper.rb +8 -27
  50. data/app/jobs/decidim/decidim_awesome/migrate_legacy_images_job.rb +5 -4
  51. data/app/middleware/decidim/decidim_awesome/current_config.rb +3 -5
  52. data/app/models/concerns/decidim/decidim_awesome/has_proposal_extra_fields.rb +1 -1
  53. data/app/models/decidim/decidim_awesome/awesome_config.rb +1 -1
  54. data/app/models/decidim/decidim_awesome/paper_trail_version.rb +4 -8
  55. data/app/models/decidim/decidim_awesome/proposal_extra_field.rb +1 -1
  56. data/app/models/decidim/decidim_awesome/vote_weight.rb +2 -2
  57. data/app/overrides/decidim/proposals/proposals/{show → _proposal_aside}/limit_amendments_modal.html.erb.deface +1 -1
  58. data/app/overrides/decidim/proposals/proposals/_vote_button/replace_vote_button.html.erb.deface +1 -1
  59. data/app/overrides/layouts/decidim/_decidim_javascript/add_awesome_tags.html.erb.deface +6 -0
  60. data/app/overrides/layouts/decidim/_head/add_awesome_tags.html.erb.deface +4 -11
  61. data/app/overrides/layouts/decidim/admin/_header/{replace_scripts.html.erb.deface → add_awesome_tags.html.erb.deface} +4 -4
  62. data/app/packs/entrypoints/decidim_admin_decidim_awesome.js +1 -2
  63. data/app/packs/entrypoints/decidim_admin_decidim_awesome_global.js +4 -0
  64. data/app/packs/entrypoints/decidim_admin_decidim_awesome_global.scss +1 -0
  65. data/app/packs/entrypoints/decidim_decidim_awesome.js +2 -2
  66. data/app/packs/entrypoints/decidim_editor.js +14 -0
  67. data/app/packs/src/decidim/decidim_awesome/admin/auto_edit.js +95 -70
  68. data/app/packs/src/decidim/decidim_awesome/admin/check_redirections.js +46 -41
  69. data/app/packs/src/decidim/decidim_awesome/admin/codemirror.js +3 -3
  70. data/app/packs/src/decidim/decidim_awesome/admin/constraint_form_events.js +115 -0
  71. data/app/packs/src/decidim/decidim_awesome/admin/custom_fields_builder.js +4 -1
  72. data/app/packs/src/decidim/decidim_awesome/admin/form_exit_warn.js +22 -11
  73. data/app/packs/src/decidim/decidim_awesome/admin/proposal_sortings.js +26 -8
  74. data/app/packs/src/decidim/decidim_awesome/admin/user_picker.js +34 -21
  75. data/app/packs/src/decidim/decidim_awesome/amendments/show_modal_on_limits.js +20 -22
  76. data/app/packs/src/decidim/decidim_awesome/awesome_admin.js +5 -16
  77. data/app/packs/src/decidim/decidim_awesome/awesome_admin_global.js +1 -0
  78. data/app/packs/src/decidim/decidim_awesome/awesome_application.js +0 -15
  79. data/app/packs/src/decidim/decidim_awesome/awesome_map/api/fetcher.js +33 -11
  80. data/app/packs/src/decidim/decidim_awesome/awesome_map/api/meetings_fetcher.js +9 -12
  81. data/app/packs/src/decidim/decidim_awesome/awesome_map/api/proposals_fetcher.js +28 -0
  82. data/app/packs/src/decidim/decidim_awesome/awesome_map/awesome_map.js +3 -4
  83. data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/controller.js +12 -12
  84. data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/meetings_controller.js +11 -7
  85. data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/proposals_controller.js +6 -13
  86. data/app/packs/src/decidim/decidim_awesome/awesome_map/controls_ui.js +51 -20
  87. data/app/packs/src/decidim/decidim_awesome/awesome_map/load_map.js +27 -18
  88. data/app/packs/src/decidim/decidim_awesome/editor/index.js +94 -0
  89. data/app/packs/src/decidim/decidim_awesome/forms/autosave.js +28 -23
  90. data/app/packs/src/decidim/decidim_awesome/forms/custom_fields_renderer.js +9 -14
  91. data/app/packs/src/decidim/decidim_awesome/forms/rich_text_plugin.js +27 -32
  92. data/app/packs/src/decidim/decidim_awesome/proposals/images.js +16 -10
  93. data/app/packs/src/decidim/decidim_awesome/voting/voting_cards.js +47 -38
  94. data/app/packs/stylesheets/decidim/decidim_awesome/admin/auto_edits.scss +11 -12
  95. data/app/packs/stylesheets/decidim/decidim_awesome/admin/check_redirections.scss +15 -0
  96. data/app/packs/stylesheets/decidim/decidim_awesome/admin/codemirror.scss +19 -12
  97. data/app/packs/stylesheets/decidim/decidim_awesome/admin/constraints.scss +8 -32
  98. data/app/packs/stylesheets/decidim/decidim_awesome/admin/custom_fields.scss +28 -78
  99. data/app/packs/stylesheets/decidim/decidim_awesome/admin/custom_styles.scss +48 -0
  100. data/app/packs/stylesheets/decidim/decidim_awesome/admin/intergram_fixes.scss +11 -0
  101. data/app/packs/stylesheets/decidim/decidim_awesome/admin/user_picker.scss +15 -24
  102. data/app/packs/stylesheets/decidim/decidim_awesome/amendments/modal.scss +5 -0
  103. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_admin.scss +9 -47
  104. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_admin_global.scss +3 -12
  105. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_application.scss +3 -19
  106. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_iframe/iframe.scss +1 -1
  107. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_map/map.scss +27 -21
  108. data/app/packs/stylesheets/decidim/decidim_awesome/forms/autosave.scss +6 -6
  109. data/app/packs/stylesheets/decidim/decidim_awesome/forms/custom_fields.scss +32 -101
  110. data/app/packs/stylesheets/decidim/decidim_awesome/shared/spinner.scss +5 -26
  111. data/app/packs/stylesheets/decidim/decidim_awesome/voting/voting_cards.scss +34 -52
  112. data/app/permissions/decidim/decidim_awesome/permissions.rb +3 -4
  113. data/app/presenters/concerns/decidim/decidim_awesome/breadcrumb_root_menu_item_presenter_override.rb +23 -0
  114. data/app/presenters/concerns/decidim/decidim_awesome/menu_item_presenter_override.rb +10 -2
  115. data/app/presenters/concerns/decidim/decidim_awesome/menu_presenter_override.rb +8 -0
  116. data/app/presenters/decidim/decidim_awesome/participatory_space_role_presenter.rb +1 -1
  117. data/app/presenters/decidim/decidim_awesome/private_data_presenter.rb +11 -11
  118. data/app/presenters/decidim/decidim_awesome/user_entity_presenter.rb +1 -1
  119. data/app/queries/decidim/decidim_awesome/private_data_finder.rb +1 -1
  120. data/app/serializers/decidim/decidim_awesome/proposals/private_proposal_serializer.rb +0 -8
  121. data/app/views/decidim/decidim_awesome/admin/admin_accountability/index.html.erb +23 -17
  122. data/app/views/decidim/decidim_awesome/admin/checks/index.html.erb +1 -3
  123. data/app/views/decidim/decidim_awesome/admin/config/_autoedit_box_label.html.erb +3 -3
  124. data/app/views/decidim/decidim_awesome/admin/config/_constraints.html.erb +20 -21
  125. data/app/views/decidim/decidim_awesome/admin/config/_form_admins.html.erb +6 -5
  126. data/app/views/decidim/decidim_awesome/admin/config/_form_editors.html.erb +2 -2
  127. data/app/views/decidim/decidim_awesome/admin/config/_form_livechat.html.erb +39 -23
  128. data/app/views/decidim/decidim_awesome/admin/config/_form_proposal_custom_fields.html.erb +4 -6
  129. data/app/views/decidim/decidim_awesome/admin/config/_form_proposals.html.erb +64 -76
  130. data/app/views/decidim/decidim_awesome/admin/config/_form_styles.html.erb +15 -11
  131. data/app/views/decidim/decidim_awesome/admin/config/_form_surveys.html.erb +8 -6
  132. data/app/views/decidim/decidim_awesome/admin/config/show.html.erb +22 -12
  133. data/app/views/decidim/decidim_awesome/admin/constraints/_form.html.erb +1 -49
  134. data/app/views/decidim/decidim_awesome/admin/constraints/new.html.erb +14 -9
  135. data/app/views/decidim/decidim_awesome/admin/constraints/show.html.erb +14 -9
  136. data/app/views/decidim/decidim_awesome/admin/custom_redirects/_form.html.erb +20 -5
  137. data/app/views/decidim/decidim_awesome/admin/custom_redirects/edit.html.erb +5 -5
  138. data/app/views/decidim/decidim_awesome/admin/custom_redirects/index.html.erb +15 -15
  139. data/app/views/decidim/decidim_awesome/admin/custom_redirects/new.html.erb +5 -5
  140. data/app/views/decidim/decidim_awesome/admin/maintenance/_private_data.html.erb +4 -4
  141. data/app/views/decidim/decidim_awesome/admin/menu_hacks/_form.html.erb +6 -6
  142. data/app/views/decidim/decidim_awesome/admin/menu_hacks/edit.html.erb +21 -12
  143. data/app/views/decidim/decidim_awesome/admin/menu_hacks/index.html.erb +16 -18
  144. data/app/views/decidim/decidim_awesome/admin/menu_hacks/new.html.erb +21 -12
  145. data/app/views/decidim/decidim_awesome/admin/shared/_filters_with_date.html.erb +14 -18
  146. data/app/views/decidim/decidim_awesome/amendments/_modal.html.erb +18 -11
  147. data/app/views/decidim/decidim_awesome/custom_fields/_form_render.html.erb +3 -5
  148. data/app/views/decidim/decidim_awesome/iframe_component/iframe/show.html.erb +7 -12
  149. data/app/views/decidim/decidim_awesome/map_component/map/_map_template.html.erb +53 -37
  150. data/app/views/decidim/decidim_awesome/map_component/map/show.html.erb +14 -5
  151. data/app/views/decidim/decidim_awesome/voting/voting_cards/_show_vote_button.html.erb +0 -3
  152. data/app/views/layouts/decidim/decidim_awesome/_awesome_config.html.erb +9 -7
  153. data/app/views/layouts/decidim/decidim_awesome/_intergram_widget.html.erb +9 -6
  154. data/app/views/layouts/decidim/decidim_awesome/admin/_base.html.erb +3 -12
  155. data/config/assets.rb +3 -33
  156. data/config/i18n-tasks.yml +1 -0
  157. data/config/locales/ca.yml +17 -94
  158. data/config/locales/cs.yml +15 -93
  159. data/config/locales/de.yml +15 -91
  160. data/config/locales/en.yml +24 -28
  161. data/config/locales/es.yml +18 -96
  162. data/config/locales/eu.yml +8 -18
  163. data/config/locales/fr.yml +15 -94
  164. data/config/locales/hu.yml +4 -18
  165. data/config/locales/it.yml +9 -26
  166. data/config/locales/ja.yml +16 -93
  167. data/config/locales/lt.yml +2 -4
  168. data/config/locales/nl.yml +8 -18
  169. data/config/locales/pt-BR.yml +11 -25
  170. data/config/locales/ro-RO.yml +2 -14
  171. data/config/locales/sv.yml +10 -21
  172. data/config/rubocop/disabled.yml +11 -0
  173. data/config/rubocop/faker.yml +480 -0
  174. data/config/rubocop/rails.yml +88 -0
  175. data/config/rubocop/rspec.yml +65 -0
  176. data/config/rubocop/ruby.yml +1210 -0
  177. data/db/migrate/20240306175331_rename_editor_images_awesome_config.rb +18 -0
  178. data/db/migrate/20240729164227_add_decidim_awesome_proposal_private_fields_date.rb +1 -1
  179. data/db/seeds.rb +3 -3
  180. data/lib/decidim/decidim_awesome/admin_engine.rb +4 -1
  181. data/lib/decidim/decidim_awesome/api/types/translated_custom_fields_type.rb +2 -3
  182. data/lib/decidim/decidim_awesome/awesome.rb +42 -28
  183. data/lib/decidim/decidim_awesome/awesome_helpers.rb +1 -1
  184. data/lib/decidim/decidim_awesome/checksums.yml +39 -60
  185. data/lib/decidim/decidim_awesome/config.rb +1 -1
  186. data/lib/decidim/decidim_awesome/custom_fields.rb +5 -5
  187. data/lib/decidim/decidim_awesome/engine.rb +24 -6
  188. data/lib/decidim/decidim_awesome/iframe_component/component.rb +1 -2
  189. data/lib/decidim/decidim_awesome/lock.rb +2 -2
  190. data/lib/decidim/decidim_awesome/map_component/component.rb +1 -1
  191. data/lib/decidim/decidim_awesome/menu.rb +33 -14
  192. data/lib/decidim/decidim_awesome/menu_hacker.rb +4 -8
  193. data/lib/decidim/decidim_awesome/system_checker.rb +2 -4
  194. data/lib/decidim/decidim_awesome/test/factories.rb +10 -10
  195. data/lib/decidim/decidim_awesome/test/initializer.rb +3 -11
  196. data/lib/decidim/decidim_awesome/test/layouts/decidim/_head.html.erb +2 -2
  197. data/lib/decidim/decidim_awesome/test/layouts/decidim/admin/_header.html.erb +2 -2
  198. data/lib/decidim/decidim_awesome/test/shared_examples/box_label_editor_examples.rb +18 -18
  199. data/lib/decidim/decidim_awesome/test/shared_examples/config_examples.rb +3 -3
  200. data/lib/decidim/decidim_awesome/test/shared_examples/custom_fields_examples.rb +11 -11
  201. data/lib/decidim/decidim_awesome/test/shared_examples/custom_redirects_contexts.rb +7 -7
  202. data/lib/decidim/decidim_awesome/test/shared_examples/editor_examples.rb +26 -66
  203. data/lib/decidim/decidim_awesome/test/shared_examples/menu_hack_contexts.rb +10 -9
  204. data/lib/decidim/decidim_awesome/test/shared_examples/scoped_admins_examples.rb +30 -20
  205. data/lib/decidim/decidim_awesome/test/shared_examples/summary_examples.rb +19 -10
  206. data/lib/decidim/decidim_awesome/version.rb +2 -2
  207. data/lib/decidim/decidim_awesome/voting_manifest.rb +5 -10
  208. data/lib/decidim/decidim_awesome.rb +1 -2
  209. data/lib/tasks/decidim_awesome_active_storage_migrations_tasks.rake +1 -1
  210. data/lib/tasks/decidim_awesome_upgrade_tasks.rake +4 -0
  211. data/package.json +19 -28
  212. metadata +40 -56
  213. data/app/cells/concerns/decidim/decidim_awesome/proposal_m_cell_override.rb +0 -18
  214. data/app/cells/decidim/decidim_awesome/voting/voting_cards_counter/show.erb +0 -15
  215. data/app/cells/decidim/decidim_awesome/voting/voting_cards_counter/vote_button.erb +0 -15
  216. data/app/cells/decidim/decidim_awesome/voting/voting_cards_counter_cell.rb +0 -21
  217. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal_modal/show.erb +0 -16
  218. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal_modal_cell.rb +0 -20
  219. data/app/cells/decidim/proposals/proposal_m/footer.erb +0 -13
  220. data/app/overrides/layouts/decidim/_head/add_awesome_legacy_scripts.rb +0 -14
  221. data/app/overrides/layouts/decidim/admin/_header/replace_styles.html.erb.deface +0 -3
  222. data/app/packs/entrypoints/decidim_admin_decidim_awesome_custom_fields.js +0 -2
  223. data/app/packs/entrypoints/decidim_decidim_awesome_admin_form_exit_warn.js +0 -1
  224. data/app/packs/src/decidim/decidim_awesome/admin/constraints.js +0 -55
  225. data/app/packs/src/decidim/decidim_awesome/editors/editor.js +0 -213
  226. data/app/packs/stylesheets/decidim/decidim_awesome/editors/markdown_editor.scss +0 -19
  227. data/app/packs/stylesheets/decidim/decidim_awesome/editors/quill_editor.scss +0 -58
  228. data/app/packs/stylesheets/vendor/select2-foundation-theme.scss +0 -348
  229. data/app/serializers/concerns/decidim/decidim_awesome/proposal_serializer_override.rb +0 -65
  230. data/app/views/decidim/decidim_awesome/admin/config/_modal.html.erb +0 -11
  231. data/app/views/decidim/decidim_awesome/voting/voting_cards/_proposal_m_cell_footer.erb +0 -15
  232. /data/app/packs/src/decidim/decidim_awesome/{editors/tabs_focus.js → admin/tabs_change.js} +0 -0
@@ -0,0 +1,1210 @@
1
+ # Common configuration.
2
+ AllCops:
3
+ Include:
4
+ - .simplecov
5
+ - "**/*.rb"
6
+ - "**/*.rake"
7
+ - "**/*.gemspec"
8
+ - "**/*.ru"
9
+ - "**/Capfile"
10
+ - "**/Gemfile"
11
+ - "**/Rakefile"
12
+ Exclude:
13
+ - db/schema.rb
14
+ - "**/vendor/**/*"
15
+ - "development_app*/**/*"
16
+ - "spec/decidim_dummy_app/**/*"
17
+ - "node_modules/**/*"
18
+ # Default formatter will be used if no -f/--format option is given.
19
+ DefaultFormatter: progress
20
+ # Cop names are not displayed in offense messages by default. Change behavior
21
+ # by overriding DisplayCopNames, or by giving the -D/--display-cop-names
22
+ # option.
23
+ DisplayCopNames: true
24
+ # Style guide URLs are not displayed in offense messages by default. Change
25
+ # behavior by overriding DisplayStyleGuide, or by giving the
26
+ # -S/--display-style-guide option.
27
+ DisplayStyleGuide: false
28
+ # Extra details are not displayed in offense messages by default. Change
29
+ # behavior by overriding ExtraDetails, or by giving the
30
+ # -E/--extra-details option.
31
+ ExtraDetails: false
32
+ NewCops: enable
33
+ # Additional cops that do not reference a style guide rule may be enabled by
34
+ # default. Change behavior by overriding StyleGuideCopsOnly, or by giving
35
+ # the --only-guide-cops option.
36
+ StyleGuideCopsOnly: false
37
+ # All cops except the ones in disabled.yml are enabled by default. Change
38
+ # this behavior by overriding DisabledByDefault. When DisabledByDefault is
39
+ # true, all cops in the default configuration are disabled, and and only cops
40
+ # in user configuration are enabled. This makes cops opt-in instead of
41
+ # opt-out. Note that when DisabledByDefault is true, cops in user
42
+ # configuration will be enabled even if they do not set the Enabled parameter.
43
+ DisabledByDefault: false
44
+ # Enables the result cache if true. Can be overridden by the --cache command
45
+ # line option.
46
+ UseCache: true
47
+ # Threshold for how many files can be stored in the result cache before some
48
+ # of the files are automatically removed.
49
+ MaxFilesInCache: 20000
50
+ # The cache will be stored in "rubocop_cache" under this directory. The name
51
+ # "/tmp" is special and will be converted to the system temporary directory,
52
+ # which is "/tmp" on Unix-like systems, but could be something else on other
53
+ # systems.
54
+ CacheRootDirectory: /tmp
55
+ # The default cache root directory is /tmp, which on most systems is
56
+ # writable by any system user. This means that it is possible for a
57
+ # malicious user to anticipate the location of Rubocop's cache directory,
58
+ # and create a symlink in its place that could cause Rubocop to overwrite
59
+ # unintended files, or read malicious input. If you are certain that your
60
+ # cache location is secure from this kind of attack, and wish to use a
61
+ # symlinked cache location, set this value to "true".
62
+ AllowSymlinksInCacheRootDirectory: true
63
+ # What MRI version of the Ruby interpreter is the inspected code intended to
64
+ # run on? (If there is more than one, set this to the lowest version.)
65
+ # If a value is specified for TargetRubyVersion then it is used.
66
+ # Else if .ruby-version exists and it contains an MRI version it is used.
67
+ # Otherwise we fallback to the oldest officially supported Ruby version (2.0).
68
+ TargetRubyVersion: 3.1
69
+
70
+ # Indent private/protected/public as deep as method definitions
71
+ Layout/AccessModifierIndentation:
72
+ EnforcedStyle: indent
73
+ SupportedStyles:
74
+ - outdent
75
+ - indent
76
+ # By default, the indentation width from Style/IndentationWidth is used
77
+ # But it can be overridden by setting this parameter
78
+ IndentationWidth: ~
79
+
80
+ Style/Alias:
81
+ EnforcedStyle: prefer_alias
82
+ SupportedStyles:
83
+ - prefer_alias
84
+ - prefer_alias_method
85
+
86
+ # Align the elements of a hash literal if they span more than one line.
87
+ Layout/HashAlignment:
88
+ # Alignment of entries using hash rocket as separator. Valid values are:
89
+ #
90
+ # key - left alignment of keys
91
+ # "a" => 2
92
+ # "bb" => 3
93
+ # separator - alignment of hash rockets, keys are right aligned
94
+ # "a" => 2
95
+ # "bb" => 3
96
+ # table - left alignment of keys, hash rockets, and values
97
+ # "a" => 2
98
+ # "bb" => 3
99
+ EnforcedHashRocketStyle: key
100
+ # Alignment of entries using colon as separator. Valid values are:
101
+ #
102
+ # key - left alignment of keys
103
+ # a: 0
104
+ # bb: 1
105
+ # separator - alignment of colons, keys are right aligned
106
+ # a: 0
107
+ # bb: 1
108
+ # table - left alignment of keys and values
109
+ # a: 0
110
+ # bb: 1
111
+ EnforcedColonStyle: key
112
+ # Select whether hashes that are the last argument in a method call should be
113
+ # inspected? Valid values are:
114
+ #
115
+ # always_inspect - Inspect both implicit and explicit hashes.
116
+ # Registers an offense for:
117
+ # function(a: 1,
118
+ # b: 2)
119
+ # Registers an offense for:
120
+ # function({a: 1,
121
+ # b: 2})
122
+ # always_ignore - Ignore both implicit and explicit hashes.
123
+ # Accepts:
124
+ # function(a: 1,
125
+ # b: 2)
126
+ # Accepts:
127
+ # function({a: 1,
128
+ # b: 2})
129
+ # ignore_implicit - Ignore only implicit hashes.
130
+ # Accepts:
131
+ # function(a: 1,
132
+ # b: 2)
133
+ # Registers an offense for:
134
+ # function({a: 1,
135
+ # b: 2})
136
+ # ignore_explicit - Ignore only explicit hashes.
137
+ # Accepts:
138
+ # function({a: 1,
139
+ # b: 2})
140
+ # Registers an offense for:
141
+ # function(a: 1,
142
+ # b: 2)
143
+ EnforcedLastArgumentHashStyle: always_inspect
144
+ SupportedLastArgumentHashStyles:
145
+ - always_inspect
146
+ - always_ignore
147
+ - ignore_implicit
148
+ - ignore_explicit
149
+
150
+ Layout/ParameterAlignment:
151
+ # Alignment of parameters in multi-line method calls.
152
+ #
153
+ # The `with_first_parameter` style aligns the following lines along the same
154
+ # column as the first parameter.
155
+ #
156
+ # method_call(a,
157
+ # b)
158
+ #
159
+ # The `with_fixed_indentation` style aligns the following lines with one
160
+ # level of indentation relative to the start of the line with the method call.
161
+ #
162
+ # method_call(a,
163
+ # b)
164
+ EnforcedStyle: with_first_parameter
165
+ SupportedStyles:
166
+ - with_first_parameter
167
+ - with_fixed_indentation
168
+ # By default, the indentation width from Style/IndentationWidth is used
169
+ # But it can be overridden by setting this parameter
170
+ IndentationWidth: ~
171
+
172
+ Style/ArrayCoercion:
173
+ Description: >-
174
+ Use Array() instead of explicit Array check or [*var], when dealing
175
+ with a variable you want to treat as an Array, but you are not certain it is an array.
176
+ StyleGuide: '#array-coercion'
177
+ Safe: false
178
+ Enabled: false
179
+ VersionAdded: '0.88'
180
+
181
+ Style/AndOr:
182
+ # Whether `and` and `or` are banned only in conditionals (conditionals)
183
+ # or completely (always).
184
+ EnforcedStyle: always
185
+ SupportedStyles:
186
+ - always
187
+ - conditionals
188
+
189
+ Style/AsciiComments:
190
+ Enabled: false
191
+
192
+ # Checks if usage of %() or %Q() matches configuration.
193
+ Style/BarePercentLiterals:
194
+ EnforcedStyle: bare_percent
195
+ SupportedStyles:
196
+ - percent_q
197
+ - bare_percent
198
+
199
+ Style/BlockDelimiters:
200
+ EnforcedStyle: line_count_based
201
+ SupportedStyles:
202
+ # The `line_count_based` style enforces braces around single line blocks and
203
+ # do..end around multi-line blocks.
204
+ - line_count_based
205
+ # The `semantic` style enforces braces around functional blocks, where the
206
+ # primary purpose of the block is to return a value and do..end for
207
+ # procedural blocks, where the primary purpose of the block is its
208
+ # side-effects.
209
+ #
210
+ # This looks at the usage of a block's method to determine its type (e.g. is
211
+ # the result of a `map` assigned to a variable or passed to another
212
+ # method) but exceptions are permitted in the `ProceduralMethods`,
213
+ # `FunctionalMethods` and `AllowedMethods` sections below.
214
+ - semantic
215
+ # The `braces_for_chaining` style enforces braces around single line blocks
216
+ # and do..end around multi-line blocks, except for multi-line blocks whose
217
+ # return value is being chained with another method (in which case braces
218
+ # are enforced).
219
+ - braces_for_chaining
220
+ ProceduralMethods:
221
+ # Methods that are known to be procedural in nature but look functional from
222
+ # their usage, e.g.
223
+ #
224
+ # time = Benchmark.realtime do
225
+ # foo.bar
226
+ # end
227
+ #
228
+ # Here, the return value of the block is discarded but the return value of
229
+ # `Benchmark.realtime` is used.
230
+ - benchmark
231
+ - bm
232
+ - bmbm
233
+ - create
234
+ - each_with_object
235
+ - measure
236
+ - new
237
+ - realtime
238
+ - tap
239
+ - with_object
240
+ FunctionalMethods:
241
+ # Methods that are known to be functional in nature but look procedural from
242
+ # their usage, e.g.
243
+ #
244
+ # let(:foo) { Foo.new }
245
+ #
246
+ # Here, the return value of `Foo.new` is used to define a `foo` helper but
247
+ # does not appear to be used from the return value of `let`.
248
+ - let
249
+ - let!
250
+ - subject
251
+ - watch
252
+ AllowedMethods:
253
+ # Methods that can be either procedural or functional and cannot be
254
+ # categorised from their usage alone, e.g.
255
+ #
256
+ # foo = lambda do |x|
257
+ # puts "Hello, #{x}"
258
+ # end
259
+ #
260
+ # foo = lambda do |x|
261
+ # x * 100
262
+ # end
263
+ #
264
+ # Here, it is impossible to tell from the return value of `lambda` whether
265
+ # the inner block's return value is significant.
266
+ - lambda
267
+ - proc
268
+ - it
269
+
270
+ Style/ExplicitBlockArgument:
271
+ Enabled: false
272
+
273
+ Style/HashEachMethods:
274
+ Enabled: false
275
+
276
+ Style/HashLikeCase:
277
+ MinBranchesCount: 5
278
+
279
+ # Indentation of `when`.
280
+ Layout/CaseIndentation:
281
+ EnforcedStyle: case
282
+ SupportedStyles:
283
+ - case
284
+ - end
285
+ IndentOneStep: false
286
+ # By default, the indentation width from Style/IndentationWidth is used
287
+ # But it can be overridden by setting this parameter
288
+ # This only matters if IndentOneStep is true
289
+ IndentationWidth: ~
290
+
291
+ Style/ClassAndModuleChildren:
292
+ Enabled: false
293
+ # Checks the style of children definitions at classes and modules.
294
+ #
295
+ # Basically there are two different styles:
296
+ #
297
+ # `nested` - have each child on a separate line
298
+ # class Foo
299
+ # class Bar
300
+ # end
301
+ # end
302
+ #
303
+ # `compact` - combine definitions as much as possible
304
+ # class Foo::Bar
305
+ # end
306
+ #
307
+ # The compact style is only forced, for classes / modules with one child.
308
+ EnforcedStyle: nested
309
+ SupportedStyles:
310
+ - nested
311
+ - compact
312
+
313
+ Style/ClassCheck:
314
+ EnforcedStyle: is_a?
315
+ SupportedStyles:
316
+ - is_a?
317
+ - kind_of?
318
+
319
+ # Align with the style guide.
320
+ Style/CollectionMethods:
321
+ # Mapping from undesired method to desired_method
322
+ # e.g. to use `detect` over `find`:
323
+ #
324
+ # CollectionMethods:
325
+ # PreferredMethods:
326
+ # find: detect
327
+ PreferredMethods:
328
+ collect: "map"
329
+ collect!: "map!"
330
+ inject: "reduce"
331
+ detect: "find"
332
+ find_all: "select"
333
+
334
+ # Use ` or %x around command literals.
335
+ Style/CommandLiteral:
336
+ EnforcedStyle: backticks
337
+ # backticks: Always use backticks.
338
+ # percent_x: Always use %x.
339
+ # mixed: Use backticks on single-line commands, and %x on multi-line commands.
340
+ SupportedStyles:
341
+ - backticks
342
+ - percent_x
343
+ - mixed
344
+ # If false, the cop will always recommend using %x if one or more backticks
345
+ # are found in the command string.
346
+ AllowInnerBackticks: false
347
+
348
+ # Checks formatting of special comments
349
+ Style/CommentAnnotation:
350
+ Keywords:
351
+ - TODO
352
+ - FIXME
353
+ - OPTIMIZE
354
+ - HACK
355
+ - REVIEW
356
+
357
+ Style/ConditionalAssignment:
358
+ EnforcedStyle: assign_to_condition
359
+ SupportedStyles:
360
+ - assign_to_condition
361
+ - assign_inside_condition
362
+ # When configured to `assign_to_condition`, `SingleLineConditionsOnly`
363
+ # will only register an offense when all branches of a condition are
364
+ # a single line.
365
+ # When configured to `assign_inside_condition`, `SingleLineConditionsOnly`
366
+ # will only register an offense for assignment to a condition that has
367
+ # at least one multiline branch.
368
+ SingleLineConditionsOnly: true
369
+
370
+ # Checks that you have put a copyright in a comment before any code.
371
+ #
372
+ # You can override the default Notice in your .rubocop.yml file.
373
+ #
374
+ # In order to use autocorrect, you must supply a value for the
375
+ # AutocorrectNotice key that matches the regexp Notice. A blank
376
+ # AutocorrectNotice will cause an error during autocorrect.
377
+ #
378
+ # Autocorrect will add a copyright notice in a comment at the top
379
+ # of the file immediately after any shebang or encoding comments.
380
+ #
381
+ # Example rubocop.yml:
382
+ #
383
+ # Style/Copyright:
384
+ # Enabled: true
385
+ # Notice: 'Copyright (\(c\) )?2015 Yahoo! Inc'
386
+ # AutocorrectNotice: "# Copyright (c) 2015 Yahoo! Inc."
387
+ #
388
+ Style/Copyright:
389
+ Notice: '^Copyright (\(c\) )?2[0-9]{3} .+'
390
+ AutocorrectNotice: ""
391
+
392
+ Style/DocumentationMethod:
393
+ RequireForNonPublicMethods: false
394
+
395
+ # Multi-line method chaining should be done with leading dots.
396
+ Layout/DotPosition:
397
+ EnforcedStyle: leading
398
+ SupportedStyles:
399
+ - leading
400
+ - trailing
401
+
402
+ # Warn on empty else statements
403
+ # empty - warn only on empty else
404
+ # nil - warn on else with nil in it
405
+ # both - warn on empty else and else with nil in it
406
+ Style/EmptyElse:
407
+ EnforcedStyle: both
408
+ SupportedStyles:
409
+ - empty
410
+ - nil
411
+ - both
412
+
413
+ # Use empty lines between defs.
414
+ Layout/EmptyLineBetweenDefs:
415
+ # If true, this parameter means that single line method definitions do not
416
+ # need an empty line between them.
417
+ AllowAdjacentOneLineDefs: false
418
+
419
+ Layout/EmptyLineAfterMagicComment:
420
+ Exclude:
421
+ - db/migrate/*.rb
422
+
423
+ Layout/EmptyLinesAroundBlockBody:
424
+ EnforcedStyle: no_empty_lines
425
+ SupportedStyles:
426
+ - empty_lines
427
+ - no_empty_lines
428
+
429
+ Layout/EmptyLinesAroundClassBody:
430
+ EnforcedStyle: no_empty_lines
431
+ SupportedStyles:
432
+ - empty_lines
433
+ - no_empty_lines
434
+
435
+ Layout/EmptyLinesAroundModuleBody:
436
+ EnforcedStyle: no_empty_lines
437
+ SupportedStyles:
438
+ - empty_lines
439
+ - no_empty_lines
440
+
441
+ # Checks whether the source file has a utf-8 encoding comment or not
442
+ # AutoCorrectEncodingComment must match the regex
443
+ # /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
444
+ Style/Encoding:
445
+ Enabled: true
446
+
447
+ Layout/ExtraSpacing:
448
+ # When true, allows most uses of extra spacing if the intent is to align
449
+ # things with the previous or next line, not counting empty lines or comment
450
+ # lines.
451
+ AllowForAlignment: false
452
+ # When true, forces the alignment of = in assignments on consecutive lines.
453
+ ForceEqualSignAlignment: false
454
+
455
+ Naming/FileName:
456
+ Exclude:
457
+ - "**/Gemfile"
458
+ - "**/Rakefile"
459
+ - "**/*.gemspec"
460
+ - "decidim-dev/lib/decidim-dev.rb"
461
+ # When true, requires that each source file should define a class or module
462
+ # with a name which matches the file name (converted to ... case).
463
+ # It further expects it to be nested inside modules which match the names
464
+ # of subdirectories in its path.
465
+ ExpectMatchingDefinition: false
466
+ # If non-nil, expect all source file names to match the following regex.
467
+ # Only the file name itself is matched, not the entire file path.
468
+ # Use anchors as necessary if you want to match the entire name rather than
469
+ # just a part of it.
470
+ Regex: ~
471
+ # With `IgnoreExecutableScripts` set to `true`, this cop does not
472
+ # report offending filenames for executable scripts (i.e. source
473
+ # files with a shebang in the first line).
474
+ IgnoreExecutableScripts: true
475
+
476
+ Layout/FirstArgumentIndentation:
477
+ EnforcedStyle: special_for_inner_method_call_in_parentheses
478
+ SupportedStyles:
479
+ # The first parameter should always be indented one step more than the
480
+ # preceding line.
481
+ - consistent
482
+ # The first parameter should normally be indented one step more than the
483
+ # preceding line, but if it is a parameter for a method call that is itself
484
+ # a parameter in a method call, then the inner parameter should be indented
485
+ # relative to the inner method.
486
+ - special_for_inner_method_call
487
+ # Same as special_for_inner_method_call except that the special rule only
488
+ # applies if the outer method call encloses its arguments in parentheses.
489
+ - special_for_inner_method_call_in_parentheses
490
+ # By default, the indentation width from Style/IndentationWidth is used
491
+ # But it can be overridden by setting this parameter
492
+ IndentationWidth: ~
493
+
494
+ # Checks use of for or each in multiline loops.
495
+ Style/For:
496
+ EnforcedStyle: each
497
+ SupportedStyles:
498
+ - for
499
+ - each
500
+
501
+ # Enforce the method used for string formatting.
502
+ Style/FormatString:
503
+ EnforcedStyle: format
504
+ SupportedStyles:
505
+ - format
506
+ - sprintf
507
+ - percent
508
+
509
+ Style/FormatStringToken:
510
+ EnforcedStyle: template
511
+
512
+ Style/FrozenStringLiteralComment:
513
+ EnforcedStyle: always
514
+ SupportedStyles:
515
+ - never
516
+ # `always` will always add the frozen string literal comment to a file
517
+ # regardless of the Ruby version or if `freeze` or `<<` are called on a
518
+ # string literal. If you run code against multiple versions of Ruby, it is
519
+ # possible that this will create errors in Ruby 2.3.0+.
520
+ - always
521
+
522
+ # Built-in global variables are allowed by default.
523
+ Style/GlobalVars:
524
+ AllowedVariables: []
525
+
526
+ # `MinBodyLength` defines the number of lines of the a body of an if / unless
527
+ # needs to have to trigger this cop
528
+ Style/GuardClause:
529
+ MinBodyLength: 6
530
+
531
+ Style/HashSyntax:
532
+ EnforcedStyle: ruby19
533
+ SupportedStyles:
534
+ # checks for 1.9 syntax (e.g. {a: 1}) for all symbol keys
535
+ - ruby19
536
+ # checks for hash rocket syntax for all hashes
537
+ - hash_rockets
538
+ # forbids mixed key syntaxes (e.g. {a: 1, :b => 2})
539
+ - no_mixed_keys
540
+ # enforces both ruby19 and no_mixed_keys styles
541
+ - ruby19_no_mixed_keys
542
+ # Force hashes that have a symbol value to use hash rockets
543
+ UseHashRocketsWithSymbolValues: false
544
+ # Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
545
+ PreferHashRocketsForNonAlnumEndingSymbols: false
546
+
547
+ Layout/IndentationConsistency:
548
+ # The difference between `rails` and `normal` is that the `rails` style
549
+ # prescribes that in classes and modules the `protected` and `private`
550
+ # modifier keywords shall be indented the same as public methods and that
551
+ # protected and private members shall be indented one step more than the
552
+ # modifiers. Other than that, both styles mean that entities on the same
553
+ # logical depth shall have the same indentation.
554
+ EnforcedStyle: normal
555
+ SupportedStyles:
556
+ - normal
557
+ - rails
558
+
559
+ Layout/IndentationWidth:
560
+ # Number of spaces for each indentation level.
561
+ Width: 2
562
+
563
+ # Checks the indentation of the first element in an array literal.
564
+ Layout/FirstArrayElementIndentation:
565
+ # The value `special_inside_parentheses` means that array literals with
566
+ # brackets that have their opening bracket on the same line as a surrounding
567
+ # opening round parenthesis, shall have their first element indented relative
568
+ # to the first position inside the parenthesis.
569
+ #
570
+ # The value `consistent` means that the indentation of the first element shall
571
+ # always be relative to the first position of the line where the opening
572
+ # bracket is.
573
+ #
574
+ # The value `align_brackets` means that the indentation of the first element
575
+ # shall always be relative to the position of the opening bracket.
576
+ EnforcedStyle: special_inside_parentheses
577
+ SupportedStyles:
578
+ - special_inside_parentheses
579
+ - consistent
580
+ - align_brackets
581
+ # By default, the indentation width from Style/IndentationWidth is used
582
+ # But it can be overridden by setting this parameter
583
+ IndentationWidth: ~
584
+
585
+ # Checks the indentation of assignment RHS, when on a different line from LHS
586
+ Layout/AssignmentIndentation:
587
+ # By default, the indentation width from Style/IndentationWidth is used
588
+ # But it can be overridden by setting this parameter
589
+ IndentationWidth: ~
590
+
591
+ # Checks the indentation of the first key in a hash literal.
592
+ Layout/FirstHashElementIndentation:
593
+ # The value `special_inside_parentheses` means that hash literals with braces
594
+ # that have their opening brace on the same line as a surrounding opening
595
+ # round parenthesis, shall have their first key indented relative to the
596
+ # first position inside the parenthesis.
597
+ #
598
+ # The value `consistent` means that the indentation of the first key shall
599
+ # always be relative to the first position of the line where the opening
600
+ # brace is.
601
+ #
602
+ # The value `align_braces` means that the indentation of the first key shall
603
+ # always be relative to the position of the opening brace.
604
+ EnforcedStyle: special_inside_parentheses
605
+ SupportedStyles:
606
+ - special_inside_parentheses
607
+ - consistent
608
+ - align_braces
609
+ # By default, the indentation width from Style/IndentationWidth is used
610
+ # But it can be overridden by setting this parameter
611
+ IndentationWidth: ~
612
+
613
+ Style/Lambda:
614
+ EnforcedStyle: line_count_dependent
615
+ SupportedStyles:
616
+ - line_count_dependent
617
+ - lambda
618
+ - literal
619
+ Exclude:
620
+ - "**/types/**/*"
621
+ - "**/*_interface.rb"
622
+
623
+ Style/LambdaCall:
624
+ EnforcedStyle: call
625
+ SupportedStyles:
626
+ - call
627
+ - braces
628
+
629
+ Style/Next:
630
+ # With `always` all conditions at the end of an iteration needs to be
631
+ # replaced by next - with `skip_modifier_ifs` the modifier if like this one
632
+ # are ignored: [1, 2].each { |a| return "yes" if a == 1 }
633
+ EnforcedStyle: skip_modifier_ifs
634
+ # `MinBodyLength` defines the number of lines of the a body of an if / unless
635
+ # needs to have to trigger this cop
636
+ MinBodyLength: 3
637
+ SupportedStyles:
638
+ - skip_modifier_ifs
639
+ - always
640
+
641
+ Style/NonNilCheck:
642
+ # With `IncludeSemanticChanges` set to `true`, this cop reports offenses for
643
+ # `!x.nil?` and autocorrects that and `x != nil` to solely `x`, which is
644
+ # **usually** OK, but might change behavior.
645
+ #
646
+ # With `IncludeSemanticChanges` set to `false`, this cop does not report
647
+ # offenses for `!x.nil?` and does no changes that might change behavior.
648
+ IncludeSemanticChanges: false
649
+
650
+ Style/NumericPredicate:
651
+ EnforcedStyle: predicate
652
+ SupportedStyles:
653
+ - predicate
654
+ - comparison
655
+
656
+ Style/MethodDefParentheses:
657
+ EnforcedStyle: require_parentheses
658
+ SupportedStyles:
659
+ - require_parentheses
660
+ - require_no_parentheses
661
+ - require_no_parentheses_except_multiline
662
+
663
+ Naming/MethodName:
664
+ EnforcedStyle: snake_case
665
+ SupportedStyles:
666
+ - snake_case
667
+ - camelCase
668
+
669
+ Style/ModuleFunction:
670
+ EnforcedStyle: module_function
671
+ SupportedStyles:
672
+ - module_function
673
+ - extend_self
674
+
675
+ Layout/MultilineArrayBraceLayout:
676
+ EnforcedStyle: symmetrical
677
+ SupportedStyles:
678
+ # symmetrical: closing brace is positioned in same way as opening brace
679
+ # new_line: closing brace is always on a new line
680
+ # same_line: closing brace is always on the same line as last element
681
+ - symmetrical
682
+ - new_line
683
+ - same_line
684
+
685
+ Layout/MultilineAssignmentLayout:
686
+ # The types of assignments which are subject to this rule.
687
+ SupportedTypes:
688
+ - block
689
+ - case
690
+ - class
691
+ - if
692
+ - kwbegin
693
+ - module
694
+ EnforcedStyle: new_line
695
+ SupportedStyles:
696
+ # Ensures that the assignment operator and the rhs are on the same line for
697
+ # the set of supported types.
698
+ - same_line
699
+ # Ensures that the assignment operator and the rhs are on separate lines
700
+ # for the set of supported types.
701
+ - new_line
702
+
703
+ Layout/MultilineHashBraceLayout:
704
+ EnforcedStyle: symmetrical
705
+ SupportedStyles:
706
+ # symmetrical: closing brace is positioned in same way as opening brace
707
+ # new_line: closing brace is always on a new line
708
+ # same_line: closing brace is always on same line as last element
709
+ - symmetrical
710
+ - new_line
711
+ - same_line
712
+
713
+ Layout/MultilineMethodCallBraceLayout:
714
+ EnforcedStyle: symmetrical
715
+ SupportedStyles:
716
+ # symmetrical: closing brace is positioned in same way as opening brace
717
+ # new_line: closing brace is always on a new line
718
+ # same_line: closing brace is always on the same line as last argument
719
+ - symmetrical
720
+ - new_line
721
+ - same_line
722
+
723
+ Layout/MultilineMethodCallIndentation:
724
+ EnforcedStyle: aligned
725
+ SupportedStyles:
726
+ - aligned
727
+ - indented
728
+ - indented_relative_to_receiver
729
+ # By default, the indentation width from Style/IndentationWidth is used
730
+ # But it can be overridden by setting this parameter
731
+ IndentationWidth: ~
732
+
733
+ Layout/MultilineMethodDefinitionBraceLayout:
734
+ EnforcedStyle: symmetrical
735
+ SupportedStyles:
736
+ # symmetrical: closing brace is positioned in same way as opening brace
737
+ # new_line: closing brace is always on a new line
738
+ # same_line: closing brace is always on the same line as last parameter
739
+ - symmetrical
740
+ - new_line
741
+ - same_line
742
+
743
+ Layout/MultilineOperationIndentation:
744
+ EnforcedStyle: aligned
745
+ SupportedStyles:
746
+ - aligned
747
+ - indented
748
+ # By default, the indentation width from Style/IndentationWidth is used
749
+ # But it can be overridden by setting this parameter
750
+ IndentationWidth: ~
751
+
752
+ Style/NumericLiterals:
753
+ MinDigits: 5
754
+
755
+ Style/NumericLiteralPrefix:
756
+ EnforcedOctalStyle: zero_with_o
757
+ SupportedOctalStyles:
758
+ - zero_with_o
759
+ - zero_only
760
+
761
+ Style/OptionHash:
762
+ # A list of parameter names that will be flagged by this cop.
763
+ SuspiciousParamNames:
764
+ - options
765
+ - opts
766
+ - args
767
+ - params
768
+ - parameters
769
+
770
+ # Allow safe assignment in conditions.
771
+ Style/ParenthesesAroundCondition:
772
+ AllowSafeAssignment: true
773
+
774
+ Style/PercentLiteralDelimiters:
775
+ PreferredDelimiters:
776
+ "%": ()
777
+ "%i": ()
778
+ "%q": ()
779
+ "%Q": ()
780
+ "%r": "{}"
781
+ "%s": ()
782
+ "%w": ()
783
+ "%W": ()
784
+ "%x": ()
785
+
786
+ Style/PercentQLiterals:
787
+ EnforcedStyle: lower_case_q
788
+ SupportedStyles:
789
+ - lower_case_q # Use %q when possible, %Q when necessary
790
+ - upper_case_q # Always use %Q
791
+
792
+ Style/SlicingWithRange:
793
+ Enabled: false
794
+
795
+ Naming/PredicateName:
796
+ # Predicate name prefixes.
797
+ NamePrefix:
798
+ - is_
799
+ - has_
800
+ - have_
801
+ # Predicate name prefixes that should be removed.
802
+ ForbiddenPrefixes:
803
+ - is_
804
+ - have_
805
+ # Predicate names which, despite having a blacklisted prefix, or no ?,
806
+ # should still be accepted
807
+ AllowedMethods:
808
+ - is_a?
809
+ # Exclude Rspec specs because there is a strong convetion to write spec
810
+ # helpers in the form of `have_something` or `be_something`.
811
+ Exclude:
812
+ - "**/spec/**/*"
813
+ - "**/test/**/*"
814
+
815
+ Style/PreferredHashMethods:
816
+ Enabled: true
817
+ EnforcedStyle: verbose
818
+
819
+ Style/DateTime:
820
+ Enabled: true
821
+
822
+ Style/Documentation:
823
+ Enabled: false
824
+
825
+ Style/RaiseArgs:
826
+ EnforcedStyle: exploded
827
+ SupportedStyles:
828
+ - compact # raise Exception.new(msg)
829
+ - exploded # raise Exception, msg
830
+
831
+ Style/RedundantReturn:
832
+ # When true allows code like `return x, y`.
833
+ AllowMultipleReturnValues: false
834
+
835
+ # Use / or %r around regular expressions.
836
+ Style/RegexpLiteral:
837
+ EnforcedStyle: slashes
838
+ # slashes: Always use slashes.
839
+ # percent_r: Always use %r.
840
+ # mixed: Use slashes on single-line regexes, and %r on multi-line regexes.
841
+ SupportedStyles:
842
+ - slashes
843
+ - percent_r
844
+ - mixed
845
+ # If false, the cop will always recommend using %r if one or more slashes
846
+ # are found in the regexp string.
847
+ AllowInnerSlashes: false
848
+
849
+ Style/SafeNavigation:
850
+ Enabled: false
851
+
852
+ Style/Semicolon:
853
+ # Allow ; to separate several expressions on the same line.
854
+ AllowAsExpressionSeparator: false
855
+
856
+ Style/SignalException:
857
+ EnforcedStyle: only_raise
858
+ SupportedStyles:
859
+ - only_raise
860
+ - only_fail
861
+ - semantic
862
+
863
+ Style/SingleLineBlockParams:
864
+ Methods:
865
+ - reduce:
866
+ - a
867
+ - e
868
+ - inject:
869
+ - a
870
+ - e
871
+
872
+ Style/SingleLineMethods:
873
+ AllowIfMethodIsEmpty: true
874
+
875
+ Layout/SpaceBeforeFirstArg:
876
+ # When true, allows most uses of extra spacing if the intent is to align
877
+ # things with the previous or next line, not counting empty lines or comment
878
+ # lines.
879
+ AllowForAlignment: true
880
+
881
+ Style/SpecialGlobalVars:
882
+ EnforcedStyle: use_english_names
883
+ SupportedStyles:
884
+ - use_perl_names
885
+ - use_english_names
886
+
887
+ Style/StabbyLambdaParentheses:
888
+ EnforcedStyle: require_parentheses
889
+ SupportedStyles:
890
+ - require_parentheses
891
+ - require_no_parentheses
892
+
893
+ Style/StringLiterals:
894
+ EnforcedStyle: double_quotes
895
+ SupportedStyles:
896
+ - single_quotes
897
+ - double_quotes
898
+ # If true, strings which span multiple lines using \ for continuation must
899
+ # use the same type of quotes on each line.
900
+ ConsistentQuotesInMultiline: false
901
+
902
+ Style/StringLiteralsInInterpolation:
903
+ EnforcedStyle: double_quotes
904
+ SupportedStyles:
905
+ - single_quotes
906
+ - double_quotes
907
+
908
+ Style/StringMethods:
909
+ # Mapping from undesired method to desired_method
910
+ # e.g. to use `to_sym` over `intern`:
911
+ #
912
+ # StringMethods:
913
+ # PreferredMethods:
914
+ # intern: to_sym
915
+ PreferredMethods:
916
+ intern: to_sym
917
+
918
+ Layout/SpaceAroundBlockParameters:
919
+ EnforcedStyleInsidePipes: no_space
920
+
921
+ Layout/SpaceAroundEqualsInParameterDefault:
922
+ EnforcedStyle: space
923
+ SupportedStyles:
924
+ - space
925
+ - no_space
926
+
927
+ Layout/SpaceAroundOperators:
928
+ # When true, allows most uses of extra spacing if the intent is to align
929
+ # with an operator on the previous or next line, not counting empty lines
930
+ # or comment lines.
931
+ AllowForAlignment: true
932
+
933
+ Layout/SpaceBeforeBlockBraces:
934
+ EnforcedStyle: space
935
+ SupportedStyles:
936
+ - space
937
+ - no_space
938
+
939
+ Layout/SpaceInsideBlockBraces:
940
+ EnforcedStyle: space
941
+ SupportedStyles:
942
+ - space
943
+ - no_space
944
+ # Valid values are: space, no_space
945
+ EnforcedStyleForEmptyBraces: no_space
946
+ # Space between { and |. Overrides EnforcedStyle if there is a conflict.
947
+ SpaceBeforeBlockParameters: true
948
+
949
+ Layout/SpaceInsideHashLiteralBraces:
950
+ EnforcedStyle: space
951
+ EnforcedStyleForEmptyBraces: no_space
952
+ SupportedStyles:
953
+ - space
954
+ - no_space
955
+ # "compact" normally requires a space inside hash braces, with the exception
956
+ # that successive left braces or right braces are collapsed together
957
+ - compact
958
+
959
+ Layout/SpaceInsideStringInterpolation:
960
+ EnforcedStyle: no_space
961
+ SupportedStyles:
962
+ - space
963
+ - no_space
964
+
965
+ Style/AccessModifierDeclarations:
966
+ Enabled: false
967
+
968
+ Style/SymbolArray:
969
+ EnforcedStyle: brackets
970
+ SupportedStyles:
971
+ - percent
972
+ - brackets
973
+
974
+ Style/SymbolProc:
975
+ # A list of method names to be ignored by the check.
976
+ # The names should be fairly unique, otherwise you will end up ignoring lots of code.
977
+ AllowedMethods:
978
+ - respond_to
979
+ - define_method
980
+
981
+ Style/TernaryParentheses:
982
+ EnforcedStyle: require_no_parentheses
983
+ SupportedStyles:
984
+ - require_parentheses
985
+ - require_no_parentheses
986
+ AllowSafeAssignment: true
987
+
988
+ Layout/TrailingEmptyLines:
989
+ EnforcedStyle: final_newline
990
+ SupportedStyles:
991
+ - final_newline
992
+ - final_blank_line
993
+
994
+ Style/TrailingCommaInArguments:
995
+ # If `comma`, the cop requires a comma after the last argument, but only for
996
+ # parenthesized method calls where each argument is on its own line.
997
+ # If `consistent_comma`, the cop requires a comma after the last argument,
998
+ # for all parenthesized method calls with arguments.
999
+ EnforcedStyleForMultiline: no_comma
1000
+
1001
+ Style/TrailingCommaInArrayLiteral:
1002
+ # If `comma`, the cop requires a comma after the last item in an array or
1003
+ # hash, but only when each item is on its own line.
1004
+ # If `consistent_comma`, the cop requires a comma after the last item of all
1005
+ # non-empty array and hash literals.
1006
+ EnforcedStyleForMultiline: no_comma
1007
+
1008
+ Style/TrailingCommaInHashLiteral:
1009
+ # If `comma`, the cop requires a comma after the last item in an array or
1010
+ # hash, but only when each item is on its own line.
1011
+ # If `consistent_comma`, the cop requires a comma after the last item of all
1012
+ # non-empty array and hash literals.
1013
+ EnforcedStyleForMultiline: no_comma
1014
+
1015
+ # TrivialAccessors requires exact name matches and does not allow
1016
+ # predicated methods by default.
1017
+ Style/TrivialAccessors:
1018
+ # When set to false the cop will suggest the use of accessor methods
1019
+ # in situations like:
1020
+ #
1021
+ # def name
1022
+ # @other_name
1023
+ # end
1024
+ #
1025
+ # This way you can uncover "hidden" attributes in your code.
1026
+ ExactNameMatch: true
1027
+ AllowPredicates: true
1028
+ # Allows trivial writers that do not end in an equal sign. e.g.
1029
+ #
1030
+ # def on_exception(action)
1031
+ # @on_exception=action
1032
+ # end
1033
+ # on_exception :restart
1034
+ #
1035
+ # Commonly used in DSLs
1036
+ AllowDSLWriters: false
1037
+ IgnoreClassMethods: false
1038
+ AllowedMethods:
1039
+ - to_ary
1040
+ - to_a
1041
+ - to_c
1042
+ - to_enum
1043
+ - to_h
1044
+ - to_hash
1045
+ - to_i
1046
+ - to_int
1047
+ - to_io
1048
+ - to_open
1049
+ - to_path
1050
+ - to_proc
1051
+ - to_r
1052
+ - to_regexp
1053
+ - to_str
1054
+ - to_s
1055
+ - to_sym
1056
+
1057
+ Naming/VariableName:
1058
+ EnforcedStyle: snake_case
1059
+ SupportedStyles:
1060
+ - snake_case
1061
+ - camelCase
1062
+
1063
+ Naming/VariableNumber:
1064
+ EnforcedStyle: normalcase
1065
+ SupportedStyles:
1066
+ - snake_case
1067
+ - normalcase
1068
+ - non_integer
1069
+
1070
+ # WordArray enforces how array literals of word-like strings should be expressed.
1071
+ Style/WordArray:
1072
+ EnforcedStyle: percent
1073
+ SupportedStyles:
1074
+ # percent style: %w(word1 word2)
1075
+ - percent
1076
+ # bracket style: ["word1", "word2"]
1077
+ - brackets
1078
+ # The MinSize option causes the WordArray rule to be ignored for arrays
1079
+ # smaller than a certain size. The rule is only applied to arrays
1080
+ # whose element count is greater than or equal to MinSize.
1081
+ MinSize: 2
1082
+ # The regular expression WordRegex decides what is considered a word.
1083
+ WordRegex: !ruby/regexp '/\A[\p{Word}\n\t]+\z/'
1084
+
1085
+ ##################### Metrics ##################################
1086
+
1087
+ Metrics/AbcSize:
1088
+ # The ABC size is a calculated magnitude, so this number can be an Integer or
1089
+ # a Float.
1090
+ Max: 15
1091
+ Enabled: false
1092
+
1093
+ Metrics/BlockLength:
1094
+ Enabled: false
1095
+
1096
+ Metrics/BlockNesting:
1097
+ Max: 3
1098
+
1099
+ Metrics/ClassLength:
1100
+ CountComments: false # count full line comments?
1101
+ Max: 100
1102
+ Enabled: false
1103
+
1104
+ Metrics/ModuleLength:
1105
+ CountComments: false # count full line comments?
1106
+ Max: 100
1107
+ Enabled: false
1108
+
1109
+ # Avoid complex methods.
1110
+ Metrics/CyclomaticComplexity:
1111
+ Max: 9
1112
+ Exclude:
1113
+ - "bin/bundle"
1114
+ - "decidim-admin/app/queries/decidim/admin/newsletter_recipients.rb"
1115
+ - "**/*/dummy_authorization_handler.rb"
1116
+ - "**/*/permissions.rb"
1117
+
1118
+ Metrics/MethodLength:
1119
+ CountComments: false # count full line comments?
1120
+ Max: 15
1121
+ Enabled: false
1122
+
1123
+ Metrics/ParameterLists:
1124
+ Max: 5
1125
+ CountKeywordArgs: true
1126
+ Exclude:
1127
+ - "decidim-core/lib/decidim/filter_form_builder.rb"
1128
+
1129
+ Metrics/PerceivedComplexity:
1130
+ Max: 10
1131
+ Exclude:
1132
+ - "decidim-admin/app/queries/decidim/admin/newsletter_recipients.rb"
1133
+ - "**/*/dummy_authorization_handler.rb"
1134
+ - "**/*/permissions.rb"
1135
+
1136
+ ##################### Lint ##################################
1137
+
1138
+ Lint/AmbiguousBlockAssociation:
1139
+ Enabled: true
1140
+ Exclude:
1141
+ - "**/abilities/**/*"
1142
+
1143
+ # Allow safe assignment in conditions.
1144
+ Lint/AssignmentInCondition:
1145
+ AllowSafeAssignment: true
1146
+
1147
+ Lint/ConstantDefinitionInBlock:
1148
+ Enabled: false
1149
+
1150
+ # Call super to initialize state of the parent class.
1151
+ Lint/MissingSuper:
1152
+ Enabled: false
1153
+
1154
+ # checks whether the end keywords are aligned properly for `do` `end` blocks.
1155
+ Layout/BlockAlignment:
1156
+ # The value `start_of_block` means that the `end` should be aligned with line
1157
+ # where the `do` keyword appears.
1158
+ # The value `start_of_line` means it should be aligned with the whole
1159
+ # expression's starting line.
1160
+ # The value `either` means both are allowed.
1161
+ EnforcedStyleAlignWith: either
1162
+
1163
+ # Align ends correctly.
1164
+ Layout/EndAlignment:
1165
+ # The value `keyword` means that `end` should be aligned with the matching
1166
+ # keyword (if, while, etc.).
1167
+ # The value `variable` means that in assignments, `end` should be aligned
1168
+ # with the start of the variable on the left hand side of `=`. In all other
1169
+ # situations, `end` should still be aligned with the keyword.
1170
+ # The value `start_of_line` means that `end` should be aligned with the start
1171
+ # of the line which the matching keyword appears on.
1172
+ EnforcedStyleAlignWith: keyword
1173
+ AutoCorrect: false
1174
+
1175
+ Layout/DefEndAlignment:
1176
+ # The value `def` means that `end` should be aligned with the def keyword.
1177
+ # The value `start_of_line` means that `end` should be aligned with method
1178
+ # calls like `private`, `public`, etc, if present in front of the `def`
1179
+ # keyword on the same line.
1180
+ EnforcedStyleAlignWith: start_of_line
1181
+ AutoCorrect: false
1182
+
1183
+ Lint/InheritException:
1184
+ # The default base class in favour of `Exception`.
1185
+ EnforcedStyle: runtime_error
1186
+ SupportedStyles:
1187
+ - runtime_error
1188
+ - standard_error
1189
+
1190
+ Layout/LineLength:
1191
+ Max: 180
1192
+ # To make it possible to copy or click on URIs in the code, we allow lines
1193
+ # containing a URI to be longer than Max.
1194
+ AllowHeredoc: true
1195
+ AllowURI: true
1196
+ URISchemes:
1197
+ - http
1198
+ - https
1199
+ Exclude:
1200
+ - "**/spec/**/*"
1201
+
1202
+ # Checks for unused block arguments
1203
+ Lint/UnusedBlockArgument:
1204
+ IgnoreEmptyBlocks: true
1205
+ AllowUnusedKeywordArguments: false
1206
+
1207
+ # Checks for unused method arguments.
1208
+ Lint/UnusedMethodArgument:
1209
+ AllowUnusedKeywordArguments: false
1210
+ IgnoreEmptyMethods: true