potassium 5.2.0 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +42 -0
  3. data/.editorconfig +3 -0
  4. data/.node-version +1 -0
  5. data/.ruby-version +1 -1
  6. data/CHANGELOG.md +94 -0
  7. data/README.md +41 -47
  8. data/docs/DSL.md +5 -5
  9. data/lib/potassium/assets/.buildpacks +0 -1
  10. data/lib/potassium/assets/.circleci/config.yml.erb +102 -0
  11. data/lib/potassium/assets/.eslintrc.json +352 -0
  12. data/lib/potassium/assets/.github/pull_request_template.md +9 -0
  13. data/lib/potassium/assets/.pryrc +1 -1
  14. data/lib/potassium/assets/.rubocop.yml +515 -0
  15. data/lib/potassium/assets/.stylelintrc.json +46 -0
  16. data/lib/potassium/assets/Dockerfile.ci +1 -1
  17. data/lib/potassium/assets/Makefile.erb +35 -0
  18. data/lib/potassium/assets/Procfile +1 -0
  19. data/lib/potassium/assets/README.yml +60 -11
  20. data/lib/potassium/assets/active_admin/admin-component.vue +35 -0
  21. data/lib/potassium/assets/active_admin/admin_application.js +14 -0
  22. data/lib/potassium/assets/active_admin/init_activeadmin_vue.rb +10 -0
  23. data/lib/potassium/assets/app/graphql/graphql_controller.rb +55 -0
  24. data/lib/potassium/assets/app/graphql/mutations/login_mutation.rb +23 -0
  25. data/lib/potassium/assets/app/graphql/queries/base_query.rb +4 -0
  26. data/lib/potassium/assets/app/graphql/types/base/base_argument.rb +4 -0
  27. data/lib/potassium/assets/app/graphql/types/base/base_enum.rb +4 -0
  28. data/lib/potassium/assets/app/graphql/types/base/base_field.rb +5 -0
  29. data/lib/potassium/assets/app/graphql/types/base/base_input_object.rb +5 -0
  30. data/lib/potassium/assets/app/graphql/types/base/base_interface.rb +7 -0
  31. data/lib/potassium/assets/app/graphql/types/base/base_object.rb +5 -0
  32. data/lib/potassium/assets/app/graphql/types/base/base_scalar.rb +4 -0
  33. data/lib/potassium/assets/app/graphql/types/base/base_union.rb +4 -0
  34. data/lib/potassium/assets/app/graphql/types/mutation_type.rb +10 -0
  35. data/lib/potassium/assets/app/graphql/types/query_type.rb +13 -0
  36. data/lib/potassium/assets/app/javascript/app.spec.js +14 -0
  37. data/lib/potassium/assets/app/uploaders/base_uploader.rb +11 -0
  38. data/lib/potassium/assets/app/uploaders/image_uploader.rb +5 -0
  39. data/lib/potassium/assets/bin/cibuild.erb +24 -7
  40. data/lib/potassium/assets/bin/release +9 -0
  41. data/lib/potassium/assets/bin/setup.erb +3 -0
  42. data/lib/potassium/assets/config/database_mysql.yml.erb +5 -5
  43. data/lib/potassium/assets/config/database_postgresql.yml.erb +5 -5
  44. data/lib/potassium/assets/config/graphql_playground.rb +20 -0
  45. data/lib/potassium/assets/config/puma.rb +5 -1
  46. data/lib/potassium/assets/config/shrine.rb +36 -0
  47. data/lib/potassium/assets/docker-compose.ci.yml +2 -1
  48. data/lib/potassium/assets/docker-compose.yml +6 -0
  49. data/lib/potassium/assets/lib/tasks/auto_annotate_models.rake +34 -33
  50. data/lib/potassium/assets/package.json +4 -1
  51. data/lib/potassium/assets/redis.yml +1 -2
  52. data/lib/potassium/assets/sidekiq_scheduler.yml +1 -1
  53. data/lib/potassium/assets/testing/rails_helper.rb +4 -2
  54. data/lib/potassium/cli/commands/create.rb +12 -19
  55. data/lib/potassium/cli_options.rb +67 -24
  56. data/lib/potassium/helpers/docker-helpers.rb +14 -5
  57. data/lib/potassium/helpers/gem-helpers.rb +1 -1
  58. data/lib/potassium/helpers/template-helpers.rb +4 -0
  59. data/lib/potassium/newest_version_ensurer.rb +19 -36
  60. data/lib/potassium/node_version_ensurer.rb +30 -0
  61. data/lib/potassium/recipes/admin.rb +3 -3
  62. data/lib/potassium/recipes/annotate.rb +1 -1
  63. data/lib/potassium/recipes/api.rb +93 -21
  64. data/lib/potassium/recipes/background_processor.rb +38 -2
  65. data/lib/potassium/recipes/ci.rb +8 -6
  66. data/lib/potassium/recipes/data_migrate.rb +44 -0
  67. data/lib/potassium/recipes/database.rb +6 -2
  68. data/lib/potassium/recipes/database_container.rb +90 -0
  69. data/lib/potassium/recipes/draper.rb +1 -10
  70. data/lib/potassium/recipes/file_storage.rb +66 -0
  71. data/lib/potassium/recipes/front_end.rb +219 -9
  72. data/lib/potassium/recipes/github.rb +93 -15
  73. data/lib/potassium/recipes/heroku.rb +2 -1
  74. data/lib/potassium/recipes/listen.rb +7 -0
  75. data/lib/potassium/recipes/mailer.rb +14 -4
  76. data/lib/potassium/recipes/node.rb +21 -0
  77. data/lib/potassium/recipes/puma.rb +0 -3
  78. data/lib/potassium/recipes/rack_cors.rb +18 -15
  79. data/lib/potassium/recipes/rails.rb +6 -0
  80. data/lib/potassium/recipes/schedule.rb +1 -1
  81. data/lib/potassium/recipes/style.rb +21 -3
  82. data/lib/potassium/recipes/vue_admin.rb +124 -0
  83. data/lib/potassium/templates/application.rb +10 -9
  84. data/lib/potassium/version.rb +7 -4
  85. data/potassium.gemspec +9 -6
  86. data/spec/features/api_spec.rb +25 -0
  87. data/spec/features/background_processor_spec.rb +12 -1
  88. data/spec/features/data_migrate_spec.rb +14 -0
  89. data/spec/features/database_container_spec.rb +35 -0
  90. data/spec/features/draper_spec.rb +1 -6
  91. data/spec/features/file_storage_spec.rb +75 -0
  92. data/spec/features/front_end_spec.rb +88 -0
  93. data/spec/features/github_spec.rb +53 -8
  94. data/spec/features/graphql_spec.rb +71 -0
  95. data/spec/features/heroku_spec.rb +8 -5
  96. data/spec/features/mailer_spec.rb +42 -0
  97. data/spec/features/new_project_spec.rb +6 -14
  98. data/spec/features/node_spec.rb +28 -0
  99. data/spec/features/power_types_spec.rb +5 -16
  100. data/spec/features/vue_admin_spec.rb +47 -0
  101. data/spec/spec_helper.rb +5 -0
  102. data/spec/support/fake_octokit.rb +31 -0
  103. data/spec/support/potassium_test_helpers.rb +26 -8
  104. metadata +126 -45
  105. data/circle.yml +0 -12
  106. data/lib/potassium/assets/.circleci/config.yml +0 -20
  107. data/lib/potassium/assets/active_admin/active_admin.js.coffee +0 -4
  108. data/lib/potassium/assets/active_admin/init_activeadmin_angular.rb +0 -8
  109. data/lib/potassium/assets/api/api_error_concern.rb +0 -32
  110. data/lib/potassium/assets/api/base_controller.rb +0 -9
  111. data/lib/potassium/assets/api/draper_responder.rb +0 -62
  112. data/lib/potassium/assets/api/responder.rb +0 -41
  113. data/lib/potassium/assets/aws.rb +0 -1
  114. data/lib/potassium/assets/testing/paperclip.rb +0 -59
  115. data/lib/potassium/recipes/active_storage.rb +0 -40
  116. data/lib/potassium/recipes/angular_admin.rb +0 -56
  117. data/lib/potassium/recipes/aws_sdk.rb +0 -7
  118. data/lib/potassium/recipes/paperclip.rb +0 -47
  119. data/spec/features/active_storage_spec.rb +0 -30
  120. data/spec/features/front_end.rb +0 -30
