potassium 5.2.2 → 6.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +103 -28
  3. data/.circleci/setup-rubygems.sh +3 -0
  4. data/.gitignore +2 -1
  5. data/.node-version +1 -0
  6. data/.rubocop.yml +530 -0
  7. data/.ruby-version +1 -1
  8. data/CHANGELOG.md +92 -1
  9. data/README.md +51 -45
  10. data/docs/DSL.md +5 -5
  11. data/lib/potassium/assets/.circleci/config.yml.erb +151 -0
  12. data/lib/potassium/assets/.eslintrc.json +352 -0
  13. data/lib/potassium/assets/.github/pull_request_template.md +9 -0
  14. data/lib/potassium/assets/.rubocop.yml +528 -0
  15. data/lib/potassium/assets/.stylelintrc.json +46 -0
  16. data/lib/potassium/assets/Makefile.erb +21 -32
  17. data/lib/potassium/assets/README.yml +59 -15
  18. data/lib/potassium/assets/active_admin/admin-component.vue +35 -0
  19. data/lib/potassium/assets/active_admin/admin_application.js +14 -0
  20. data/lib/potassium/assets/active_admin/init_activeadmin_vue.rb +10 -0
  21. data/lib/potassium/assets/app/graphql/graphql_controller.rb +55 -0
  22. data/lib/potassium/assets/app/graphql/mutations/login_mutation.rb +23 -0
  23. data/lib/potassium/assets/app/graphql/queries/base_query.rb +4 -0
  24. data/lib/potassium/assets/app/graphql/types/base/base_argument.rb +4 -0
  25. data/lib/potassium/assets/app/graphql/types/base/base_enum.rb +4 -0
  26. data/lib/potassium/assets/app/graphql/types/base/base_field.rb +5 -0
  27. data/lib/potassium/assets/app/graphql/types/base/base_input_object.rb +5 -0
  28. data/lib/potassium/assets/app/graphql/types/base/base_interface.rb +7 -0
  29. data/lib/potassium/assets/app/graphql/types/base/base_object.rb +5 -0
  30. data/lib/potassium/assets/app/graphql/types/base/base_scalar.rb +4 -0
  31. data/lib/potassium/assets/app/graphql/types/base/base_union.rb +4 -0
  32. data/lib/potassium/assets/app/graphql/types/mutation_type.rb +10 -0
  33. data/lib/potassium/assets/app/graphql/types/query_type.rb +13 -0
  34. data/lib/potassium/assets/app/javascript/app.spec.js +14 -0
  35. data/lib/potassium/assets/app/uploaders/base_uploader.rb +11 -0
  36. data/lib/potassium/assets/app/uploaders/image_uploader.rb +5 -0
  37. data/lib/potassium/assets/app/views/shared/_gtm_body.html.erb +4 -0
  38. data/lib/potassium/assets/app/views/shared/_gtm_head.html.erb +7 -0
  39. data/lib/potassium/assets/bin/release +1 -1
  40. data/lib/potassium/assets/bin/setup.erb +1 -1
  41. data/lib/potassium/assets/config/database_mysql.yml.erb +2 -2
  42. data/lib/potassium/assets/config/database_postgresql.yml.erb +2 -2
  43. data/lib/potassium/assets/config/graphql_playground.rb +20 -0
  44. data/lib/potassium/assets/config/puma.rb +1 -1
  45. data/lib/potassium/assets/config/shrine.rb +36 -0
  46. data/lib/potassium/assets/lib/tasks/auto_annotate_models.rake +2 -1
  47. data/lib/potassium/assets/package.json +4 -1
  48. data/lib/potassium/assets/redis.yml +1 -2
  49. data/lib/potassium/assets/testing/rails_helper.rb +2 -0
  50. data/lib/potassium/cli/commands/create.rb +12 -19
  51. data/lib/potassium/cli_options.rb +77 -26
  52. data/lib/potassium/helpers/gem-helpers.rb +1 -1
  53. data/lib/potassium/helpers/template-helpers.rb +8 -0
  54. data/lib/potassium/newest_version_ensurer.rb +19 -36
  55. data/lib/potassium/node_version_ensurer.rb +30 -0
  56. data/lib/potassium/recipes/admin.rb +3 -3
  57. data/lib/potassium/recipes/annotate.rb +1 -1
  58. data/lib/potassium/recipes/api.rb +93 -21
  59. data/lib/potassium/recipes/background_processor.rb +66 -19
  60. data/lib/potassium/recipes/ci.rb +10 -38
  61. data/lib/potassium/recipes/data_migrate.rb +44 -0
  62. data/lib/potassium/recipes/database.rb +4 -0
  63. data/lib/potassium/recipes/database_container.rb +7 -5
  64. data/lib/potassium/recipes/draper.rb +1 -10
  65. data/lib/potassium/recipes/file_storage.rb +66 -0
  66. data/lib/potassium/recipes/front_end.rb +225 -9
  67. data/lib/potassium/recipes/github.rb +93 -15
  68. data/lib/potassium/recipes/google_tag_manager.rb +90 -0
  69. data/lib/potassium/recipes/heroku.rb +42 -29
  70. data/lib/potassium/recipes/mailer.rb +18 -2
  71. data/lib/potassium/recipes/monitoring.rb +5 -0
  72. data/lib/potassium/recipes/node.rb +21 -0
  73. data/lib/potassium/recipes/rack_cors.rb +18 -15
  74. data/lib/potassium/recipes/schedule.rb +17 -2
  75. data/lib/potassium/recipes/style.rb +21 -3
  76. data/lib/potassium/recipes/vue_admin.rb +124 -0
  77. data/lib/potassium/templates/application.rb +10 -7
  78. data/lib/potassium/version.rb +7 -4
  79. data/potassium.gemspec +11 -6
  80. data/spec/features/api_spec.rb +25 -0
  81. data/spec/features/background_processor_spec.rb +19 -6
  82. data/spec/features/ci_spec.rb +7 -4
  83. data/spec/features/data_migrate_spec.rb +14 -0
  84. data/spec/features/database_container_spec.rb +1 -5
  85. data/spec/features/draper_spec.rb +1 -6
  86. data/spec/features/file_storage_spec.rb +75 -0
  87. data/spec/features/front_end_spec.rb +102 -0
  88. data/spec/features/github_spec.rb +53 -8
  89. data/spec/features/google_tag_manager_spec.rb +59 -0
  90. data/spec/features/graphql_spec.rb +71 -0
  91. data/spec/features/heroku_spec.rb +1 -1
  92. data/spec/features/mailer_spec.rb +16 -0
  93. data/spec/features/new_project_spec.rb +6 -14
  94. data/spec/features/node_spec.rb +28 -0
  95. data/spec/features/power_types_spec.rb +5 -16
  96. data/spec/features/schedule_spec.rb +11 -4
  97. data/spec/features/vue_admin_spec.rb +47 -0
  98. data/spec/spec_helper.rb +5 -0
  99. data/spec/support/fake_octokit.rb +31 -0
  100. data/spec/support/potassium_test_helpers.rb +26 -9
  101. data/tmp/.keep +0 -0
  102. metadata +152 -46
  103. data/lib/potassium/assets/.circleci/config.yml +0 -20
  104. data/lib/potassium/assets/Dockerfile.ci +0 -6
  105. data/lib/potassium/assets/active_admin/active_admin.js.coffee +0 -4
  106. data/lib/potassium/assets/active_admin/init_activeadmin_angular.rb +0 -8
  107. data/lib/potassium/assets/api/api_error_concern.rb +0 -32
  108. data/lib/potassium/assets/api/base_controller.rb +0 -9
  109. data/lib/potassium/assets/api/draper_responder.rb +0 -62
  110. data/lib/potassium/assets/api/responder.rb +0 -41
  111. data/lib/potassium/assets/aws.rb +0 -1
  112. data/lib/potassium/assets/bin/cibuild.erb +0 -100
  113. data/lib/potassium/assets/docker-compose.ci.yml +0 -11
  114. data/lib/potassium/assets/sidekiq_scheduler.yml +0 -9
  115. data/lib/potassium/assets/testing/paperclip.rb +0 -59
  116. data/lib/potassium/recipes/active_storage.rb +0 -40
  117. data/lib/potassium/recipes/angular_admin.rb +0 -56
  118. data/lib/potassium/recipes/aws_sdk.rb +0 -7
  119. data/lib/potassium/recipes/paperclip.rb +0 -47
  120. data/spec/features/active_storage_spec.rb +0 -30
  121. data/spec/features/front_end.rb +0 -30
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28763549d04fed43f8cbe7206b9ca47dc79b1d631b1fd338a638ca59e18ec70c
4
- data.tar.gz: f70e44992829f10fa2e5dff986fc6e56d293ab13b5210575b4da8be95784174b
3
+ metadata.gz: f6e930d3ad3b2989b3fd4e3675da60f6dec57089d0eba9eabe4d1bccbcae68de
4
+ data.tar.gz: 50ca1761257ba7f22d0724a3f1996a703d39dfefab842d4198cc99f7392741d0
5
5
  SHA512:
