decidim-decidim_awesome 0.12.0 → 0.12.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +33 -0
  3. data/README.md +24 -14
  4. data/Rakefile +12 -0
  5. data/app/cells/concerns/decidim/decidim_awesome/global_menu_cell_override.rb +14 -2
  6. data/app/cells/concerns/decidim/decidim_awesome/proposal_l_cell_override.rb +5 -4
  7. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal/show.erb +3 -3
  8. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal/vote_block_for.erb +1 -1
  9. data/app/controllers/concerns/decidim/decidim_awesome/admin/maintenance_context.rb +0 -28
  10. data/app/controllers/concerns/decidim/decidim_awesome/needs_hashcash.rb +41 -0
  11. data/app/controllers/concerns/decidim/decidim_awesome/not_found_redirect.rb +2 -2
  12. data/app/controllers/decidim/decidim_awesome/admin/admin_authorizations_controller.rb +2 -2
  13. data/app/controllers/decidim/decidim_awesome/admin/checks_controller.rb +0 -4
  14. data/app/controllers/decidim/decidim_awesome/admin/config_controller.rb +2 -1
  15. data/app/controllers/decidim/decidim_awesome/admin/custom_redirects_controller.rb +1 -2
  16. data/app/controllers/decidim/decidim_awesome/admin/hashcash_controller.rb +39 -0
  17. data/app/controllers/decidim/decidim_awesome/admin/menu_hacks_controller.rb +1 -1
  18. data/app/controllers/decidim/decidim_awesome/admin/{maintenance_controller.rb → private_data_controller.rb} +9 -9
  19. data/app/controllers/decidim/decidim_awesome/utils_controller.rb +17 -0
  20. data/app/forms/concerns/decidim/decidim_awesome/proposals/proposal_form_override.rb +7 -1
  21. data/app/forms/decidim/decidim_awesome/admin/config_form.rb +13 -0
  22. data/app/helpers/decidim/decidim_awesome/admin/config_constraints_helpers.rb +1 -1
  23. data/app/helpers/decidim/decidim_awesome/map_helper.rb +4 -2
  24. data/app/models/decidim/decidim_awesome/paper_trail_version.rb +1 -1
  25. data/app/overrides/decidim/devise/registrations/new/add_hashcash.html.erb.deface +3 -0
  26. data/app/overrides/decidim/devise/sessions/new/add_hashcash.html.erb.deface +3 -0
  27. data/app/overrides/layouts/decidim/_head/add_awesome_custom_styles.html.erb.deface +3 -0
  28. data/app/overrides/layouts/decidim/_head/add_awesome_tags.html.erb.deface +0 -2
  29. data/app/packs/entrypoints/decidim_decidim_awesome_hashcash.js +4 -0
  30. data/app/packs/src/decidim/decidim_awesome/admin/auto_edit.js +10 -6
  31. data/app/packs/src/decidim/decidim_awesome/admin/custom_fields_builder.js +4 -2
  32. data/app/packs/src/decidim/decidim_awesome/admin/verifications.js +6 -3
  33. data/app/packs/src/decidim/decidim_awesome/awesome_map/api/proposals_fetcher.js +1 -1
  34. data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/controller.js +1 -1
  35. data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/proposals_controller.js +1 -1
  36. data/app/packs/src/decidim/decidim_awesome/awesome_map/controls_ui.js +6 -6
  37. data/app/packs/src/decidim/decidim_awesome/awesome_map/load_map.js +1 -1
  38. data/app/packs/src/decidim/decidim_awesome/forms/autosave.js +3 -3
  39. data/app/packs/src/decidim/decidim_awesome/forms/custom_fields_renderer.js +1 -113
  40. data/app/packs/src/decidim/decidim_awesome/proposals/images.js +1 -1
  41. data/app/packs/src/vendor/form_builder_langs/ar-SA.lang +111 -0
  42. data/app/packs/src/vendor/form_builder_langs/ar-TN.lang +94 -0
  43. data/app/packs/src/vendor/form_builder_langs/ca-ES.lang +110 -0
  44. data/app/packs/src/vendor/form_builder_langs/cs-CZ.lang +105 -0
  45. data/app/packs/src/vendor/form_builder_langs/da-DK.lang +110 -0
  46. data/app/packs/src/vendor/form_builder_langs/de-DE.lang +109 -0
  47. data/app/packs/src/vendor/form_builder_langs/el-GR.lang +110 -0
  48. data/app/packs/src/vendor/form_builder_langs/en-US.lang +117 -0
  49. data/app/packs/src/vendor/form_builder_langs/es-ES.lang +103 -0
  50. data/app/packs/src/vendor/form_builder_langs/fa-IR.lang +108 -0
  51. data/app/packs/src/vendor/form_builder_langs/fi-FI.lang +107 -0
  52. data/app/packs/src/vendor/form_builder_langs/fr-FR.lang +117 -0
  53. data/app/packs/src/vendor/form_builder_langs/he-IL.lang +108 -0
  54. data/app/packs/src/vendor/form_builder_langs/hi-IN.lang +110 -0
  55. data/app/packs/src/vendor/form_builder_langs/hu-HU.lang +108 -0
  56. data/app/packs/src/vendor/form_builder_langs/id-ID.lang +110 -0
  57. data/app/packs/src/vendor/form_builder_langs/it-IT.lang +107 -0
  58. data/app/packs/src/vendor/form_builder_langs/ja-JP.lang +108 -0
  59. data/app/packs/src/vendor/form_builder_langs/my-MM.lang +108 -0
  60. data/app/packs/src/vendor/form_builder_langs/nb-NO.lang +94 -0
  61. data/app/packs/src/vendor/form_builder_langs/nl-NL.lang +94 -0
  62. data/app/packs/src/vendor/form_builder_langs/pl-PL.lang +122 -0
  63. data/app/packs/src/vendor/form_builder_langs/pt-BR.lang +110 -0
  64. data/app/packs/src/vendor/form_builder_langs/pu-IN.lang +110 -0
  65. data/app/packs/src/vendor/form_builder_langs/qz-MM.lang +108 -0
  66. data/app/packs/src/vendor/form_builder_langs/ro-RO.lang +94 -0
  67. data/app/packs/src/vendor/form_builder_langs/ru-RU.lang +110 -0
  68. data/app/packs/src/vendor/form_builder_langs/sl-SI.lang +110 -0
  69. data/app/packs/src/vendor/form_builder_langs/th-TH.lang +111 -0
  70. data/app/packs/src/vendor/form_builder_langs/tr-TR.lang +115 -0
  71. data/app/packs/src/vendor/form_builder_langs/uk-UA.lang +108 -0
  72. data/app/packs/src/vendor/form_builder_langs/vi-VN.lang +94 -0
  73. data/app/packs/src/vendor/form_builder_langs/zh-CN.lang +100 -0
  74. data/app/packs/src/vendor/form_builder_langs/zh-TW.lang +94 -0
  75. data/app/packs/src/vendor/hashcash.js +83 -0
  76. data/app/packs/src/vendor/sha1.js +143 -0
  77. data/app/packs/src/vendor/stamp.js +50 -0
  78. data/app/packs/stylesheets/decidim/decidim_awesome/forms/autosave.scss +2 -12
  79. data/app/presenters/decidim/decidim_awesome/private_data_presenter.rb +2 -2
  80. data/app/views/decidim/decidim_awesome/admin/admin_accountability/index.html.erb +4 -4
  81. data/app/views/decidim/decidim_awesome/admin/admin_authorizations/callout.html.erb +2 -2
  82. data/app/views/decidim/decidim_awesome/admin/admin_authorizations/conflict.html.erb +4 -4
  83. data/app/views/decidim/decidim_awesome/admin/admin_authorizations/edit.html.erb +6 -5
  84. data/app/views/decidim/decidim_awesome/admin/checks/index.html.erb +6 -6
  85. data/app/views/decidim/decidim_awesome/admin/config/_autoedit_box_label.html.erb +2 -2
  86. data/app/views/decidim/decidim_awesome/admin/config/_constraints.html.erb +3 -3
  87. data/app/views/decidim/decidim_awesome/admin/config/_form_admins.html.erb +4 -3
  88. data/app/views/decidim/decidim_awesome/admin/config/_form_editors.html.erb +1 -1
  89. data/app/views/decidim/decidim_awesome/admin/config/_form_proposal_custom_fields.html.erb +4 -4
  90. data/app/views/decidim/decidim_awesome/admin/config/_form_scoped_styles.html.erb +3 -3
  91. data/app/views/decidim/decidim_awesome/admin/config/_form_surveys.html.erb +40 -2
  92. data/app/views/decidim/decidim_awesome/admin/config/_form_verifications.html.erb +1 -1
  93. data/app/views/decidim/decidim_awesome/admin/hashcash/_filters.html.erb +55 -0
  94. data/app/views/decidim/decidim_awesome/admin/hashcash/index.html.erb +33 -0
  95. data/app/views/decidim/decidim_awesome/admin/hashcash/ip_addresses.html.erb +29 -0
  96. data/app/views/decidim/decidim_awesome/admin/hashcash/show.html.erb +42 -0
  97. data/app/views/decidim/decidim_awesome/admin/menu_hacks/index.html.erb +2 -2
  98. data/app/views/decidim/decidim_awesome/admin/{maintenance → private_data}/_private_data.html.erb +2 -2
  99. data/app/views/decidim/decidim_awesome/admin/{maintenance/show.html.erb → private_data/index.html.erb} +2 -3
  100. data/app/views/decidim/decidim_awesome/admin/proposals/_private_body.html.erb +1 -1
  101. data/app/views/decidim/decidim_awesome/amendments/_modal.html.erb +2 -2
  102. data/app/views/decidim/decidim_awesome/hashcash/_hidden_field.html.erb +5 -0
  103. data/app/views/layouts/decidim/decidim_awesome/_awesome_config.html.erb +2 -2
  104. data/app/views/layouts/decidim/decidim_awesome/admin/maintenance.html.erb +2 -11
  105. data/config/assets.rb +1 -0
  106. data/config/i18n-tasks.yml +1 -0
  107. data/config/locales/ca.yml +69 -30
  108. data/config/locales/cs.yml +68 -29
  109. data/config/locales/de.yml +67 -28
  110. data/config/locales/en.yml +81 -32
  111. data/config/locales/es.yml +68 -29
  112. data/config/locales/eu.yml +31 -31
  113. data/config/locales/fr.yml +82 -31
  114. data/config/locales/ja.yml +31 -31
  115. data/lib/decidim/decidim_awesome/admin_engine.rb +8 -5
  116. data/lib/decidim/decidim_awesome/awesome.rb +29 -7
  117. data/lib/decidim/decidim_awesome/checksums.yml +15 -40
  118. data/lib/decidim/decidim_awesome/engine.rb +11 -2
  119. data/lib/decidim/decidim_awesome/menu.rb +151 -138
  120. data/lib/decidim/decidim_awesome/test/initializer.rb +4 -1
  121. data/lib/decidim/decidim_awesome/test/shared_examples/config_examples.rb +1 -3
  122. data/lib/decidim/decidim_awesome/test/shared_examples/editor_examples.rb +2 -1
  123. data/lib/decidim/decidim_awesome/test/shared_examples/summary_examples.rb +8 -1
  124. data/lib/decidim/decidim_awesome/version.rb +1 -1
  125. data/lib/tasks/decidim_awesome_upgrade_tasks.rake +4 -1
  126. data/package.json +3 -4
  127. metadata +68 -10
  128. data/config/rubocop/disabled.yml +0 -11
  129. data/config/rubocop/faker.yml +0 -480
  130. data/config/rubocop/rails.yml +0 -88
  131. data/config/rubocop/rspec.yml +0 -65
  132. data/config/rubocop/ruby.yml +0 -1210
@@ -1,1210 +0,0 @@
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