@@ -0,0 +1,352 @@
1
+ {
2
+ "env": {
3
+ "es6": true
4
+ },
5
+ "parserOptions": {
6
+ "ecmaVersion": 2018,
7
+ "sourceType": "module"
8
+ },
9
+ "plugins": ["import"],
10
+ "settings": {
11
+ "import/resolver": {
12
+ "node": {
13
+ "extensions": [".js", ".json"]
14
+ }
15
+ }
16
+ },
17
+ "extends": [
18
+ "plugin:vue/strongly-recommended"
19
+ ],
20
+ "rules": {
21
+ "accessor-pairs": 0,
22
+ "array-callback-return": 2,
23
+ "block-scoped-var": 2,
24
+ "complexity": [1, {
25
+ "max": 6
26
+ }],
27
+ "consistent-return": 2,
28
+ "curly": [2, "multi-line"],
29
+ "default-case": [2, {
30
+ "commentPattern": "^no default$"
31
+ }],
32
+ "dot-notation": [1, {
33
+ "allowKeywords": true
34
+ }],
35
+ "dot-location": [2, "property"],
36
+ "eqeqeq": [2],
37
+ "guard-for-in": 2,
38
+ "no-alert": 1,
39
+ "no-case-declarations": 2,
40
+ "no-div-regex": 0,
41
+ "no-else-return": 2,
42
+ "no-empty-function": [2, {
43
+ "allow": ["arrowFunctions", "functions", "methods"]
44
+ }],
45
+ "no-empty-pattern": 2,
46
+ "no-eval": 2,
47
+ "no-extend-native": 2,
48
+ "no-extra-bind": 2,
49
+ "no-fallthrough": 2,
50
+ "no-floating-decimal": 2,
51
+ "no-implicit-coercion": 0,
52
+ "no-implicit-globals": 2,
53
+ "no-implied-eval": 2,
54
+ "no-invalid-this": 0,
55
+ "no-iterator": 2,
56
+ "no-extra-label": 2,
57
+ "no-labels": [2, {
58
+ "allowLoop": false,
59
+ "allowSwitch": false
60
+ }],
61
+ "no-lone-blocks": 2,
62
+ "no-loop-func": 2,
63
+ "no-magic-numbers": [2, {
64
+ "ignore": [0, 1, -1]
65
+ }],
66
+ "no-multi-spaces": 2,
67
+ "no-multi-str": 2,
68
+ "no-native-reassign": 2,
69
+ "no-new": 2,
70
+ "no-new-func": 2,
71
+ "no-new-wrappers": 2,
72
+ "no-octal": 2,
73
+ "no-octal-escape": 2,
74
+ "no-param-reassign": [2, {
75
+ "props": false
76
+ }],
77
+ "no-proto": 2,
78
+ "no-redeclare": 2,
79
+ "no-return-assign": 2,
80
+ "no-script-url": 2,
81
+ "no-self-assign": 2,
82
+ "no-self-compare": 2,
83
+ "no-sequences": 2,
84
+ "no-throw-literal": 2,
85
+ "no-unmodified-loop-condition": 0,
86
+ "no-unused-expressions": 2,
87
+ "no-unused-labels": 2,
88
+ "no-useless-call": 0,
89
+ "no-useless-concat": 2,
90
+ "no-useless-escape": 2,
91
+ "no-void": 0,
92
+ "no-warning-comments": [1, {
93
+ "terms": ["todo", "fixme", "xxx"],
94
+ "location": "start"
95
+ }],
96
+ "no-with": 2,
97
+ "radix": 2,
98
+ "vars-on-top": 2,
99
+ "wrap-iife": [2, "any"],
100
+ "yoda": 2,
101
+ "comma-dangle": [2, "always-multiline"],
102
+ "no-cond-assign": [2, "always"],
103
+ "no-console": 1,
104
+ "no-debugger": 1,
105
+ "no-constant-condition": 2,
106
+ "no-control-regex": 2,
107
+ "no-dupe-args": 2,
108
+ "no-dupe-keys": 2,
109
+ "no-duplicate-case": 2,
110
+ "no-empty": 2,
111
+ "no-empty-character-class": 2,
112
+ "no-ex-assign": 2,
113
+ "no-extra-boolean-cast": 0,
114
+ "no-extra-parens": [0, "all", {
115
+ "conditionalAssign": true,
116
+ "nestedBinaryExpressions": false,
117
+ "returnAssign": false
118
+ }],
119
+ "no-extra-semi": 2,
120
+ "no-func-assign": 2,
121
+ "no-inner-declarations": 2,
122
+ "no-invalid-regexp": 2,
123
+ "no-irregular-whitespace": 2,
124
+ "no-negated-in-lhs": 2,
125
+ "no-obj-calls": 2,
126
+ "no-regex-spaces": 2,
127
+ "no-sparse-arrays": 2,
128
+ "no-unexpected-multiline": 0,
129
+ "no-unreachable": 2,
130
+ "no-unsafe-finally": 2,
131
+ "use-isnan": 2,
132
+ "valid-jsdoc": 0,
133
+ "valid-typeof": 2,
134
+ "arrow-body-style": [2, "as-needed"],
135
+ "arrow-parens": 0,
136
+ "arrow-spacing": [2, {
137
+ "before": true,
138
+ "after": true
139
+ }],
140
+ "constructor-super": 0,
141
+ "generator-star-spacing": [2, {
142
+ "before": true,
143
+ "after": false
144
+ }],
145
+ "no-class-assign": 2,
146
+ "no-confusing-arrow": [2, {
147
+ "allowParens": true
148
+ }],
149
+ "no-const-assign": 2,
150
+ "no-dupe-class-members": 2,
151
+ "no-duplicate-imports": 2,
152
+ "no-new-symbol": 2,
153
+ "no-restricted-imports": 0,
154
+ "no-this-before-super": 0,
155
+ "no-useless-computed-key": 2,
156
+ "no-useless-constructor": 2,
157
+ "no-var": 2,
158
+ "object-shorthand": [2, "always", {
159
+ "ignoreConstructors": false,
160
+ "avoidQuotes": true
161
+ }],
162
+ "prefer-arrow-callback": [2, {
163
+ "allowNamedFunctions": false,
164
+ "allowUnboundThis": true
165
+ }],
166
+ "prefer-const": [2, {
167
+ "destructuring": "any",
168
+ "ignoreReadBeforeAssign": true
169
+ }],
170
+ "prefer-reflect": 0,
171
+ "no-caller": 2,
172
+ "prefer-rest-params": 2,
173
+ "prefer-spread": 2,
174
+ "prefer-template": 2,
175
+ "require-yield": 2,
176
+ "sort-imports": 0,
177
+ "template-curly-spacing": 2,
178
+ "yield-star-spacing": [2, "before"],
179
+ "import/no-unresolved": [0],
180
+ "import/named": 0,
181
+ "import/default": 0,
182
+ "import/namespace": 0,
183
+ "import/export": 2,
184
+ "import/no-named-as-default": 0,
185
+ "import/no-named-as-default-member": 0,
186
+ "import/no-deprecated": 0,
187
+ "import/no-extraneous-dependencies": [0, {
188
+ "devDependencies": false,
189
+ "optionalDependencies": false
190
+ }],
191
+ "import/no-mutable-exports": 2,
192
+ "import/no-commonjs": 0,
193
+ "import/no-amd": 2,
194
+ "import/no-nodejs-modules": 0,
195
+ "import/imports-first": [2, "absolute-first"],
196
+ "import/no-duplicates": 2,
197
+ "import/no-namespace": 0,
198
+ "import/extensions": [0, "never"],
199
+ "import/order": [0, {
200
+ "groups": ["builtin", "external", "internal", "parent", "sibling", "index"],
201
+ "newlines-between": "never"
202
+ }],
203
+ "import/newline-after-import": 2,
204
+ "import/prefer-default-export": 2,
205
+ "array-bracket-spacing": [2, "never"],
206
+ "block-spacing": [2, "always"],
207
+ "brace-style": [2, "1tbs", {
208
+ "allowSingleLine": true
209
+ }],
210
+ "camelcase": [2, {
211
+ "properties": "always"
212
+ }],
213
+ "comma-spacing": [2, {
214
+ "before": false,
215
+ "after": true
216
+ }],
217
+ "comma-style": [2, "last"],
218
+ "computed-property-spacing": [2, "never"],
219
+ "consistent-this": [2, "self"],
220
+ "eol-last": 2,
221
+ "func-names": 0,
222
+ "func-style": [2, "declaration"],
223
+ "id-blacklist": 0,
224
+ "id-length": 0,
225
+ "id-match": 0,
226
+ "indent": [2, 2],
227
+ "key-spacing": [2, {
228
+ "beforeColon": false,
229
+ "afterColon": true
230
+ }],
231
+ "keyword-spacing": [2, {
232
+ "before": true,
233
+ "after": true,
234
+ "overrides": {
235
+ "return": {
236
+ "after": true
237
+ },
238
+ "throw": {
239
+ "after": true
240
+ },
241
+ "case": {
242
+ "after": true
243
+ }
244
+ }
245
+ }],
246
+ "linebreak-style": [2, "unix"],
247
+ "lines-around-comment": 0,
248
+ "max-depth": [2, 4],
249
+ "max-len": [2, 120, {
250
+ "ignorePattern": "^\\s.+class=\""
251
+ }],
252
+ "max-nested-callbacks": [2, 4],
253
+ "max-params": [1, 4],
254
+ "max-statements": [1, 10],
255
+ "max-statements-per-line": [2, {
256
+ "max": 1
257
+ }],
258
+ "new-cap": [2, {
259
+ "newIsCap": true
260
+ }],
261
+ "new-parens": 2,
262
+ "newline-after-var": 0,
263
+ "newline-before-return": 2,
264
+ "newline-per-chained-call": [2, {
265
+ "ignoreChainWithDepth": 3
266
+ }],
267
+ "no-array-constructor": 2,
268
+ "no-bitwise": 1,
269
+ "no-continue": 0,
270
+ "no-inline-comments": 0,
271
+ "no-lonely-if": 0,
272
+ "no-mixed-spaces-and-tabs": 2,
273
+ "no-multiple-empty-lines": [2, {
274
+ "max": 1,
275
+ "maxEOF": 1
276
+ }],
277
+ "no-negated-condition": 2,
278
+ "no-nested-ternary": 2,
279
+ "no-new-object": 2,
280
+ "no-plusplus": 0,
281
+ "no-restricted-syntax": [2, "DebuggerStatement", "ForInStatement", "LabeledStatement", "WithStatement"],
282
+ "no-spaced-func": 2,
283
+ "no-ternary": 0,
284
+ "no-trailing-spaces": 2,
285
+ "no-underscore-dangle": [1],
286
+ "no-unneeded-ternary": [2, {
287
+ "defaultAssignment": false
288
+ }],
289
+ "no-whitespace-before-property": 2,
290
+ "object-curly-spacing": [2, "always"],
291
+ "object-property-newline": [0, {
292
+ "allowMultiplePropertiesPerLine": true
293
+ }],
294
+ "one-var": [2, "never"],
295
+ "one-var-declaration-per-line": [2, "always"],
296
+ "operator-assignment": 2,
297
+ "operator-linebreak": [2, "after"],
298
+ "padded-blocks": [2, "never"],
299
+ "quote-props": [2, "as-needed", {
300
+ "keywords": false,
301
+ "unnecessary": false,
302
+ "numbers": false
303
+ }],
304
+ "quotes": [2, "single", {
305
+ "avoidEscape": true
306
+ }],
307
+ "require-jsdoc": 0,
308
+ "semi": [2, "always"],
309
+ "semi-spacing": [2, {
310
+ "before": false,
311
+ "after": true
312
+ }],
313
+ "sort-vars": 0,
314
+ "space-before-blocks": 2,
315
+ "space-before-function-paren": [2, {
316
+ "anonymous": "always",
317
+ "named": "never"
318
+ }],
319
+ "space-in-parens": [2, "never"],
320
+ "space-infix-ops": 2,
321
+ "space-unary-ops": 0,
322
+ "spaced-comment": [2],
323
+ "wrap-regex": 0,
324
+ "init-declarations": 0,
325
+ "no-catch-shadow": 2,
326
+ "no-delete-var": 0,
327
+ "no-label-var": 2,
328
+ "no-restricted-globals": 0,
329
+ "no-shadow": 2,
330
+ "no-shadow-restricted-names": 2,
331
+ "no-undef": 2,
332
+ "no-undef-init": 2,
333
+ "no-unused-vars": [2, {
334
+ "vars": "local",
335
+ "args": "after-used"
336
+ }],
337
+ "no-use-before-define": 2,
338
+ "vue/max-len": ["error", {
339
+ "code": 120,
340
+ "ignoreHTMLAttributeValues": true
341
+ }]
342
+ },
343
+ "overrides": [
344
+ {
345
+ "files": ["**/*.js"],
346
+ "excludedFiles": "app/**/*.js",
347
+ "env": {
348
+ "node": true
349
+ }
350
+ }
351
+ ]
352
+ }
@@ -0,0 +1,9 @@
1
+ ### Contexto
2
+
3
+ ### Qué se esta haciendo
4
+
5
+ #### En particular hay que revisar
6
+
7
+
8
+ -----------
9
+ #### Info Adicional (pantallazos, links, fuentes, etc.)
@@ -8,5 +8,5 @@ end
8
8
  if defined?(Rails)