6
- metadata.gz: 2714545c45a60fc3981ecb0237f5bbe3ac00f0da0c4384ff8a8f2ee01b37d449008804a196d08b1642c4f931c85f12b8e0b92476cf8bb269fa89c39b18c521ae
7
- data.tar.gz: c113ea96c6e0be9a328d92f55a52f90e65d0ced49a621211e5f055a015804a972d8163d713d2c451e42be15ef86626951e300de6e4c3fa9c1fd3d4d10e4ff31b
6
+ metadata.gz: 7044e4cfce08ab3cca65a7dbc30ec8be951ab478f368067955a8435bac40fe4c769f0a8b2b38828ab93614c0eeac8fe67d68c1f59ae3d8317b424c848e639c33
7
+ data.tar.gz: c699ee1eedb6b15512acbbdb6b53bab2e98b65e7aab413d398d47042e58e1c16ee8b786394674d6b07ba93f248a51f4da7bf366eaf184d0a13e4527d99647fe5
data/.circleci/config.yml CHANGED
@@ -1,32 +1,107 @@
1
- version: 2
2
- jobs:
3
- build:
4
- working_directory: ~/app
5
- parallelism: 4
6
- shell: /bin/bash --login
1
+ version: 2.1
2
+
3
+ ruby-image: &ruby-image circleci/ruby:2.7.0-node
4
+ env-vars: &env-vars
5
+ BUNDLE_JOBS: 4
6
+ RAILS_ENV: test
7
+ RAKE_ENV: test
8
+ BUNDLE_PATH: /home/circleci/project/vendor/bundle
9
+ GEM_PATH: /home/circleci/project/vendor/bundle/ruby/2.7.0
7
10
 
