rails-queue-it 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.circleci/config.yml +116 -0
- data/.circleci/setup-rubygems.sh +3 -0
- data/.editorconfig +24 -0
- data/.gitignore +9 -0
- data/.rspec +3 -0
- data/.rubocop.yml +503 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +7 -0
- data/Gemfile +15 -0
- data/Gemfile.lock +277 -0
- data/Guardfile +12 -0
- data/LICENSE.txt +21 -0
- data/README.md +202 -0
- data/Rakefile +10 -0
- data/app/assets/config/queue_it_manifest.js +1 -0
- data/app/assets/images/queue_it/.keep +0 -0
- data/app/assets/stylesheets/queue_it/application.css +15 -0
- data/app/controllers/queue_it/application_controller.rb +5 -0
- data/app/helpers/queue_it/application_helper.rb +4 -0
- data/app/jobs/queue_it/application_job.rb +4 -0
- data/app/mailers/queue_it/application_mailer.rb +6 -0
- data/app/models/concerns/queue_it/queable.rb +89 -0
- data/app/models/queue_it/application_record.rb +5 -0
- data/app/models/queue_it/node.rb +68 -0
- data/app/models/queue_it/queue.rb +111 -0
- data/app/views/layouts/queue_it/application.html.erb +15 -0
- data/bin/rails +25 -0
- data/config/routes.rb +2 -0
- data/db/migrate/20210723140008_create_queue_it_queues.rb +10 -0
- data/db/migrate/20210723140434_create_queue_it_nodes.rb +12 -0
- data/lib/generators/queue_it/install/USAGE +5 -0
- data/lib/generators/queue_it/install/install_generator.rb +19 -0
- data/lib/generators/queue_it/install/templates/initializer.rb +2 -0
- data/lib/queue_it.rb +25 -0
- data/lib/queue_it/engine.rb +15 -0
- data/lib/queue_it/example_class.rb +7 -0
- data/lib/queue_it/version.rb +3 -0
- data/lib/tasks/auto_annotate_models.rake +67 -0
- data/lib/tasks/queue_it_tasks.rake +4 -0
- data/queue_it.gemspec +38 -0
- data/spec/concerns/queue_it/queable_spec.rb +492 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/config/manifest.js +3 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
- data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
- data/spec/dummy/app/controllers/application_controller.rb +2 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/javascript/packs/application.js +15 -0
- data/spec/dummy/app/jobs/application_job.rb +7 -0
- data/spec/dummy/app/mailers/application_mailer.rb +4 -0
- data/spec/dummy/app/models/application_record.rb +3 -0
- data/spec/dummy/app/models/task.rb +3 -0
- data/spec/dummy/app/models/user.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +33 -0
- data/spec/dummy/config.ru +5 -0
- data/spec/dummy/config/application.rb +30 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/cable.yml +10 -0
- data/spec/dummy/config/database.yml +27 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +81 -0
- data/spec/dummy/config/environments/production.rb +112 -0
- data/spec/dummy/config/environments/test.rb +49 -0
- data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
- data/spec/dummy/config/initializers/assets.rb +12 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/content_security_policy.rb +28 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +33 -0
- data/spec/dummy/config/puma.rb +38 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config/spring.rb +6 -0
- data/spec/dummy/config/storage.yml +34 -0
- data/spec/dummy/db/migrate/20210723142357_create_users.rb +9 -0
- data/spec/dummy/db/migrate/20210723172002_create_tasks.rb +9 -0
- data/spec/dummy/db/schema.rb +52 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/spec/models/task_spec.rb +7 -0
- data/spec/dummy/spec/models/user_spec.rb +7 -0
- data/spec/factories/queue_it/nodes.rb +18 -0
- data/spec/factories/queue_it/queues.rb +26 -0
- data/spec/factories/tasks.rb +11 -0
- data/spec/factories/users.rb +5 -0
- data/spec/fixtures/files/image.png +0 -0
- data/spec/fixtures/files/video.mp4 +0 -0
- data/spec/models/queue_it/node_spec.rb +43 -0
- data/spec/models/queue_it/queue_spec.rb +116 -0
- data/spec/queue_it_spec.rb +16 -0
- data/spec/rails_helper.rb +52 -0
- data/spec/spec_helper.rb +9 -0
- data/spec/support/test_helpers.rb +5 -0
- metadata +441 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0463e68ab653afbe7da1d46430eb9c2ff115990ad4a0699421152ae3f208ad9f
|
4
|
+
data.tar.gz: e11c88dd8992e773f51b6b967ffacbf422fc5a4c7bf6f27507d413d67b509da0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 244fb35fc7f94fd3431a619305b4888a2b3828b54557d32fcf8947d2257b9ba3152bde208caea71589f8883dbdc95beaddf1e33a0c54423d7f70d517a7c55b2f
|
7
|
+
data.tar.gz: 0f6d0ba7f1058d7c1460efd9ec8b729f3ede026acaafc24eae2525961341a80909ff5aba59abc53719df8339e22dd0a4137fae4a432a8cb0e15a7de723393d1c
|
@@ -0,0 +1,116 @@
|
|
1
|
+
version: 2.1
|
2
|
+
|
3
|
+
env-vars: &env-vars
|
4
|
+
RAILS_ENV: test
|
5
|
+
NODE_ENV: test
|
6
|
+
BUNDLE_PATH: vendor/bundle
|
7
|
+
|
8
|
+
orbs:
|
9
|
+
ruby: circleci/ruby@0.1.2
|
10
|
+
|
11
|
+
executors:
|
12
|
+
main-executor:
|
13
|
+
parameters:
|
14
|
+
ruby-version:
|
15
|
+
description: "Ruby version"
|
16
|
+
default: "2.7"
|
17
|
+
type: string
|
18
|
+
docker:
|
19
|
+
- image: circleci/ruby:<<parameters.ruby-version>>-node
|
20
|
+
environment: *env-vars
|
21
|
+
test-executor:
|
22
|
+
parameters:
|
23
|
+
ruby-version:
|
24
|
+
description: "Ruby version"
|
25
|
+
default: "2.7"
|
26
|
+
type: string
|
27
|
+
docker:
|
28
|
+
- image: circleci/ruby:<<parameters.ruby-version>>-node
|
29
|
+
environment: *env-vars
|
30
|
+
- image: circleci/postgres:9.6-alpine
|
31
|
+
|
32
|
+
commands:
|
33
|
+
setup:
|
34
|
+
description: checkout code and install dependencies
|
35
|
+
steps:
|
36
|
+
- checkout
|
37
|
+
- run:
|
38
|
+
name: Install bundle dependencies
|
39
|
+
command: |
|
40
|
+
BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")
|
41
|
+
gem install bundler:$BUNDLER_VERSION
|
42
|
+
bundle _$(echo $BUNDLER_VERSION)_ install
|
43
|
+
|
44
|
+
jobs:
|
45
|
+
lint:
|
46
|
+
executor: main-executor
|
47
|
+
steps:
|
48
|
+
- setup
|
49
|
+
- run:
|
50
|
+
name: Install reviewdog
|
51
|
+
command: |
|
52
|
+
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b ./bin
|
53
|
+
- run:
|
54
|
+
name: Get files to lint
|
55
|
+
command: |
|
56
|
+
mkdir tmp
|
57
|
+
git diff origin/master --name-only --diff-filter=d > tmp/files_to_lint
|
58
|
+
- run:
|
59
|
+
name: Run rubocop
|
60
|
+
shell: /bin/bash
|
61
|
+
command: |
|
62
|
+
cat tmp/files_to_lint | grep -E '.+\.(rb)$' | xargs bundle exec rubocop --force-exclusion \
|
63
|
+
| ./bin/reviewdog -reporter=github-pr-review -f=rubocop
|
64
|
+
test:
|
65
|
+
parameters:
|
66
|
+
ruby-version:
|
67
|
+
description: "Ruby version"
|
68
|
+
default: "2.7"
|
69
|
+
type: string
|
70
|
+
executor:
|
71
|
+
name: test-executor
|
72
|
+
ruby-version: <<parameters.ruby-version>>
|
73
|
+
steps:
|
74
|
+
- setup
|
75
|
+
- run:
|
76
|
+
name: Database Creation
|
77
|
+
command: bin/rails db:create && bin/rails db:migrate
|
78
|
+
- run:
|
79
|
+
name: Run Tests
|
80
|
+
command: |
|
81
|
+
RSPEC_JUNIT_ARGS="-r rspec_junit_formatter -f RspecJunitFormatter -o test_results/rspec.xml"
|
82
|
+
RSPEC_FORMAT_ARGS="-f progress --no-color -p 10"
|
83
|
+
bundle exec rspec ./spec $RSPEC_FORMAT_ARGS $RSPEC_JUNIT_ARGS
|
84
|
+
- store_test_results:
|
85
|
+
path: test_results
|
86
|
+
deploy:
|
87
|
+
executor: main-executor
|
88
|
+
steps:
|
89
|
+
- setup
|
90
|
+
- run:
|
91
|
+
name: Setup rubygems
|
92
|
+
command: bash .circleci/setup-rubygems.sh
|
93
|
+
- run:
|
94
|
+
name: Publish to rubygems
|
95
|
+
command: |
|
96
|
+
gem build queue_it.gemspec
|
97
|
+
version_tag=$(git describe --tags)
|
98
|
+
gem push rails-queue-it-${version_tag#v}.gem
|
99
|
+
|
100
|
+
workflows:
|
101
|
+
version: 2
|
102
|
+
main:
|
103
|
+
jobs:
|
104
|
+
- lint:
|
105
|
+
context: org-global
|
106
|
+
- test:
|
107
|
+
matrix:
|
108
|
+
parameters:
|
109
|
+
ruby-version: ["2.6", "2.7"]
|
110
|
+
- deploy:
|
111
|
+
context: org-global
|
112
|
+
filters:
|
113
|
+
tags:
|
114
|
+
only: /.*/
|
115
|
+
branches:
|
116
|
+
ignore: /.*/
|
data/.editorconfig
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# EditorConfig helps developers define and maintain consistent
|
2
|
+
# coding styles between different editors and IDEs
|
3
|
+
# editorconfig.org
|
4
|
+
|
5
|
+
root = true
|
6
|
+
|
7
|
+
[*]
|
8
|
+
|
9
|
+
# Change these settings to your own preference
|
10
|
+
indent_style = space
|
11
|
+
indent_size = 2
|
12
|
+
|
13
|
+
# We recommend you to keep these unchanged
|
14
|
+
end_of_line = lf
|
15
|
+
charset = utf-8
|
16
|
+
trim_trailing_whitespace = true
|
17
|
+
insert_final_newline = true
|
18
|
+
|
19
|
+
[*.js]
|
20
|
+
indent_style = space
|
21
|
+
indent_size = 2
|
22
|
+
|
23
|
+
[*.md]
|
24
|
+
trim_trailing_whitespace = false
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,503 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-rails
|
3
|
+
AllCops:
|
4
|
+
Exclude:
|
5
|
+
- "vendor/**/*"
|
6
|
+
- "db/**/*"
|
7
|
+
- "bin/**/*"
|
8
|
+
TargetRubyVersion: 2.7
|
9
|
+
Rails:
|
10
|
+
Enabled: true
|
11
|
+
Layout/ParameterAlignment:
|
12
|
+
Description: Align the parameters of a method call if they span more than one line.
|
13
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-double-indent
|
14
|
+
Enabled: true
|
15
|
+
EnforcedStyle: with_fixed_indentation
|
16
|
+
SupportedStyles:
|
17
|
+
- with_first_parameter
|
18
|
+
- with_fixed_indentation
|
19
|
+
Metrics/BlockLength:
|
20
|
+
Enabled: false
|
21
|
+
Style/ClassAndModuleChildren:
|
22
|
+
Description: Checks style of children classes and modules.
|
23
|
+
Enabled: false
|
24
|
+
EnforcedStyle: nested
|
25
|
+
SupportedStyles:
|
26
|
+
- nested
|
27
|
+
- compact
|
28
|
+
Style/CommentAnnotation:
|
29
|
+
Description: Checks formatting of special comments (TODO, FIXME, OPTIMIZE, HACK,
|
30
|
+
REVIEW).
|
31
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#annotate-keywords
|
32
|
+
Enabled: false
|
33
|
+
Keywords:
|
34
|
+
- TODO
|
35
|
+
- FIXME
|
36
|
+
- OPTIMIZE
|
37
|
+
- HACK
|
38
|
+
- REVIEW
|
39
|
+
Naming/FileName:
|
40
|
+
Description: Use snake_case for source file names.
|
41
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
|
42
|
+
Enabled: false
|
43
|
+
Exclude: []
|
44
|
+
Style/FormatString:
|
45
|
+
Description: Enforce the use of Kernel#sprintf, Kernel#format or String#%.
|
46
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#sprintf
|
47
|
+
Enabled: false
|
48
|
+
EnforcedStyle: format
|
49
|
+
SupportedStyles:
|
50
|
+
- format
|
51
|
+
- sprintf
|
52
|
+
- percent
|
53
|
+
Style/FrozenStringLiteralComment:
|
54
|
+
Enabled: false
|
55
|
+
Style/GlobalVars:
|
56
|
+
Description: Do not introduce global variables.
|
57
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#instance-vars
|
58
|
+
Enabled: false
|
59
|
+
AllowedVariables: []
|
60
|
+
Style/GuardClause:
|
61
|
+
Description: Check for conditionals that can be replaced with guard clauses
|
62
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
|
63
|
+
Enabled: false
|
64
|
+
MinBodyLength: 1
|
65
|
+
Style/IfUnlessModifier:
|
66
|
+
Description: Favor modifier if/unless usage when you have a single-line body.
|
67
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
|
68
|
+
Enabled: false
|
69
|
+
Style/LambdaCall:
|
70
|
+
Description: Use lambda.call(...) instead of lambda.(...).
|
71
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc-call
|
72
|
+
Enabled: false
|
73
|
+
EnforcedStyle: call
|
74
|
+
SupportedStyles:
|
75
|
+
- call
|
76
|
+
- braces
|
77
|
+
Style/Next:
|
78
|
+
Description: Use `next` to skip iteration instead of a condition at the end.
|
79
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
|
80
|
+
Enabled: false
|
81
|
+
EnforcedStyle: skip_modifier_ifs
|
82
|
+
MinBodyLength: 3
|
83
|
+
SupportedStyles:
|
84
|
+
- skip_modifier_ifs
|
85
|
+
- always
|
86
|
+
Layout/MultilineOperationIndentation:
|
87
|
+
Description: Checks indentation of binary operations that span more than one line.
|
88
|
+
Enabled: true
|
89
|
+
EnforcedStyle: indented
|
90
|
+
SupportedStyles:
|
91
|
+
- aligned
|
92
|
+
- indented
|
93
|
+
Style/MutableConstant:
|
94
|
+
Description: Do not assign mutable objects to constants.
|
95
|
+
Enabled: false
|
96
|
+
Style/NumericLiterals:
|
97
|
+
Description: Add underscores to large numeric literals to improve their readability.
|
98
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics
|
99
|
+
Enabled: false
|
100
|
+
MinDigits: 5
|
101
|
+
Style/PercentLiteralDelimiters:
|
102
|
+
Description: Use `%`-literal delimiters consistently
|
103
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
|
104
|
+
Enabled: false
|
105
|
+
PreferredDelimiters:
|
106
|
+
"%": "()"
|
107
|
+
"%i": "()"
|
108
|
+
"%q": "()"
|
109
|
+
"%Q": "()"
|
110
|
+
"%r": "{}"
|
111
|
+
"%s": "()"
|
112
|
+
"%w": "()"
|
113
|
+
"%W": "()"
|
114
|
+
"%x": "()"
|
115
|
+
Naming/PredicateName:
|
116
|
+
Description: Check the names of predicate methods.
|
117
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
|
118
|
+
Enabled: true
|
119
|
+
NamePrefix:
|
120
|
+
- is_
|
121
|
+
- has_
|
122
|
+
- have_
|
123
|
+
ForbiddenPrefixes:
|
124
|
+
- is_
|
125
|
+
Style/RaiseArgs:
|
126
|
+
Description: Checks the arguments passed to raise/fail.
|
127
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
|
128
|
+
Enabled: false
|
129
|
+
EnforcedStyle: exploded
|
130
|
+
SupportedStyles:
|
131
|
+
- compact
|
132
|
+
- exploded
|
133
|
+
Style/SignalException:
|
134
|
+
Description: Checks for proper usage of fail and raise.
|
135
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
|
136
|
+
Enabled: false
|
137
|
+
EnforcedStyle: semantic
|
138
|
+
SupportedStyles:
|
139
|
+
- only_raise
|
140
|
+
- only_fail
|
141
|
+
- semantic
|
142
|
+
Style/SingleLineMethods:
|
143
|
+
Description: Avoid single-line methods.
|
144
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
|
145
|
+
Enabled: false
|
146
|
+
AllowIfMethodIsEmpty: true
|
147
|
+
Style/StringLiterals:
|
148
|
+
Description: Checks if uses of quotes match the configured preference.
|
149
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
|
150
|
+
Enabled: false
|
151
|
+
EnforcedStyle: double_quotes
|
152
|
+
SupportedStyles:
|
153
|
+
- single_quotes
|
154
|
+
- double_quotes
|
155
|
+
Style/TrailingCommaInArguments:
|
156
|
+
Description: Checks for trailing comma in argument lists.
|
157
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
|
158
|
+
Enabled: true
|
159
|
+
Style/TrailingCommaInArrayLiteral:
|
160
|
+
Description: Checks for trailing comma in array and hash literals.
|
161
|
+
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-trailing-array-commas
|
162
|
+
Enabled: true
|
163
|
+
Style/TrailingCommaInHashLiteral:
|
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/TrivialAccessors:
|
168
|
+
Description: Prefer attr_* methods to trivial readers/writers.
|
169
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr_family
|
170
|
+
Enabled: false
|
171
|
+
ExactNameMatch: false
|
172
|
+
AllowPredicates: false
|
173
|
+
AllowDSLWriters: false
|
174
|
+
AllowedMethods:
|
175
|
+
- to_ary
|
176
|
+
- to_a
|
177
|
+
- to_c
|
178
|
+
- to_enum
|
179
|
+
- to_h
|
180
|
+
- to_hash
|
181
|
+
- to_i
|
182
|
+
- to_int
|
183
|
+
- to_io
|
184
|
+
- to_open
|
185
|
+
- to_path
|
186
|
+
- to_proc
|
187
|
+
- to_r
|
188
|
+
- to_regexp
|
189
|
+
- to_str
|
190
|
+
- to_s
|
191
|
+
- to_sym
|
192
|
+
Style/WhileUntilModifier:
|
193
|
+
Description: Favor modifier while/until usage when you have a single-line body.
|
194
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier
|
195
|
+
Enabled: false
|
196
|
+
Style/ExponentialNotation:
|
197
|
+
Enabled: true
|
198
|
+
Style/HashEachMethods:
|
199
|
+
Description: Use Hash#each_key and Hash#each_value.
|
200
|
+
Enabled: true
|
201
|
+
Style/HashTransformKeys:
|
202
|
+
Description: Prefer `transform_keys` over `each_with_object` and `map`.
|
203
|
+
Enabled: true
|
204
|
+
Style/HashTransformValues:
|
205
|
+
Description: Prefer `transform_values` over `each_with_object` and `map`.
|
206
|
+
Enabled: true
|
207
|
+
Metrics/AbcSize:
|
208
|
+
Description: A calculated magnitude based on number of assignments, branches, and
|
209
|
+
conditions.
|
210
|
+
Enabled: true
|
211
|
+
Max: 25
|
212
|
+
Metrics/BlockNesting:
|
213
|
+
Description: Avoid excessive block nesting
|
214
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count
|
215
|
+
Enabled: true
|
216
|
+
Max: 3
|
217
|
+
Metrics/ClassLength:
|
218
|
+
Description: Avoid classes longer than 100 lines of code.
|
219
|
+
Enabled: false
|
220
|
+
CountComments: false
|
221
|
+
Max: 100
|
222
|
+
Metrics/MethodLength:
|
223
|
+
Description: Avoid methods longer than 15 lines of code.
|
224
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
|
225
|
+
Enabled: true
|
226
|
+
CountComments: true
|
227
|
+
Max: 15
|
228
|
+
Exclude:
|
229
|
+
- "spec/**/*"
|
230
|
+
Metrics/ParameterLists:
|
231
|
+
Description: Avoid long parameter lists.
|
232
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
|
233
|
+
Enabled: false
|
234
|
+
Max: 5
|
235
|
+
CountKeywordArgs: true
|
236
|
+
Lint/AssignmentInCondition:
|
237
|
+
Description: Don't use assignment in conditions.
|
238
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
|
239
|
+
Enabled: false
|
240
|
+
AllowSafeAssignment: true
|
241
|
+
Layout/LineLength:
|
242
|
+
Description: Limit lines to 100 characters.
|
243
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#100-character-limits
|
244
|
+
Enabled: true
|
245
|
+
Max: 100
|
246
|
+
AllowURI: true
|
247
|
+
URISchemes:
|
248
|
+
- http
|
249
|
+
- https
|
250
|
+
Layout/EndAlignment:
|
251
|
+
Description: Align ends correctly.
|
252
|
+
Enabled: true
|
253
|
+
EnforcedStyleAlignWith: keyword
|
254
|
+
SupportedStylesAlignWith:
|
255
|
+
- keyword
|
256
|
+
- variable
|
257
|
+
Layout/DefEndAlignment:
|
258
|
+
Description: Align ends corresponding to defs correctly.
|
259
|
+
Enabled: true
|
260
|
+
EnforcedStyleAlignWith: start_of_line
|
261
|
+
SupportedStylesAlignWith:
|
262
|
+
- start_of_line
|
263
|
+
- def
|
264
|
+
Layout/SpaceAroundMethodCallOperator:
|
265
|
+
Description: Checks method call operators to not have spaces around them.
|
266
|
+
Enabled: true
|
267
|
+
Style/SymbolArray:
|
268
|
+
Description: Use %i or %I for arrays of symbols.
|
269
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-i
|
270
|
+
Enabled: false
|
271
|
+
Layout/ExtraSpacing:
|
272
|
+
Description: Do not use unnecessary spacing.
|
273
|
+
Enabled: false
|
274
|
+
Naming/AccessorMethodName:
|
275
|
+
Description: Check the naming of accessor methods for get_/set_.
|
276
|
+
Enabled: false
|
277
|
+
Style/Alias:
|
278
|
+
Description: Use alias_method instead of alias.
|
279
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
|
280
|
+
Enabled: false
|
281
|
+
Style/ArrayJoin:
|
282
|
+
Description: Use Array#join instead of Array#*.
|
283
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#array-join
|
284
|
+
Enabled: false
|
285
|
+
Style/AsciiComments:
|
286
|
+
Description: Use only ascii symbols in comments.
|
287
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-comments
|
288
|
+
Enabled: false
|
289
|
+
Naming/AsciiIdentifiers:
|
290
|
+
Description: Use only ascii symbols in identifiers.
|
291
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-identifiers
|
292
|
+
Enabled: false
|
293
|
+
Style/Attr:
|
294
|
+
Description: Checks for uses of Module#attr.
|
295
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr
|
296
|
+
Enabled: false
|
297
|
+
Style/BlockComments:
|
298
|
+
Description: Do not use block comments.
|
299
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-block-comments
|
300
|
+
Enabled: false
|
301
|
+
Style/CaseEquality:
|
302
|
+
Description: Avoid explicit use of the case equality operator(===).
|
303
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-case-equality
|
304
|
+
Enabled: false
|
305
|
+
Style/CharacterLiteral:
|
306
|
+
Description: Checks for uses of character literals.
|
307
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-character-literals
|
308
|
+
Enabled: false
|
309
|
+
Style/ClassVars:
|
310
|
+
Description: Avoid the use of class variables.
|
311
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-class-vars
|
312
|
+
Enabled: false
|
313
|
+
Style/ColonMethodCall:
|
314
|
+
Description: 'Do not use :: for method call.'
|
315
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#double-colons
|
316
|
+
Enabled: false
|
317
|
+
Style/PreferredHashMethods:
|
318
|
+
Description: Checks for use of deprecated Hash methods.
|
319
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-key
|
320
|
+
Enabled: false
|
321
|
+
Style/Documentation:
|
322
|
+
Description: Document classes and non-namespace modules.
|
323
|
+
Enabled: false
|
324
|
+
Style/DoubleNegation:
|
325
|
+
Description: Checks for uses of double negation (!!).
|
326
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
|
327
|
+
Enabled: false
|
328
|
+
Style/EachWithObject:
|
329
|
+
Description: Prefer `each_with_object` over `inject` or `reduce`.
|
330
|
+
Enabled: false
|
331
|
+
Style/EmptyElse:
|
332
|
+
Description: Avoid empty else-clauses.
|
333
|
+
Enabled: true
|
334
|
+
Style/EmptyLiteral:
|
335
|
+
Description: Prefer literals to Array.new/Hash.new/String.new.
|
336
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
|
337
|
+
Enabled: false
|
338
|
+
Layout/EndOfLine:
|
339
|
+
Description: Use Unix-style line endings.
|
340
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#crlf
|
341
|
+
Enabled: true
|
342
|
+
Style/EvenOdd:
|
343
|
+
Description: Favor the use of Fixnum#even? && Fixnum#odd?
|
344
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
|
345
|
+
Enabled: false
|
346
|
+
Lint/FlipFlop:
|
347
|
+
Description: Checks for flip flops
|
348
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-flip-flops
|
349
|
+
Enabled: false
|
350
|
+
Style/IfWithSemicolon:
|
351
|
+
Description: Do not use if x; .... Use the ternary operator instead.
|
352
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs
|
353
|
+
Enabled: false
|
354
|
+
Style/Lambda:
|
355
|
+
Description: Use the new lambda literal syntax for single-line blocks.
|
356
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#lambda-multi-line
|
357
|
+
Enabled: false
|
358
|
+
Style/LineEndConcatenation:
|
359
|
+
Description: Use \ instead of + or << to concatenate two string literals at line
|
360
|
+
end.
|
361
|
+
Enabled: false
|
362
|
+
Style/ModuleFunction:
|
363
|
+
Description: Checks for usage of `extend self` in modules.
|
364
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
|
365
|
+
Enabled: false
|
366
|
+
Style/MultilineBlockChain:
|
367
|
+
Description: Avoid multi-line chains of blocks.
|
368
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
|
369
|
+
Enabled: false
|
370
|
+
Layout/MultilineBlockLayout:
|
371
|
+
Description: Ensures newlines after multiline block do statements.
|
372
|
+
Enabled: false
|
373
|
+
Style/NegatedIf:
|
374
|
+
Description: Favor unless over if for negative conditions (or control flow or).
|
375
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#unless-for-negatives
|
376
|
+
Enabled: false
|
377
|
+
Style/NegatedWhile:
|
378
|
+
Description: Favor until over while for negative conditions.
|
379
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#until-for-negatives
|
380
|
+
Enabled: false
|
381
|
+
Style/NilComparison:
|
382
|
+
Description: Prefer x.nil? to x == nil.
|
383
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
|
384
|
+
Enabled: false
|
385
|
+
Style/OneLineConditional:
|
386
|
+
Description: Favor the ternary operator(?:) over if/then/else/end constructs.
|
387
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
|
388
|
+
Enabled: false
|
389
|
+
Naming/BinaryOperatorParameterName:
|
390
|
+
Description: When defining binary operators, name the argument other.
|
391
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#other-arg
|
392
|
+
Enabled: false
|
393
|
+
Style/PerlBackrefs:
|
394
|
+
Description: Avoid Perl-style regex back references.
|
395
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
|
396
|
+
Enabled: false
|
397
|
+
Style/Proc:
|
398
|
+
Description: Use proc instead of Proc.new.
|
399
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc
|
400
|
+
Enabled: false
|
401
|
+
Style/SelfAssignment:
|
402
|
+
Description: Checks for places where self-assignment shorthand should have been
|
403
|
+
used.
|
404
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#self-assignment
|
405
|
+
Enabled: false
|
406
|
+
Layout/SpaceBeforeFirstArg:
|
407
|
+
Description: Put a space between a method name and the first argument in a method
|
408
|
+
call without parentheses.
|
409
|
+
Enabled: true
|
410
|
+
Layout/SpaceAroundOperators:
|
411
|
+
Description: Use spaces around operators.
|
412
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
413
|
+
Enabled: true
|
414
|
+
Layout/SpaceInsideParens:
|
415
|
+
Description: No spaces after ( or before ).
|
416
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
|
417
|
+
Enabled: true
|
418
|
+
Style/SpecialGlobalVars:
|
419
|
+
Description: Avoid Perl-style global variables.
|
420
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
|
421
|
+
Enabled: false
|
422
|
+
Style/VariableInterpolation:
|
423
|
+
Description: Don't interpolate global, instance and class variables directly in
|
424
|
+
strings.
|
425
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
|
426
|
+
Enabled: false
|
427
|
+
Style/WhenThen:
|
428
|
+
Description: Use when x then ... for one-line cases.
|
429
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
|
430
|
+
Enabled: false
|
431
|
+
Lint/AmbiguousOperator:
|
432
|
+
Description: Checks for ambiguous operators in the first argument of a method invocation
|
433
|
+
without parentheses.
|
434
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-as-args
|
435
|
+
Enabled: false
|
436
|
+
Lint/AmbiguousRegexpLiteral:
|
437
|
+
Description: Checks for ambiguous regexp literals in the first argument of a method
|
438
|
+
invocation without parenthesis.
|
439
|
+
Enabled: false
|
440
|
+
Layout/BlockAlignment:
|
441
|
+
Description: Align block ends correctly.
|
442
|
+
Enabled: true
|
443
|
+
Layout/ConditionPosition:
|
444
|
+
Description: Checks for condition placed in a confusing position relative to the
|
445
|
+
keyword.
|
446
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#same-line-condition
|
447
|
+
Enabled: false
|
448
|
+
Lint/DeprecatedClassMethods:
|
449
|
+
Description: Check for deprecated class method calls.
|
450
|
+
Enabled: false
|
451
|
+
Lint/ElseLayout:
|
452
|
+
Description: Check for odd code arrangement in an else block.
|
453
|
+
Enabled: false
|
454
|
+
Lint/SuppressedException:
|
455
|
+
Description: Don't suppress exception.
|
456
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
|
457
|
+
Enabled: false
|
458
|
+
Lint/LiteralAsCondition:
|
459
|
+
Description: Checks of literals used in conditions.
|
460
|
+
Enabled: false
|
461
|
+
Lint/LiteralInInterpolation:
|
462
|
+
Description: Checks for literals used in interpolation.
|
463
|
+
Enabled: false
|
464
|
+
Lint/Loop:
|
465
|
+
Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while
|
466
|
+
for post-loop tests.
|
467
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#loop-with-break
|
468
|
+
Enabled: false
|
469
|
+
Lint/ParenthesesAsGroupedExpression:
|
470
|
+
Description: Checks for method calls with a space before the opening parenthesis.
|
471
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
|
472
|
+
Enabled: false
|
473
|
+
Lint/RequireParentheses:
|
474
|
+
Description: Use parentheses in the method call to avoid confusion about precedence.
|
475
|
+
Enabled: false
|
476
|
+
Lint/UnderscorePrefixedVariableName:
|
477
|
+
Description: Do not use prefix `_` for a variable that is used.
|
478
|
+
Enabled: false
|
479
|
+
Lint/Void:
|
480
|
+
Description: Possible use of operator/literal/variable in void context.
|
481
|
+
Enabled: false
|
482
|
+
Lint/RaiseException:
|
483
|
+
Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
|
484
|
+
Enabled: true
|
485
|
+
Lint/StructNewOverride:
|
486
|
+
Description: Disallow overriding the `Struct` built-in methods via `Struct.new`.
|
487
|
+
Enabled: true
|
488
|
+
Rails/Delegate:
|
489
|
+
Description: Prefer delegate method for delegations.
|
490
|
+
Enabled: false
|
491
|
+
Style/OptionalBooleanParameter:
|
492
|
+
Description: 'Use keyword arguments when defining method with boolean argument.'
|
493
|
+
Enabled: false
|
494
|
+
Lint/MissingSuper:
|
495
|
+
Description: >-
|
496
|
+
This cop checks for the presence of constructors and lifecycle callbacks
|
497
|
+
without calls to `super`'.
|
498
|
+
Enabled: false
|
499
|
+
Style/RedundantFileExtensionInRequire:
|
500
|
+
Description: >-
|
501
|
+
Checks for the presence of superfluous `.rb` extension in
|
502
|
+
the filename provided to `require` and `require_relative`.
|
503
|
+
Enabled: false
|