9
9
  require 'rails/console/app'
10
10
  require 'rails/console/helpers'
11
- include Rails::ConsoleMethods
11
+ include Rails::ConsoleMethods # rubocop:disable Style/MixinUsage
12
12
  end
@@ -0,0 +1,515 @@
1
+ require:
2
+ - rubocop-rspec
3
+ - rubocop-rails
4
+ - rubocop-performance
5
+ AllCops:
6
+ Exclude:
7
+ - "vendor/**/*"
8
+ - "db/**/*"
9
+ - "bin/**/*"
10
+ TargetRubyVersion: 2.7
11
+ Rails:
12
+ Enabled: true
13
+ Performance:
14
+ Enabled: true
15
+ Layout/ParameterAlignment:
16
+ Description: Align the parameters of a method call if they span more than one line.
17
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-double-indent
18
+ Enabled: true
19
+ EnforcedStyle: with_fixed_indentation
20
+ SupportedStyles:
21
+ - with_first_parameter
22
+ - with_fixed_indentation
23
+ Metrics/BlockLength:
24
+ Enabled: false
25
+ Style/ClassAndModuleChildren:
26
+ Description: Checks style of children classes and modules.
27
+ Enabled: false
28
+ EnforcedStyle: nested
29
+ SupportedStyles:
30
+ - nested
31
+ - compact
32
+ Style/CommentAnnotation:
33
+ Description: Checks formatting of special comments (TODO, FIXME, OPTIMIZE, HACK,
34
+ REVIEW).
35
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#annotate-keywords
36
+ Enabled: false
37
+ Keywords:
38
+ - TODO
39
+ - FIXME
40
+ - OPTIMIZE
41
+ - HACK
42
+ - REVIEW
43
+ Naming/FileName:
44
+ Description: Use snake_case for source file names.
45
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
46
+ Enabled: false
47
+ Exclude: []
48
+ Style/FormatString:
49
+ Description: Enforce the use of Kernel#sprintf, Kernel#format or String#%.
50
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#sprintf
51
+ Enabled: false
52
+ EnforcedStyle: format
53
+ SupportedStyles:
54
+ - format
55
+ - sprintf
56
+ - percent
57
+ Style/FrozenStringLiteralComment:
58
+ Enabled: false
59
+ Style/GlobalVars:
60
+ Description: Do not introduce global variables.
61
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#instance-vars
62
+ Enabled: false
63
+ AllowedVariables: []
64
+ Style/GuardClause:
65
+ Description: Check for conditionals that can be replaced with guard clauses
66
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
67
+ Enabled: false
68
+ MinBodyLength: 1
69
+ Style/IfUnlessModifier:
70
+ Description: Favor modifier if/unless usage when you have a single-line body.
71
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
72
+ Enabled: false
73
+ Style/LambdaCall:
74
+ Description: Use lambda.call(...) instead of lambda.(...).
75
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc-call
76
+ Enabled: false
77
+ EnforcedStyle: call
78
+ SupportedStyles:
79
+ - call
80
+ - braces
81
+ Style/Next:
82
+ Description: Use `next` to skip iteration instead of a condition at the end.
83
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
84
+ Enabled: false
85
+ EnforcedStyle: skip_modifier_ifs
86
+ MinBodyLength: 3
87
+ SupportedStyles:
88
+ - skip_modifier_ifs
89
+ - always
90
+ Layout/MultilineOperationIndentation:
91
+ Description: Checks indentation of binary operations that span more than one line.
92
+ Enabled: true
93
+ EnforcedStyle: indented
94
+ SupportedStyles:
95
+ - aligned
96
+ - indented
97
+ Style/MutableConstant:
98
+ Description: Do not assign mutable objects to constants.
99
+ Enabled: false
100
+ Style/NumericLiterals:
101
+ Description: Add underscores to large numeric literals to improve their readability.
102
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics
103
+ Enabled: false
104
+ MinDigits: 5
105
+ Style/PercentLiteralDelimiters:
106
+ Description: Use `%`-literal delimiters consistently
107
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
108
+ Enabled: false
109
+ PreferredDelimiters:
110
+ "%": "()"
111
+ "%i": "()"
112
+ "%q": "()"
113
+ "%Q": "()"
114
+ "%r": "{}"
115
+ "%s": "()"
116
+ "%w": "()"
117
+ "%W": "()"
118
+ "%x": "()"
119
+ Naming/PredicateName:
120
+ Description: Check the names of predicate methods.
121
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
122
+ Enabled: true
123
+ NamePrefix:
124
+ - is_
125
+ - has_
126
+ - have_
127
+ ForbiddenPrefixes:
128
+ - is_
129
+ Style/RaiseArgs:
130
+ Description: Checks the arguments passed to raise/fail.
131
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
132
+ Enabled: false
133
+ EnforcedStyle: exploded
134
+ SupportedStyles:
135
+ - compact
136
+ - exploded
137
+ Style/SignalException:
138
+ Description: Checks for proper usage of fail and raise.
139
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
140
+ Enabled: false
141
+ EnforcedStyle: semantic
142
+ SupportedStyles:
143
+ - only_raise
144
+ - only_fail
145
+ - semantic
146
+ Style/SingleLineMethods:
147
+ Description: Avoid single-line methods.
148
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
149
+ Enabled: false
150
+ AllowIfMethodIsEmpty: true
151
+ Style/StringLiterals:
152
+ Description: Checks if uses of quotes match the configured preference.
153
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
154
+ Enabled: false
155
+ EnforcedStyle: double_quotes
156
+ SupportedStyles:
157
+ - single_quotes
158
+ - double_quotes
159
+ Style/TrailingCommaInArguments:
160
+ Description: Checks for trailing comma in argument lists.
161
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
162
+ Enabled: true
163
+ Style/TrailingCommaInArrayLiteral:
164
+ Description: Checks for trailing comma in array and hash literals.
165
+ StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-trailing-array-commas
166
+ Enabled: true
167
+ Style/TrailingCommaInHashLiteral:
168
+ Description: Checks for trailing comma in array and hash literals.
169
+ StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-trailing-array-commas
170
+ Enabled: true
171
+ Style/TrivialAccessors:
172
+ Description: Prefer attr_* methods to trivial readers/writers.
173
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr_family
174
+ Enabled: false
175
+ ExactNameMatch: false
176
+ AllowPredicates: false
177
+ AllowDSLWriters: false
178
+ AllowedMethods:
179
+ - to_ary
180
+ - to_a
181
+ - to_c
182
+ - to_enum
183
+ - to_h
184
+ - to_hash
185
+ - to_i
186
+ - to_int
187
+ - to_io
188
+ - to_open
189
+ - to_path
190
+ - to_proc
191
+ - to_r
192
+ - to_regexp
193
+ - to_str
194
+ - to_s
195
+ - to_sym
196
+ Style/WhileUntilModifier:
197
+ Description: Favor modifier while/until usage when you have a single-line body.
198
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier
199
+ Enabled: false
200
+ Style/WordArray:
201
+ Description: Use %w or %W for arrays of words.
202
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-w
203
+ Enabled: false
204
+ MinSize: 0
205
+ WordRegex: !ruby/regexp /\A[\p{Word}]+\z/
206
+ Style/ExponentialNotation:
207
+ Enabled: true
208
+ Style/HashEachMethods:
209
+ Description: Use Hash#each_key and Hash#each_value.
210
+ Enabled: true
211
+ Style/HashTransformKeys:
212
+ Description: Prefer `transform_keys` over `each_with_object` and `map`.
213
+ Enabled: true
214
+ Style/HashTransformValues:
215
+ Description: Prefer `transform_values` over `each_with_object` and `map`.
216
+ Enabled: true
217
+ Metrics/AbcSize:
218
+ Description: A calculated magnitude based on number of assignments, branches, and
219
+ conditions.
220
+ Enabled: true
221
+ Max: 25
222
+ Metrics/BlockNesting:
223
+ Description: Avoid excessive block nesting
224
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count
225
+ Enabled: true
226
+ Max: 3
227
+ Metrics/ClassLength:
228
+ Description: Avoid classes longer than 100 lines of code.
229
+ Enabled: false
230
+ CountComments: false
231
+ Max: 100
232
+ Metrics/MethodLength:
233
+ Description: Avoid methods longer than 15 lines of code.
234
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
235
+ Enabled: true
236
+ CountComments: true
237
+ Max: 15
238
+ Exclude:
239
+ - "spec/**/*"
240
+ Metrics/ParameterLists:
241
+ Description: Avoid long parameter lists.
242
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
243
+ Enabled: false
244
+ Max: 5
245
+ CountKeywordArgs: true
246
+ Lint/AssignmentInCondition:
247
+ Description: Don't use assignment in conditions.
248
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
249
+ Enabled: false
250
+ AllowSafeAssignment: true
251
+ Layout/LineLength:
252
+ Description: Limit lines to 100 characters.
253
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#100-character-limits
254
+ Enabled: true
255
+ Max: 100
256
+ AllowURI: true
257
+ URISchemes:
258
+ - http
259
+ - https
260
+ Layout/EndAlignment:
261
+ Description: Align ends correctly.
262
+ Enabled: true
263
+ EnforcedStyleAlignWith: keyword
264
+ SupportedStylesAlignWith:
265
+ - keyword
266
+ - variable
267
+ Layout/DefEndAlignment:
268
+ Description: Align ends corresponding to defs correctly.
269
+ Enabled: true
270
+ EnforcedStyleAlignWith: start_of_line
271
+ SupportedStylesAlignWith:
272
+ - start_of_line
273
+ - def
274
+ Layout/SpaceAroundMethodCallOperator:
275
+ Description: Checks method call operators to not have spaces around them.
276
+ Enabled: true
277
+ Style/SymbolArray:
278
+ Description: Use %i or %I for arrays of symbols.
279
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-i
280
+ Enabled: false
281
+ Layout/ExtraSpacing:
282
+ Description: Do not use unnecessary spacing.
283
+ Enabled: false
284
+ Naming/AccessorMethodName:
285
+ Description: Check the naming of accessor methods for get_/set_.
286
+ Enabled: false
287
+ Style/Alias:
288
+ Description: Use alias_method instead of alias.
289
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
290
+ Enabled: false
291
+ Style/ArrayJoin:
292
+ Description: Use Array#join instead of Array#*.
293
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#array-join
294
+ Enabled: false
295
+ Style/AsciiComments:
296
+ Description: Use only ascii symbols in comments.
297
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-comments
298
+ Enabled: false
299
+ Naming/AsciiIdentifiers:
300
+ Description: Use only ascii symbols in identifiers.
301
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-identifiers
302
+ Enabled: false
303
+ Style/Attr:
304
+ Description: Checks for uses of Module#attr.
305
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr
306
+ Enabled: false
307
+ Style/BlockComments:
308
+ Description: Do not use block comments.
309
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-block-comments
310
+ Enabled: false
311
+ Style/CaseEquality:
312
+ Description: Avoid explicit use of the case equality operator(===).
313
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-case-equality
314
+ Enabled: false
315
+ Style/CharacterLiteral:
316
+ Description: Checks for uses of character literals.
317
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-character-literals
318
+ Enabled: false
319
+ Style/ClassVars:
320
+ Description: Avoid the use of class variables.
321
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-class-vars
322
+ Enabled: false
323
+ Style/ColonMethodCall:
324
+ Description: 'Do not use :: for method call.'
325
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#double-colons
326
+ Enabled: false
327
+ Style/PreferredHashMethods:
328
+ Description: Checks for use of deprecated Hash methods.
329
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-key
330
+ Enabled: false
331
+ Style/Documentation:
332
+ Description: Document classes and non-namespace modules.
333
+ Enabled: false
334
+ Style/DoubleNegation:
335
+ Description: Checks for uses of double negation (!!).
336
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
337
+ Enabled: false
338
+ Style/EachWithObject:
339
+ Description: Prefer `each_with_object` over `inject` or `reduce`.
340
+ Enabled: false
341
+ Style/EmptyElse:
342
+ Description: Avoid empty else-clauses.
343
+ Enabled: true
344
+ Style/EmptyLiteral:
345
+ Description: Prefer literals to Array.new/Hash.new/String.new.
346
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
347
+ Enabled: false
348
+ Layout/EndOfLine:
349
+ Description: Use Unix-style line endings.
350
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#crlf
351
+ Enabled: true
352
+ Style/EvenOdd:
353
+ Description: Favor the use of Fixnum#even? && Fixnum#odd?
354
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
355
+ Enabled: false
356
+ Lint/FlipFlop:
357
+ Description: Checks for flip flops
358
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-flip-flops
359
+ Enabled: false
360
+ Style/IfWithSemicolon:
361
+ Description: Do not use if x; .... Use the ternary operator instead.
362
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs
363
+ Enabled: false
364
+ Style/Lambda:
365
+ Description: Use the new lambda literal syntax for single-line blocks.
366
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#lambda-multi-line
367
+ Enabled: false
368
+ Style/LineEndConcatenation:
369
+ Description: Use \ instead of + or << to concatenate two string literals at line
370
+ end.
371
+ Enabled: false
372
+ Style/ModuleFunction:
373
+ Description: Checks for usage of `extend self` in modules.
374
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
375
+ Enabled: false
376
+ Style/MultilineBlockChain:
377
+ Description: Avoid multi-line chains of blocks.
378
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
379
+ Enabled: false
380
+ Layout/MultilineBlockLayout:
381
+ Description: Ensures newlines after multiline block do statements.
382
+ Enabled: false
383
+ Style/NegatedIf:
384
+ Description: Favor unless over if for negative conditions (or control flow or).
385
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#unless-for-negatives
386
+ Enabled: false
387
+ Style/NegatedWhile:
388
+ Description: Favor until over while for negative conditions.
389
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#until-for-negatives
390
+ Enabled: false
391
+ Style/NilComparison:
392
+ Description: Prefer x.nil? to x == nil.
393
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
394
+ Enabled: false
395
+ Style/OneLineConditional:
396
+ Description: Favor the ternary operator(?:) over if/then/else/end constructs.
397
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
398
+ Enabled: false
399
+ Naming/BinaryOperatorParameterName:
400
+ Description: When defining binary operators, name the argument other.
401
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#other-arg
402
+ Enabled: false
403
+ Style/PerlBackrefs:
404
+ Description: Avoid Perl-style regex back references.
405
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
406
+ Enabled: false
407
+ Style/Proc:
408
+ Description: Use proc instead of Proc.new.
409
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc
410
+ Enabled: false
411
+ Style/SelfAssignment:
412
+ Description: Checks for places where self-assignment shorthand should have been
413
+ used.
414
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#self-assignment
415
+ Enabled: false
416
+ Layout/SpaceBeforeFirstArg:
417
+ Description: Put a space between a method name and the first argument in a method
418
+ call without parentheses.
419
+ Enabled: true
420
+ Layout/SpaceAroundOperators:
421
+ Description: Use spaces around operators.
422
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
423
+ Enabled: true
424
+ Layout/SpaceInsideParens:
425
+ Description: No spaces after ( or before ).
426
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
427
+ Enabled: true
428
+ Style/SpecialGlobalVars:
429
+ Description: Avoid Perl-style global variables.
430
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
431
+ Enabled: false
432
+ Style/VariableInterpolation:
433
+ Description: Don't interpolate global, instance and class variables directly in
434
+ strings.
435
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
436
+ Enabled: false
437
+ Style/WhenThen:
438
+ Description: Use when x then ... for one-line cases.
439
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
440
+ Enabled: false
441
+ Lint/AmbiguousOperator:
442
+ Description: Checks for ambiguous operators in the first argument of a method invocation
443
+ without parentheses.
444
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-as-args
445
+ Enabled: false
446
+ Lint/AmbiguousRegexpLiteral:
447
+ Description: Checks for ambiguous regexp literals in the first argument of a method
448
+ invocation without parenthesis.
449
+ Enabled: false
450
+ Layout/BlockAlignment:
451
+ Description: Align block ends correctly.
452
+ Enabled: true
453
+ Layout/ConditionPosition:
454
+ Description: Checks for condition placed in a confusing position relative to the
455
+ keyword.
456
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#same-line-condition
457
+ Enabled: false
458
+ Lint/DeprecatedClassMethods:
459
+ Description: Check for deprecated class method calls.
460
+ Enabled: false
461
+ Lint/ElseLayout:
462
+ Description: Check for odd code arrangement in an else block.
463
+ Enabled: false
464
+ Lint/SuppressedException:
465
+ Description: Don't suppress exception.
466
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
467
+ Enabled: false
468
+ Lint/LiteralAsCondition:
469
+ Description: Checks of literals used in conditions.
470
+ Enabled: false
471
+ Lint/LiteralInInterpolation:
472
+ Description: Checks for literals used in interpolation.
473
+ Enabled: false
474
+ Lint/Loop:
475
+ Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while
476
+ for post-loop tests.
477
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#loop-with-break
478
+ Enabled: false
479
+ Lint/ParenthesesAsGroupedExpression:
480
+ Description: Checks for method calls with a space before the opening parenthesis.
481
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
482
+ Enabled: false
483
+ Lint/RequireParentheses:
484
+ Description: Use parentheses in the method call to avoid confusion about precedence.
485
+ Enabled: false
486
+ Lint/UnderscorePrefixedVariableName:
487
+ Description: Do not use prefix `_` for a variable that is used.
488
+ Enabled: false
489
+ Lint/Void:
490
+ Description: Possible use of operator/literal/variable in void context.
491
+ Enabled: false
492
+ Lint/RaiseException:
493
+ Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
494
+ Enabled: true
495
+ Lint/StructNewOverride:
496
+ Description: Disallow overriding the `Struct` built-in methods via `Struct.new`.
497
+ Enabled: true
498
+ Rails/Delegate:
499
+ Description: Prefer delegate method for delegations.
500
+ Enabled: false
501
+ Performance/RedundantBlockCall:
502
+ Description: Use `yield` instead of `block.call`.
503
+ Reference: https://github.com/JuanitoFatas/fast-ruby#proccall-vs-yield-code
504
+ Enabled: false
505
+ RSpec/MultipleExpectations:
506
+ Max: 5
507
+ RSpec/NestedGroups:
508
+ Max: 5
509
+ RSpec/ExampleLength:
510
+ Max: 10
511
+ RSpec/LetSetup:
512
+ Enabled: false
513
+ RSpec/ExpectChange:
514
+ Enabled: true
515
+ EnforcedStyle: block