11
+ executors:
12
+ ruby-executor:
8
13
  docker:
9
- - image: circleci/build-image:ubuntu-14.04-XXL-upstart-1189-5614f37
10
- command: /sbin/init
14
+ - image: *ruby-image
15
+ environment: *env-vars
16
+
17
+ commands:
18
+ setup:
19
+ description: checkout code, restore cache, install dependencies, save cache
20
+ steps:
21
+ - checkout
22
+
23
+ - restore_cache:
24
+ keys:
25
+ - potassium-vendor-bundle-{{ .Branch }}
26
+ - potassium-vendor-bundle-master
27
+ - potassium-vendor-bundle
28
+
29
+ - run:
30
+ name: Install bundle dependencies
31
+ command: |
32
+ gem install bundler:2.1.4
33
+ bundle _2.1.4_ install
34
+
35
+ - save_cache:
36
+ key: potassium-vendor-bundle-{{ .Branch }}
37
+ paths:
38
+ - vendor/bundle
39
+
40
+ jobs:
41
+ test:
42
+ parallelism: 6
43
+ executor: ruby-executor
44
+ steps:
45
+ - setup
11
46
 
47
+ - run:
48
+ name: Run rspec
49
+ command: |
50
+ RSPEC_JUNIT_ARGS="-r rspec_junit_formatter -f RspecJunitFormatter -o test_results/rspec.xml"
51
+ RSPEC_GENERAL_ARGS="-f progress --no-color -p 10"
52
+ SPLIT_ARGS="$(circleci tests glob spec/**/*_spec.rb | circleci tests split --split-by=timings)"
53
+ bundle exec rspec $RSPEC_GENERAL_ARGS $RSPEC_JUNIT_ARGS $SPLIT_ARGS
54
+
55
+ - store_test_results:
56
+ path: test_results
57
+
58
+ lint:
59
+ executor: ruby-executor
60
+ steps:
61
+ - setup
62
+
63
+ - run:
64
+ name: Install reviewdog
65
+ command: |
66
+ curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b ./bin
67
+
68
+ - run:
69
+ name: Get files to lint
70
+ command: git diff origin/master --name-only --diff-filter=d > tmp/files_to_lint
71
+
72
+ - run:
73
+ name: Run rubocop
74
+ shell: /bin/bash
75
+ command: |
76
+ cat tmp/files_to_lint | grep -E '.+\.(rb)$' | xargs bundle exec rubocop --force-exclusion \
77
+ | ./bin/reviewdog -reporter=github-pr-review -f=rubocop
78
+
79
+ deploy:
80
+ executor: ruby-executor
12
81
  steps:
