decidim 0.7.4 → 0.8.0

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

Potentially problematic release.


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

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