13
- - checkout
14
- - run: rm -f app/.rvmrc; echo 2.5.1 > app/.ruby-version; rvm use 2.5.1 --default
15
- - run: 'sudo docker info >/dev/null 2>&1 || sudo service docker start; '
16
- - run: echo 'export rvm_install_on_use_flag=0' >> /home/ubuntu/.rvmrc
17
-
18
- - restore_cache:
19
- keys:
20
- - v1-dep-{{ .Branch }}-
21
- - v1-dep-master-
22
- - run: bundle install
23
- - run: gem install hound-cli
24
- - save_cache:
25
- key: v1-dep-{{ .Branch }}-{{ epoch }}
26
- paths:
27
- - vendor/bundle
28
- - run:
29
- command: bundle exec rspec --color --require spec_helper --format=doc --format progress $(circleci tests glob spec/**/*_spec.rb | circleci tests split)
30
- environment:
31
- RAILS_ENV: test
32
- RACK_ENV: test
82
+ - setup
83
+
84
+ - run:
85
+ name: Setup rubygems
86
+ command: bash .circleci/setup-rubygems.sh
87
+
88
+ - run:
89
+ name: Publish to rubygems
90
+ command: |
91
+ gem build potassium.gemspec
92
+ version_tag=$(git describe --tags)
93
+ gem push potassium-${version_tag#v}.gem
94
+
95
+ workflows:
96
+ test_and_lint:
97
+ jobs:
98
+ - test
99
+ - lint:
100
+ context: org-global
101
+ - deploy:
102
+ context: org-global
103
+ filters:
104
+ tags:
105
+ only: /.*/
106
+ branches:
107
+ ignore: /.*/
@@ -0,0 +1,3 @@
1
+ mkdir ~/.gem
2
+ echo -e "---\r\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials
3
+ chmod 0600 /home/circleci/.gem/credentials
data/.gitignore CHANGED
@@ -6,7 +6,8 @@
6
6
  /doc/
7
7
  /pkg/
8
8
  /spec/reports/
9
- /tmp/
9
+ /tmp/*
10
+ !/tmp/.keep
10
11
  *.bundle
11
12
  *.so
12
13
  *.o
data/.node-version ADDED
@@ -0,0 +1 @@
1
+ 12
data/.rubocop.yml ADDED
@@ -0,0 +1,530 @@
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
+ Style/OptionalBooleanParameter:
506
+ Description: 'Use keyword arguments when defining method with boolean argument.'
507
+ Enabled: false
508
+ Lint/MissingSuper:
509
+ Description: >-
510
+ This cop checks for the presence of constructors and lifecycle callbacks
511
+ without calls to `super`'.
512
+ Enabled: false
513
+ Style/RedundantFileExtensionInRequire:
514
+ Description: >-
515
+ Checks for the presence of superfluous `.rb` extension in
516
+ the filename provided to `require` and `require_relative`.
517
+ Enabled: false
518
+ RSpec/MultipleExpectations:
519
+ Max: 5
520
+ RSpec/NestedGroups:
521
+ Max: 5
522
+ RSpec/ExampleLength:
523
+ Max: 10
524
+ RSpec/LetSetup:
525
+ Enabled: false
526
+ RSpec/ExpectChange:
527
+ Enabled: true
528
+ EnforcedStyle: block
529
+ RSpec/BeforeAfterAll:
530
+ Enabled: false