alchemy_cms 3.2.0.beta → 3.2.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +661 -863
- data/README.md +5 -63
- data/app/assets/javascripts/alchemy/alchemy.base.js.coffee +11 -10
- data/app/assets/javascripts/alchemy/alchemy.initializer.js.coffee +6 -0
- data/app/assets/stylesheets/alchemy/_extends.scss +0 -6
- data/app/assets/stylesheets/alchemy/_mixins.scss +6 -0
- data/app/assets/stylesheets/alchemy/buttons.scss +1 -1
- data/app/assets/stylesheets/alchemy/elements.scss +1 -1
- data/app/assets/stylesheets/alchemy/menubar.scss +1 -1
- data/app/assets/stylesheets/alchemy/selects.scss +5 -1
- data/app/assets/stylesheets/alchemy/upload.scss +1 -1
- data/app/controllers/alchemy/admin/pages_controller.rb +1 -1
- data/app/controllers/alchemy/base_controller.rb +4 -57
- data/app/controllers/alchemy/messages_controller.rb +2 -2
- data/app/controllers/alchemy/pages_controller.rb +22 -31
- data/app/controllers/alchemy/pictures_controller.rb +2 -2
- data/app/helpers/alchemy/admin/base_helper.rb +7 -0
- data/app/helpers/alchemy/admin/elements_helper.rb +31 -15
- data/app/helpers/alchemy/admin/pages_helper.rb +17 -0
- data/app/helpers/alchemy/base_helper.rb +0 -28
- data/app/helpers/alchemy/pages_helper.rb +18 -12
- data/app/helpers/alchemy/url_helper.rb +2 -2
- data/app/models/alchemy/cell.rb +1 -1
- data/app/models/alchemy/content/factory.rb +12 -6
- data/app/models/alchemy/element.rb +3 -3
- data/app/models/alchemy/element/definitions.rb +1 -1
- data/app/models/alchemy/element_to_page.rb +7 -0
- data/app/models/alchemy/language.rb +1 -1
- data/app/models/alchemy/page.rb +8 -1
- data/app/models/alchemy/page/page_cells.rb +2 -2
- data/app/models/alchemy/page/page_elements.rb +23 -5
- data/app/models/alchemy/page/page_natures.rb +3 -3
- data/app/models/alchemy/page/page_scopes.rb +1 -1
- data/app/models/alchemy/picture.rb +1 -1
- data/app/views/alchemy/admin/pages/_create_language_form.html.erb +1 -1
- data/app/views/alchemy/admin/pages/_form.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +1 -1
- data/app/views/alchemy/breadcrumb/_page.html.erb +3 -2
- data/app/views/alchemy/breadcrumb/_separator.html.erb +1 -0
- data/app/views/alchemy/breadcrumb/_wrapper.html.erb +13 -0
- data/app/views/alchemy/language_links/_language.html.erb +1 -1
- data/app/views/alchemy/navigation/_link.html.erb +1 -1
- data/app/views/alchemy/pages/show.rss.builder +5 -7
- data/app/views/layouts/alchemy/admin.html.erb +5 -0
- data/config/routes.rb +13 -10
- data/lib/alchemy/configuration_methods.rb +29 -0
- data/lib/alchemy/controller_actions.rb +12 -4
- data/lib/alchemy/engine.rb +3 -0
- data/lib/alchemy/errors.rb +1 -1
- data/lib/alchemy/essence.rb +14 -12
- data/lib/alchemy/on_page_layout.rb +58 -0
- data/lib/alchemy/page_layout.rb +1 -1
- data/lib/alchemy/permissions.rb +21 -16
- data/lib/alchemy/routing_constraints.rb +49 -0
- data/lib/alchemy/seeder.rb +4 -2
- data/lib/alchemy/ssl_protection.rb +30 -0
- data/lib/alchemy/test_support/essence_shared_examples.rb +118 -25
- data/lib/alchemy/test_support/factories.rb +5 -8
- data/lib/alchemy/test_support/integration_helpers.rb +16 -10
- data/lib/alchemy/upgrader/three_point_two.rb +34 -4
- data/lib/alchemy/version.rb +1 -1
- data/lib/rails/generators/alchemy/{scaffold → install}/files/_article_editor.html.erb +0 -0
- data/lib/rails/generators/alchemy/{scaffold → install}/files/_article_view.html.erb +0 -0
- data/lib/rails/generators/alchemy/{scaffold → install}/files/_standard.html.erb +0 -0
- data/lib/rails/generators/alchemy/{scaffold → install}/files/alchemy.de.yml +0 -0
- data/lib/rails/generators/alchemy/{scaffold → install}/files/alchemy.elements.css.scss +0 -0
- data/lib/rails/generators/alchemy/{scaffold → install}/files/alchemy.en.yml +0 -0
- data/lib/rails/generators/alchemy/{scaffold → install}/files/alchemy.es.yml +0 -0
- data/lib/rails/generators/alchemy/{scaffold → install}/files/application.html.erb +0 -0
- data/lib/rails/generators/alchemy/install/install_generator.rb +69 -0
- data/lib/rails/generators/alchemy/{scaffold/files/elements.yml → install/templates/elements.yml.tt} +2 -0
- data/lib/rails/generators/alchemy/{scaffold → install}/templates/page_layouts.yml.tt +2 -0
- data/lib/rails/generators/alchemy/views/views_generator.rb +41 -0
- data/lib/rails/templates/alchemy.rb +2 -2
- data/lib/tasks/alchemy/db.rake +0 -5
- data/lib/tasks/alchemy/install.rake +10 -5
- data/lib/tasks/alchemy/tidy.rake +2 -0
- data/spec/controllers/admin/attachments_controller_spec.rb +1 -1
- data/spec/controllers/admin/clipboard_controller_spec.rb +1 -1
- data/spec/controllers/admin/contents_controller_spec.rb +1 -1
- data/spec/controllers/admin/dashboard_controller_spec.rb +2 -2
- data/spec/controllers/admin/elements_controller_spec.rb +1 -1
- data/spec/controllers/admin/essence_files_controller_spec.rb +1 -1
- data/spec/controllers/admin/essence_pictures_controller_spec.rb +1 -1
- data/spec/controllers/admin/languages_controller_spec.rb +1 -1
- data/spec/controllers/admin/layoutpages_controller_spec.rb +1 -1
- data/spec/controllers/admin/pages_controller_spec.rb +4 -4
- data/spec/controllers/admin/pictures_controller_spec.rb +1 -1
- data/spec/controllers/admin/resources_controller_spec.rb +1 -1
- data/spec/controllers/admin/trash_controller_spec.rb +1 -1
- data/spec/controllers/alchemy/admin/tags_controller_spec.rb +1 -1
- data/spec/controllers/attachments_controller_spec.rb +1 -1
- data/spec/controllers/base_controller_spec.rb +22 -0
- data/spec/controllers/elements_controller_spec.rb +1 -1
- data/spec/controllers/pages_controller_spec.rb +15 -16
- data/spec/controllers/pictures_controller_spec.rb +212 -162
- data/spec/dummy/app/controllers/login_controller.rb +5 -0
- data/spec/dummy/app/models/dummy_model.rb +3 -0
- data/spec/dummy/config/alchemy/cells.yml +4 -1
- data/spec/dummy/config/alchemy/elements.yml +8 -0
- data/spec/dummy/config/alchemy/page_layouts.yml +5 -1
- data/spec/dummy/config/routes.rb +1 -2
- data/spec/dummy/db/migrate/20150412103152_create_dummy_model.rb +7 -0
- data/spec/dummy/db/schema.rb +30 -26
- data/spec/features/admin/dashboard_spec.rb +11 -9
- data/spec/features/admin/language_tree_feature_spec.rb +5 -6
- data/spec/features/admin/legacy_page_url_management_spec.rb +1 -1
- data/spec/features/admin/link_overlay_spec.rb +1 -1
- data/spec/features/admin/locale_select_feature_spec.rb +1 -1
- data/spec/features/admin/modules_integration_spec.rb +1 -1
- data/spec/features/admin/navigation_feature_spec.rb +1 -1
- data/spec/features/admin/page_creation_feature_spec.rb +1 -1
- data/spec/features/admin/page_editing_feature_spec.rb +3 -3
- data/spec/features/admin/picture_library_integration_spec.rb +1 -1
- data/spec/features/admin/resources_integration_spec.rb +1 -1
- data/spec/features/admin/site_select_feature_spec.rb +32 -0
- data/spec/features/admin/tinymce_feature_spec.rb +1 -3
- data/spec/features/page_feature_spec.rb +36 -27
- data/spec/features/security_spec.rb +1 -1
- data/spec/features/translation_integration_spec.rb +3 -3
- data/spec/helpers/admin/elements_helper_spec.rb +103 -26
- data/spec/helpers/admin/pages_helper_spec.rb +32 -1
- data/spec/helpers/base_helper_spec.rb +0 -45
- data/spec/helpers/pages_helper_spec.rb +18 -17
- data/spec/helpers/url_helper_spec.rb +8 -5
- data/spec/libraries/controller_actions_spec.rb +2 -2
- data/spec/libraries/on_page_layout_spec.rb +112 -0
- data/spec/libraries/page_layout_spec.rb +5 -1
- data/spec/libraries/permissions_spec.rb +13 -15
- data/spec/models/cell_spec.rb +4 -0
- data/spec/models/content_spec.rb +6 -0
- data/spec/models/dummy_model_spec.rb +11 -0
- data/spec/models/element_spec.rb +6 -1
- data/spec/models/element_to_page_spec.rb +14 -0
- data/spec/models/page_spec.rb +111 -19
- data/spec/routing/routing_spec.rb +120 -101
- data/spec/spec_helper.rb +3 -3
- metadata +36 -21
- data/app/views/alchemy/breadcrumb/_spacer.html.erb +0 -1
- data/lib/alchemy/capistrano.rb +0 -230
- data/lib/alchemy/test_support/auth_helpers.rb +0 -35
- data/lib/rails/generators/alchemy/deploy_script/deploy_script_generator.rb +0 -90
- data/lib/rails/generators/alchemy/deploy_script/templates/deploy.rb.tt +0 -113
- data/lib/rails/generators/alchemy/scaffold/scaffold_generator.rb +0 -63
- data/spec/dummy/app/controllers/errors_controller.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f8ca76e53123738e5b411666a78d9677f265404
|
4
|
+
data.tar.gz: ffc2be39f4cb1bc85af32c008b8029175fd1b4d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8e351a38eee79090b65c5d1d96d2bd7b1c8ca07aad0f4153554e2f9fbb112e03a92314d7ad975e8451c819b66a267892466346ae3d6e6d4e4f79c64fe1d6b36
|
7
|
+
data.tar.gz: 075c70c688c8b1091e12c3b8f727875c892f7a9e4b3dd2539e23e1004c1799add4bd844f79deb9d17452b9799f4538e0b45e0b32b77b093b06fd0f58b9d6bfde
|
data/.rubocop.yml
CHANGED
@@ -1,1063 +1,861 @@
|
|
1
1
|
AllCops:
|
2
|
+
# Include common Ruby source files.
|
2
3
|
Include:
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
- "**/Rakefile"
|
10
|
-
- "**/Capfile"
|
11
|
-
- "**/Guardfile"
|
12
|
-
- "**/Podfile"
|
13
|
-
- "**/Thorfile"
|
14
|
-
- "**/Vagrantfile"
|
15
|
-
- "**/Berksfile"
|
16
|
-
- "**/Cheffile"
|
17
|
-
- "**/Vagabondfile"
|
4
|
+
- '**/*.gemspec'
|
5
|
+
- '**/*.jbuilder'
|
6
|
+
- '**/*.rake'
|
7
|
+
- '**/Gemfile'
|
8
|
+
- '**/Rakefile'
|
9
|
+
- '**/Guardfile'
|
18
10
|
Exclude:
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
11
|
+
- 'vendor/**/*'
|
12
|
+
- 'db/schema.rb'
|
13
|
+
- 'spec/**/*'
|
14
|
+
- '*.gemspec'
|
15
|
+
# By default, the rails cops are not run. Override in project or home
|
16
|
+
# directory .rubocop.yml files, or by giving the -R/--rails option.
|
17
|
+
RunRailsCops: true
|
18
|
+
# Cop names are not displayed in offense messages by default. Change behavior
|
19
|
+
# by overriding DisplayCopNames, or by giving the -D/--display-cop-names
|
20
|
+
# option.
|
21
|
+
DisplayCopNames: true
|
22
|
+
# Style guide URLs are not displayed in offense messages by default. Change
|
23
|
+
# behavior by overriding DisplayStyleGuide, or by giving the
|
24
|
+
# -S/--display-style-guide option.
|
25
|
+
DisplayStyleGuide: true
|
26
|
+
# Additional cops that do not reference a style guide rule may be enabled by
|
27
|
+
# default. Change behavior by overriding StyleGuideCopsOnly, or by giving
|
28
|
+
# the --only-guide-cops option.
|
29
|
+
StyleGuideCopsOnly: true
|
30
|
+
|
31
|
+
# Indent private/protected/public as deep as method definitions
|
24
32
|
Style/AccessModifierIndentation:
|
25
|
-
Description: Check indentation of private/protected visibility modifiers.
|
26
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected
|
27
|
-
Enabled: true
|
28
33
|
EnforcedStyle: indent
|
29
34
|
SupportedStyles:
|
30
|
-
|
31
|
-
|
35
|
+
- outdent
|
36
|
+
- indent
|
37
|
+
|
38
|
+
# Align the elements of a hash literal if they span more than one line.
|
32
39
|
Style/AlignHash:
|
33
|
-
|
34
|
-
|
40
|
+
# Alignment of entries using hash rocket as separator. Valid values are:
|
41
|
+
#
|
42
|
+
# key - left alignment of keys
|
43
|
+
# 'a' => 2
|
44
|
+
# 'bb' => 3
|
45
|
+
# separator - alignment of hash rockets, keys are right aligned
|
46
|
+
# 'a' => 2
|
47
|
+
# 'bb' => 3
|
48
|
+
# table - left alignment of keys, hash rockets, and values
|
49
|
+
# 'a' => 2
|
50
|
+
# 'bb' => 3
|
35
51
|
EnforcedHashRocketStyle: key
|
52
|
+
# Alignment of entries using colon as separator. Valid values are:
|
53
|
+
#
|
54
|
+
# key - left alignment of keys
|
55
|
+
# a: 0
|
56
|
+
# bb: 1
|
57
|
+
# separator - alignment of colons, keys are right aligned
|
58
|
+
# a: 0
|
59
|
+
# bb: 1
|
60
|
+
# table - left alignment of keys and values
|
61
|
+
# a: 0
|
62
|
+
# bb: 1
|
36
63
|
EnforcedColonStyle: key
|
64
|
+
# Select whether hashes that are the last argument in a method call should be
|
65
|
+
# inspected? Valid values are:
|
66
|
+
#
|
67
|
+
# always_inspect - Inspect both implicit and explicit hashes.
|
68
|
+
# Registers an offense for:
|
69
|
+
# function(a: 1,
|
70
|
+
# b: 2)
|
71
|
+
# Registers an offense for:
|
72
|
+
# function({a: 1,
|
73
|
+
# b: 2})
|
74
|
+
# always_ignore - Ignore both implicit and explicit hashes.
|
75
|
+
# Accepts:
|
76
|
+
# function(a: 1,
|
77
|
+
# b: 2)
|
78
|
+
# Accepts:
|
79
|
+
# function({a: 1,
|
80
|
+
# b: 2})
|
81
|
+
# ignore_implicit - Ignore only implicit hashes.
|
82
|
+
# Accepts:
|
83
|
+
# function(a: 1,
|
84
|
+
# b: 2)
|
85
|
+
# Registers an offense for:
|
86
|
+
# function({a: 1,
|
87
|
+
# b: 2})
|
88
|
+
# ignore_explicit - Ignore only explicit hashes.
|
89
|
+
# Accepts:
|
90
|
+
# function({a: 1,
|
91
|
+
# b: 2})
|
92
|
+
# Registers an offense for:
|
93
|
+
# function(a: 1,
|
94
|
+
# b: 2)
|
37
95
|
EnforcedLastArgumentHashStyle: always_inspect
|
38
96
|
SupportedLastArgumentHashStyles:
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
97
|
+
- always_inspect
|
98
|
+
- always_ignore
|
99
|
+
- ignore_implicit
|
100
|
+
- ignore_explicit
|
101
|
+
|
43
102
|
Style/AlignParameters:
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
103
|
+
# Alignment of parameters in multi-line method calls.
|
104
|
+
#
|
105
|
+
# The `with_first_parameter` style aligns the following lines along the same
|
106
|
+
# column as the first parameter.
|
107
|
+
#
|
108
|
+
# method_call(a,
|
109
|
+
# b)
|
110
|
+
#
|
111
|
+
# The `with_fixed_indentation` style aligns the following lines with one
|
112
|
+
# level of indentation relative to the start of the line with the method call.
|
113
|
+
#
|
114
|
+
# method_call(a,
|
115
|
+
# b)
|
116
|
+
EnforcedStyle: with_fixed_indentation
|
117
|
+
SupportedStyles:
|
118
|
+
- with_first_parameter
|
119
|
+
- with_fixed_indentation
|
120
|
+
|
51
121
|
Style/AndOr:
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
122
|
+
# Whether `and` and `or` are banned only in conditionals (conditionals)
|
123
|
+
# or completely (always).
|
124
|
+
EnforcedStyle: conditionals
|
125
|
+
SupportedStyles:
|
126
|
+
- always
|
127
|
+
- conditionals
|
128
|
+
|
129
|
+
# Checks if usage of %() or %Q() matches configuration.
|
59
130
|
Style/BarePercentLiterals:
|
60
|
-
Description: Checks if usage of %() or %Q() matches configuration.
|
61
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand
|
62
|
-
Enabled: true
|
63
131
|
EnforcedStyle: bare_percent
|
64
132
|
SupportedStyles:
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
EnforcedStyle: no_braces
|
133
|
+
- percent_q
|
134
|
+
- bare_percent
|
135
|
+
|
136
|
+
Style/BlockDelimiters:
|
137
|
+
EnforcedStyle: semantic
|
71
138
|
SupportedStyles:
|
72
|
-
|
73
|
-
|
74
|
-
|
139
|
+
# The `line_count_based` style enforces braces around single line blocks and
|
140
|
+
# do..end around multi-line blocks.
|
141
|
+
- line_count_based
|
142
|
+
# The `semantic` style enforces braces around functional blocks, where the
|
143
|
+
# primary purpose of the block is to return a value and do..end for
|
144
|
+
# procedural blocks, where the primary purpose of the block is its
|
145
|
+
# side-effects.
|
146
|
+
#
|
147
|
+
# This looks at the usage of a block's method to determine its type (e.g. is
|
148
|
+
# the result of a `map` assigned to a variable or passed to another
|
149
|
+
# method) but exceptions are permitted in the `ProceduralMethods`,
|
150
|
+
# `FunctionalMethods` and `IgnoredMethods` sections below.
|
151
|
+
- semantic
|
152
|
+
ProceduralMethods:
|
153
|
+
# Methods that are known to be procedural in nature but look functional from
|
154
|
+
# their usage, e.g.
|
155
|
+
#
|
156
|
+
# time = Benchmark.realtime do
|
157
|
+
# foo.bar
|
158
|
+
# end
|
159
|
+
#
|
160
|
+
# Here, the return value of the block is discarded but the return value of
|
161
|
+
# `Benchmark.realtime` is used.
|
162
|
+
- benchmark
|
163
|
+
- bm
|
164
|
+
- bmbm
|
165
|
+
- create
|
166
|
+
- each_with_object
|
167
|
+
- measure
|
168
|
+
- new
|
169
|
+
- realtime
|
170
|
+
- tap
|
171
|
+
- with_object
|
172
|
+
FunctionalMethods:
|
173
|
+
# Methods that are known to be functional in nature but look procedural from
|
174
|
+
# their usage, e.g.
|
175
|
+
#
|
176
|
+
# let(:foo) { Foo.new }
|
177
|
+
#
|
178
|
+
# Here, the return value of `Foo.new` is used to define a `foo` helper but
|
179
|
+
# doesn't appear to be used from the return value of `let`.
|
180
|
+
- let
|
181
|
+
- let!
|
182
|
+
- subject
|
183
|
+
- watch
|
184
|
+
IgnoredMethods:
|
185
|
+
# Methods that can be either procedural or functional and cannot be
|
186
|
+
# categorised from their usage alone, e.g.
|
187
|
+
#
|
188
|
+
# foo = lambda do |x|
|
189
|
+
# puts "Hello, #{x}"
|
190
|
+
# end
|
191
|
+
#
|
192
|
+
# foo = lambda do |x|
|
193
|
+
# x * 100
|
194
|
+
# end
|
195
|
+
#
|
196
|
+
# Here, it is impossible to tell from the return value of `lambda` whether
|
197
|
+
# the inner block's return value is significant.
|
198
|
+
- lambda
|
199
|
+
- proc
|
200
|
+
- it
|
201
|
+
|
202
|
+
Style/BracesAroundHashParameters:
|
203
|
+
Enabled: false
|
204
|
+
EnforcedStyle: context_dependent
|
205
|
+
SupportedStyles:
|
206
|
+
# The `braces` style enforces braces around all method parameters that are
|
207
|
+
# hashes.
|
208
|
+
- braces
|
209
|
+
# The `no_braces` style checks that the last parameter doesn't have braces
|
210
|
+
# around it.
|
211
|
+
- no_braces
|
212
|
+
# The `context_dependent` style checks that the last parameter doesn't have
|
213
|
+
# braces around it, but requires braces if the second to last parameter is
|
214
|
+
# also a hash literal.
|
215
|
+
- context_dependent
|
216
|
+
|
217
|
+
# Indentation of `when`.
|
75
218
|
Style/CaseIndentation:
|
76
|
-
Description: Indentation of when in a case/when/[else/]end.
|
77
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-when-to-case
|
78
|
-
Enabled: true
|
79
219
|
IndentWhenRelativeTo: case
|
80
220
|
SupportedStyles:
|
81
|
-
|
82
|
-
|
83
|
-
IndentOneStep:
|
221
|
+
- case
|
222
|
+
- end
|
223
|
+
IndentOneStep: true
|
224
|
+
|
84
225
|
Style/ClassAndModuleChildren:
|
85
|
-
|
86
|
-
|
226
|
+
# Checks the style of children definitions at classes and modules.
|
227
|
+
#
|
228
|
+
# Basically there are two different styles:
|
229
|
+
#
|
230
|
+
# `nested` - have each child on a separate line
|
231
|
+
# class Foo
|
232
|
+
# class Bar
|
233
|
+
# end
|
234
|
+
# end
|
235
|
+
#
|
236
|
+
# `compact` - combine definitions as much as possible
|
237
|
+
# class Foo::Bar
|
238
|
+
# end
|
239
|
+
#
|
240
|
+
# The compact style is only forced, for classes / modules with one child.
|
87
241
|
EnforcedStyle: nested
|
88
242
|
SupportedStyles:
|
89
|
-
|
90
|
-
|
243
|
+
- nested
|
244
|
+
- compact
|
245
|
+
|
91
246
|
Style/ClassCheck:
|
92
|
-
Description: Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.
|
93
|
-
Enabled: true
|
94
247
|
EnforcedStyle: is_a?
|
95
248
|
SupportedStyles:
|
96
|
-
|
97
|
-
|
249
|
+
- is_a?
|
250
|
+
- kind_of?
|
251
|
+
|
252
|
+
# Align with the style guide.
|
98
253
|
Style/CollectionMethods:
|
99
|
-
|
100
|
-
|
101
|
-
|
254
|
+
# Mapping from undesired method to desired_method
|
255
|
+
# e.g. to use `detect` over `find`:
|
256
|
+
#
|
257
|
+
# CollectionMethods:
|
258
|
+
# PreferredMethods:
|
259
|
+
# find: detect
|
102
260
|
PreferredMethods:
|
103
|
-
collect: map
|
104
|
-
collect!: map!
|
105
|
-
|
106
|
-
|
107
|
-
|
261
|
+
# collect: 'map'
|
262
|
+
# collect!: 'map!'
|
263
|
+
inject: 'reduce'
|
264
|
+
detect: 'find'
|
265
|
+
# find_all: 'select'
|
266
|
+
|
267
|
+
# Use ` or %x around command literals.
|
268
|
+
Style/CommandLiteral:
|
269
|
+
EnforcedStyle: mixed
|
270
|
+
# backticks: Always use backticks.
|
271
|
+
# percent_x: Always use %x.
|
272
|
+
# mixed: Use backticks on single-line commands, and %x on multi-line commands.
|
273
|
+
SupportedStyles:
|
274
|
+
- backticks
|
275
|
+
- percent_x
|
276
|
+
- mixed
|
277
|
+
# If false, the cop will always recommend using %x if one or more backticks
|
278
|
+
# are found in the command string.
|
279
|
+
AllowInnerBackticks: false
|
280
|
+
|
281
|
+
# Checks formatting of special comments
|
108
282
|
Style/CommentAnnotation:
|
109
|
-
Description: Checks formatting of special comments (TODO, FIXME, OPTIMIZE, HACK,
|
110
|
-
REVIEW).
|
111
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#annotate-keywords
|
112
|
-
Enabled: false
|
113
283
|
Keywords:
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
284
|
+
- TODO
|
285
|
+
- FIXME
|
286
|
+
- OPTIMIZE
|
287
|
+
- HACK
|
288
|
+
- REVIEW
|
289
|
+
|
290
|
+
# Checks that you have put a copyright in a comment before any code.
|
291
|
+
#
|
292
|
+
# You can override the default Notice in your .rubocop.yml file.
|
293
|
+
#
|
294
|
+
# In order to use autocorrect, you must supply a value for the
|
295
|
+
# AutocorrectNotice key that matches the regexp Notice. A blank
|
296
|
+
# AutocorrectNotice will cause an error during autocorrect.
|
297
|
+
#
|
298
|
+
# Autocorrect will add a copyright notice in a comment at the top
|
299
|
+
# of the file immediately after any shebang or encoding comments.
|
300
|
+
#
|
301
|
+
# Example rubocop.yml:
|
302
|
+
#
|
303
|
+
# Style/Copyright:
|
304
|
+
# Enabled: true
|
305
|
+
# Notice: 'Copyright (\(c\) )?2015 Yahoo! Inc'
|
306
|
+
# AutocorrectNotice: '# Copyright (c) 2015 Yahoo! Inc.'
|
307
|
+
#
|
308
|
+
Style/Copyright:
|
309
|
+
Enabled: false
|
310
|
+
Notice: '^Copyright (\(c\) )?2[0-9]{3} .+'
|
311
|
+
AutocorrectNotice: ''
|
312
|
+
|
313
|
+
Style/Documentation:
|
314
|
+
Enabled: false
|
315
|
+
|
316
|
+
# Multi-line method chaining should be done with leading dots.
|
119
317
|
Style/DotPosition:
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
318
|
+
EnforcedStyle: leading
|
319
|
+
SupportedStyles:
|
320
|
+
- leading
|
321
|
+
- trailing
|
322
|
+
|
323
|
+
# Warn on empty else statements
|
324
|
+
# empty - warn only on empty else
|
325
|
+
# nil - warn on else with nil in it
|
326
|
+
# both - warn on empty else and else with nil in it
|
327
|
+
Style/EmptyElse:
|
328
|
+
EnforcedStyle: both
|
124
329
|
SupportedStyles:
|
125
|
-
|
126
|
-
|
330
|
+
- empty
|
331
|
+
- nil
|
332
|
+
- both
|
333
|
+
|
334
|
+
# Use empty lines between defs.
|
127
335
|
Style/EmptyLineBetweenDefs:
|
128
|
-
|
129
|
-
|
130
|
-
Enabled: true
|
336
|
+
# If true, this parameter means that single line method definitions don't
|
337
|
+
# need an empty line between them.
|
131
338
|
AllowAdjacentOneLineDefs: false
|
339
|
+
|
132
340
|
Style/EmptyLinesAroundBlockBody:
|
133
|
-
Description: Keeps track of empty lines around block bodies.
|
134
|
-
Enabled: true
|
135
341
|
EnforcedStyle: no_empty_lines
|
136
342
|
SupportedStyles:
|
137
|
-
|
138
|
-
|
343
|
+
- empty_lines
|
344
|
+
- no_empty_lines
|
345
|
+
|
139
346
|
Style/EmptyLinesAroundClassBody:
|
140
|
-
Description: Keeps track of empty lines around class bodies.
|
141
|
-
Enabled: true
|
142
347
|
EnforcedStyle: no_empty_lines
|
143
348
|
SupportedStyles:
|
144
|
-
|
145
|
-
|
349
|
+
- empty_lines
|
350
|
+
- no_empty_lines
|
351
|
+
|
146
352
|
Style/EmptyLinesAroundModuleBody:
|
147
|
-
Description: Keeps track of empty lines around module bodies.
|
148
|
-
Enabled: true
|
149
353
|
EnforcedStyle: no_empty_lines
|
150
354
|
SupportedStyles:
|
151
|
-
|
152
|
-
|
355
|
+
- empty_lines
|
356
|
+
- no_empty_lines
|
357
|
+
|
358
|
+
# Checks whether the source file has a utf-8 encoding comment or not
|
359
|
+
# AutoCorrectEncodingComment must match the regex
|
360
|
+
# /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
|
153
361
|
Style/Encoding:
|
154
|
-
Description: Use UTF-8 as the source file encoding.
|
155
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#utf-8
|
156
362
|
Enabled: false
|
157
363
|
EnforcedStyle: always
|
158
364
|
SupportedStyles:
|
159
|
-
|
160
|
-
|
365
|
+
- when_needed
|
366
|
+
- always
|
367
|
+
AutoCorrectEncodingComment: '# encoding: utf-8'
|
368
|
+
|
161
369
|
Style/FileName:
|
162
|
-
|
163
|
-
|
164
|
-
Enabled: false
|
370
|
+
# File names listed in AllCops:Include are excluded by default. Add extra
|
371
|
+
# excludes here.
|
165
372
|
Exclude: []
|
373
|
+
|
166
374
|
Style/FirstParameterIndentation:
|
167
|
-
Description: Checks the indentation of the first parameter in a method call.
|
168
|
-
Enabled: true
|
169
375
|
EnforcedStyle: special_for_inner_method_call_in_parentheses
|
170
376
|
SupportedStyles:
|
171
|
-
|
172
|
-
|
173
|
-
|
377
|
+
# The first parameter should always be indented one step more than the
|
378
|
+
# preceding line.
|
379
|
+
- consistent
|
380
|
+
# The first parameter should normally be indented one step more than the
|
381
|
+
# preceding line, but if it's a parameter for a method call that is itself
|
382
|
+
# a parameter in a method call, then the inner parameter should be indented
|
383
|
+
# relative to the inner method.
|
384
|
+
- special_for_inner_method_call
|
385
|
+
# Same as special_for_inner_method_call except that the special rule only
|
386
|
+
# applies if the outer method call encloses its arguments in parentheses.
|
387
|
+
- special_for_inner_method_call_in_parentheses
|
388
|
+
|
389
|
+
# Checks use of for or each in multiline loops.
|
174
390
|
Style/For:
|
175
|
-
Description: Checks use of for or each in multiline loops.
|
176
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-for-loops
|
177
|
-
Enabled: true
|
178
391
|
EnforcedStyle: each
|
179
392
|
SupportedStyles:
|
180
|
-
|
181
|
-
|
393
|
+
- for
|
394
|
+
- each
|
395
|
+
|
396
|
+
# Enforce the method used for string formatting.
|
182
397
|
Style/FormatString:
|
183
|
-
Description: Enforce the use of Kernel#sprintf, Kernel#format or String#%.
|
184
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#sprintf
|
185
|
-
Enabled: false
|
186
398
|
EnforcedStyle: format
|
187
399
|
SupportedStyles:
|
188
|
-
|
189
|
-
|
190
|
-
|
400
|
+
- format
|
401
|
+
- sprintf
|
402
|
+
- percent
|
403
|
+
|
404
|
+
# Built-in global variables are allowed by default.
|
191
405
|
Style/GlobalVars:
|
192
|
-
Description: Do not introduce global variables.
|
193
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#instance-vars
|
194
|
-
Enabled: false
|
195
406
|
AllowedVariables: []
|
407
|
+
|
408
|
+
# `MinBodyLength` defines the number of lines of the a body of an if / unless
|
409
|
+
# needs to have to trigger this cop
|
196
410
|
Style/GuardClause:
|
197
|
-
Description: Check for conditionals that can be replaced with guard clauses
|
198
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
|
199
|
-
Enabled: false
|
200
411
|
MinBodyLength: 1
|
412
|
+
|
201
413
|
Style/HashSyntax:
|
202
|
-
Description: 'Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax { :a =>
|
203
|
-
1, :b => 2 }.'
|
204
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-literals
|
205
|
-
Enabled: true
|
206
414
|
EnforcedStyle: ruby19
|
207
415
|
SupportedStyles:
|
208
|
-
|
209
|
-
|
416
|
+
- ruby19
|
417
|
+
- ruby19_no_mixed_keys
|
418
|
+
- hash_rockets
|
419
|
+
# Force hashes that have a symbol value to use hash rockets
|
420
|
+
UseHashRocketsWithSymbolValues: false
|
421
|
+
|
210
422
|
Style/IfUnlessModifier:
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
423
|
+
MaxLineLength: 80
|
424
|
+
|
425
|
+
Style/IndentationConsistency:
|
426
|
+
# The difference between `rails` and `normal` is that the `rails` style
|
427
|
+
# prescribes that in classes and modules the `protected` and `private`
|
428
|
+
# modifier keywords shall be indented the same as public methods and that
|
429
|
+
# protected and private members shall be indented one step more than the
|
430
|
+
# modifiers. Other than that, both styles mean that entities on the same
|
431
|
+
# logical depth shall have the same indentation.
|
432
|
+
EnforcedStyle: normal
|
433
|
+
SupportedStyles:
|
434
|
+
- normal
|
435
|
+
- rails
|
436
|
+
|
215
437
|
Style/IndentationWidth:
|
216
|
-
|
217
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
|
218
|
-
Enabled: true
|
438
|
+
# Number of spaces for each indentation level.
|
219
439
|
Width: 2
|
440
|
+
|
441
|
+
# Checks the indentation of the first key in a hash literal.
|
220
442
|
Style/IndentHash:
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
443
|
+
# The value `special_inside_parentheses` means that hash literals with braces
|
444
|
+
# that have their opening brace on the same line as a surrounding opening
|
445
|
+
# round parenthesis, shall have their first key indented relative to the
|
446
|
+
# first position inside the parenthesis.
|
447
|
+
# The value `consistent` means that the indentation of the first key shall
|
448
|
+
# always be relative to the first position of the line where the opening
|
449
|
+
# brace is.
|
450
|
+
EnforcedStyle: consistent
|
451
|
+
SupportedStyles:
|
452
|
+
- special_inside_parentheses
|
453
|
+
- consistent
|
454
|
+
|
227
455
|
Style/LambdaCall:
|
228
|
-
Description: Use lambda.call(...) instead of lambda.(...).
|
229
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc-call
|
230
|
-
Enabled: false
|
231
456
|
EnforcedStyle: call
|
232
457
|
SupportedStyles:
|
233
|
-
|
234
|
-
|
458
|
+
- call
|
459
|
+
- braces
|
460
|
+
|
235
461
|
Style/Next:
|
236
|
-
|
237
|
-
|
238
|
-
|
462
|
+
# With `always` all conditions at the end of an iteration needs to be
|
463
|
+
# replaced by next - with `skip_modifier_ifs` the modifier if like this one
|
464
|
+
# are ignored: [1, 2].each { |a| return 'yes' if a == 1 }
|
239
465
|
EnforcedStyle: skip_modifier_ifs
|
466
|
+
# `MinBodyLength` defines the number of lines of the a body of an if / unless
|
467
|
+
# needs to have to trigger this cop
|
240
468
|
MinBodyLength: 3
|
241
469
|
SupportedStyles:
|
242
|
-
|
243
|
-
|
470
|
+
- skip_modifier_ifs
|
471
|
+
- always
|
472
|
+
|
244
473
|
Style/NonNilCheck:
|
245
|
-
|
246
|
-
|
247
|
-
|
474
|
+
Enabled: false
|
475
|
+
# With `IncludeSemanticChanges` set to `true`, this cop reports offenses for
|
476
|
+
# `!x.nil?` and autocorrects that and `x != nil` to solely `x`, which is
|
477
|
+
# **usually** OK, but might change behavior.
|
478
|
+
#
|
479
|
+
# With `IncludeSemanticChanges` set to `false`, this cop does not report
|
480
|
+
# offenses for `!x.nil?` and does no changes that might change behavior.
|
248
481
|
IncludeSemanticChanges: false
|
482
|
+
|
249
483
|
Style/MethodDefParentheses:
|
250
|
-
Description: Checks if the method definitions have or don't have parentheses.
|
251
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-parens
|
252
|
-
Enabled: true
|
253
484
|
EnforcedStyle: require_parentheses
|
254
485
|
SupportedStyles:
|
255
|
-
|
256
|
-
|
486
|
+
- require_parentheses
|
487
|
+
- require_no_parentheses
|
488
|
+
|
257
489
|
Style/MethodName:
|
258
|
-
Description: Use the configured style when naming methods.
|
259
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
|
260
|
-
Enabled: true
|
261
490
|
EnforcedStyle: snake_case
|
262
491
|
SupportedStyles:
|
263
|
-
|
264
|
-
|
492
|
+
- snake_case
|
493
|
+
- camelCase
|
494
|
+
|
265
495
|
Style/MultilineOperationIndentation:
|
266
|
-
|
267
|
-
Enabled: true
|
268
|
-
EnforcedStyle: aligned
|
496
|
+
EnforcedStyle: indented
|
269
497
|
SupportedStyles:
|
270
|
-
|
271
|
-
|
498
|
+
- aligned
|
499
|
+
- indented
|
500
|
+
|
272
501
|
Style/NumericLiterals:
|
273
|
-
Description: Add underscores to large numeric literals to improve their readability.
|
274
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics
|
275
|
-
Enabled: false
|
276
502
|
MinDigits: 5
|
503
|
+
|
504
|
+
# Allow safe assignment in conditions.
|
277
505
|
Style/ParenthesesAroundCondition:
|
278
|
-
Description: Don't use parentheses around the condition of an if/unless/while.
|
279
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-parens-if
|
280
|
-
Enabled: true
|
281
506
|
AllowSafeAssignment: true
|
507
|
+
|
282
508
|
Style/PercentLiteralDelimiters:
|
283
|
-
Description: Use `%`-literal delimiters consistently
|
284
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
|
285
|
-
Enabled: false
|
286
509
|
PreferredDelimiters:
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
510
|
+
'%': ()
|
511
|
+
'%i': ()
|
512
|
+
'%q': ()
|
513
|
+
'%Q': ()
|
514
|
+
'%r': '{}'
|
515
|
+
'%s': ()
|
516
|
+
'%w': ()
|
517
|
+
'%W': ()
|
518
|
+
'%x': ()
|
519
|
+
|
296
520
|
Style/PercentQLiterals:
|
297
|
-
|
298
|
-
Enabled: true
|
521
|
+
Enabled: false
|
299
522
|
EnforcedStyle: lower_case_q
|
300
523
|
SupportedStyles:
|
301
|
-
|
302
|
-
|
524
|
+
- lower_case_q # Use %q when possible, %Q when necessary
|
525
|
+
- upper_case_q # Always use %Q
|
526
|
+
|
303
527
|
Style/PredicateName:
|
304
|
-
|
305
|
-
|
306
|
-
Enabled: true
|
528
|
+
Enabled: false
|
529
|
+
# Predicate name prefices.
|
307
530
|
NamePrefix:
|
308
|
-
|
309
|
-
|
310
|
-
|
531
|
+
- is_
|
532
|
+
- has_
|
533
|
+
- have_
|
534
|
+
# Predicate name prefices that should be removed.
|
311
535
|
NamePrefixBlacklist:
|
312
|
-
|
536
|
+
- is_
|
537
|
+
- has_
|
538
|
+
- have_
|
539
|
+
|
313
540
|
Style/RaiseArgs:
|
314
|
-
Description: Checks the arguments passed to raise/fail.
|
315
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
|
316
541
|
Enabled: false
|
317
542
|
EnforcedStyle: exploded
|
318
543
|
SupportedStyles:
|
319
|
-
|
320
|
-
|
544
|
+
- compact # raise Exception.new(msg)
|
545
|
+
- exploded # raise Exception, msg
|
546
|
+
|
321
547
|
Style/RedundantReturn:
|
322
|
-
|
323
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-explicit-return
|
324
|
-
Enabled: true
|
548
|
+
# When true allows code like `return x, y`.
|
325
549
|
AllowMultipleReturnValues: false
|
550
|
+
|
551
|
+
# Use / or %r around regular expressions.
|
326
552
|
Style/RegexpLiteral:
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
553
|
+
EnforcedStyle: mixed
|
554
|
+
# slashes: Always use slashes.
|
555
|
+
# percent_r: Always use %r.
|
556
|
+
# mixed: Use slashes on single-line regexes, and %r on multi-line regexes.
|
557
|
+
SupportedStyles:
|
558
|
+
- slashes
|
559
|
+
- percent_r
|
560
|
+
- mixed
|
561
|
+
# If false, the cop will always recommend using %r if one or more slashes
|
562
|
+
# are found in the regexp string.
|
563
|
+
AllowInnerSlashes: false
|
564
|
+
|
333
565
|
Style/Semicolon:
|
334
|
-
|
335
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon
|
336
|
-
Enabled: true
|
566
|
+
# Allow ; to separate several expressions on the same line.
|
337
567
|
AllowAsExpressionSeparator: false
|
568
|
+
|
338
569
|
Style/SignalException:
|
339
|
-
Description: Checks for proper usage of fail and raise.
|
340
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
|
341
570
|
Enabled: false
|
342
571
|
EnforcedStyle: semantic
|
343
572
|
SupportedStyles:
|
344
|
-
|
345
|
-
|
346
|
-
|
573
|
+
- only_raise
|
574
|
+
- only_fail
|
575
|
+
- semantic
|
576
|
+
|
347
577
|
Style/SingleLineBlockParams:
|
348
|
-
Description: Enforces the names of some block params.
|
349
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks
|
350
|
-
Enabled: false
|
351
578
|
Methods:
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
579
|
+
- reduce:
|
580
|
+
- a
|
581
|
+
- e
|
582
|
+
- inject:
|
583
|
+
- a
|
584
|
+
- e
|
585
|
+
|
358
586
|
Style/SingleLineMethods:
|
359
|
-
Description: Avoid single-line methods.
|
360
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
|
361
|
-
Enabled: false
|
362
587
|
AllowIfMethodIsEmpty: true
|
588
|
+
|
589
|
+
Style/SingleSpaceBeforeFirstArg:
|
590
|
+
Enabled: false
|
591
|
+
|
363
592
|
Style/StringLiterals:
|
364
|
-
Description: Checks if uses of quotes match the configured preference.
|
365
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
|
366
593
|
Enabled: false
|
367
|
-
EnforcedStyle:
|
594
|
+
EnforcedStyle: single_quotes
|
368
595
|
SupportedStyles:
|
369
|
-
|
370
|
-
|
596
|
+
- single_quotes
|
597
|
+
- double_quotes
|
598
|
+
|
371
599
|
Style/StringLiteralsInInterpolation:
|
372
|
-
Description: Checks if uses of quotes inside expressions in interpolated strings
|
373
|
-
match the configured preference.
|
374
|
-
Enabled: true
|
375
600
|
EnforcedStyle: single_quotes
|
376
601
|
SupportedStyles:
|
377
|
-
|
378
|
-
|
602
|
+
- single_quotes
|
603
|
+
- double_quotes
|
604
|
+
|
379
605
|
Style/SpaceAroundBlockParameters:
|
380
|
-
Description: Checks the spacing inside and after block parameters pipes.
|
381
|
-
Enabled: true
|
382
606
|
EnforcedStyleInsidePipes: no_space
|
383
607
|
SupportedStyles:
|
384
|
-
|
385
|
-
|
608
|
+
- space
|
609
|
+
- no_space
|
610
|
+
|
386
611
|
Style/SpaceAroundEqualsInParameterDefault:
|
387
|
-
Description: Checks that the equals signs in parameter default assignments have
|
388
|
-
or don't have surrounding space depending on configuration.
|
389
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-around-equals
|
390
|
-
Enabled: true
|
391
612
|
EnforcedStyle: space
|
392
613
|
SupportedStyles:
|
393
|
-
|
394
|
-
|
614
|
+
- space
|
615
|
+
- no_space
|
616
|
+
|
617
|
+
Style/SpaceAroundOperators:
|
618
|
+
MultiSpaceAllowedForOperators:
|
619
|
+
- '='
|
620
|
+
- '=>'
|
621
|
+
|
395
622
|
Style/SpaceBeforeBlockBraces:
|
396
|
-
Description: Checks that the left block brace has or doesn't have space before it.
|
397
|
-
Enabled: true
|
398
623
|
EnforcedStyle: space
|
399
624
|
SupportedStyles:
|
400
|
-
|
401
|
-
|
625
|
+
- space
|
626
|
+
- no_space
|
627
|
+
|
402
628
|
Style/SpaceInsideBlockBraces:
|
403
|
-
Description: Checks that block braces have or don't have surrounding space. For
|
404
|
-
blocks taking parameters, checks that the left brace has or doesn't have trailing
|
405
|
-
space.
|
406
|
-
Enabled: true
|
407
629
|
EnforcedStyle: space
|
408
630
|
SupportedStyles:
|
409
|
-
|
410
|
-
|
631
|
+
- space
|
632
|
+
- no_space
|
633
|
+
# Valid values are: space, no_space
|
411
634
|
EnforcedStyleForEmptyBraces: no_space
|
635
|
+
# Space between { and |. Overrides EnforcedStyle if there is a conflict.
|
412
636
|
SpaceBeforeBlockParameters: true
|
637
|
+
|
413
638
|
Style/SpaceInsideHashLiteralBraces:
|
414
|
-
Description: Use spaces inside hash literal braces - or don't.
|
415
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
416
|
-
Enabled: true
|
417
639
|
EnforcedStyle: no_space
|
418
640
|
EnforcedStyleForEmptyBraces: no_space
|
419
641
|
SupportedStyles:
|
420
|
-
|
421
|
-
|
642
|
+
- space
|
643
|
+
- no_space
|
644
|
+
|
422
645
|
Style/SymbolProc:
|
423
|
-
|
424
|
-
|
646
|
+
# A list of method names to be ignored by the check.
|
647
|
+
# The names should be fairly unique, otherwise you'll end up ignoring lots of code.
|
425
648
|
IgnoredMethods:
|
426
|
-
|
649
|
+
- respond_to
|
650
|
+
|
427
651
|
Style/TrailingBlankLines:
|
428
|
-
Description: Checks trailing blank lines and final newline.
|
429
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#newline-eof
|
430
|
-
Enabled: true
|
431
652
|
EnforcedStyle: final_newline
|
432
653
|
SupportedStyles:
|
433
|
-
|
434
|
-
|
654
|
+
- final_newline
|
655
|
+
- final_blank_line
|
656
|
+
|
435
657
|
Style/TrailingComma:
|
436
|
-
|
437
|
-
|
438
|
-
|
658
|
+
# If EnforcedStyleForMultiline is comma, the cop requires a comma after the
|
659
|
+
# last item of a list, but only for lists where each item is on its own line.
|
660
|
+
# If EnforcedStyleForMultiline is consistent_comma, the cop requires a comma
|
661
|
+
# after the last item of a list, for all lists.
|
439
662
|
EnforcedStyleForMultiline: no_comma
|
440
663
|
SupportedStyles:
|
441
|
-
|
442
|
-
|
664
|
+
- comma
|
665
|
+
- consistent_comma
|
666
|
+
- no_comma
|
667
|
+
|
668
|
+
# TrivialAccessors requires exact name matches and doesn't allow
|
669
|
+
# predicated methods by default.
|
443
670
|
Style/TrivialAccessors:
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
671
|
+
# When set to false the cop will suggest the use of accessor methods
|
672
|
+
# in situations like:
|
673
|
+
#
|
674
|
+
# def name
|
675
|
+
# @other_name
|
676
|
+
# end
|
677
|
+
#
|
678
|
+
# This way you can uncover "hidden" attributes in your code.
|
679
|
+
ExactNameMatch: true
|
448
680
|
AllowPredicates: false
|
681
|
+
# Allows trivial writers that don't end in an equal sign. e.g.
|
682
|
+
#
|
683
|
+
# def on_exception(action)
|
684
|
+
# @on_exception=action
|
685
|
+
# end
|
686
|
+
# on_exception :restart
|
687
|
+
#
|
688
|
+
# Commonly used in DSLs
|
449
689
|
AllowDSLWriters: false
|
690
|
+
IgnoreClassMethods: false
|
450
691
|
Whitelist:
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
692
|
+
- to_ary
|
693
|
+
- to_a
|
694
|
+
- to_c
|
695
|
+
- to_enum
|
696
|
+
- to_h
|
697
|
+
- to_hash
|
698
|
+
- to_i
|
699
|
+
- to_int
|
700
|
+
- to_io
|
701
|
+
- to_open
|
702
|
+
- to_path
|
703
|
+
- to_proc
|
704
|
+
- to_r
|
705
|
+
- to_regexp
|
706
|
+
- to_str
|
707
|
+
- to_s
|
708
|
+
- to_sym
|
709
|
+
|
710
|
+
Style/UnneededCapitalW:
|
711
|
+
Enabled: false
|
712
|
+
|
468
713
|
Style/VariableName:
|
469
|
-
Description: Use the configured style when naming variables.
|
470
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
|
471
|
-
Enabled: true
|
472
714
|
EnforcedStyle: snake_case
|
473
715
|
SupportedStyles:
|
474
|
-
|
475
|
-
|
716
|
+
- snake_case
|
717
|
+
- camelCase
|
718
|
+
|
476
719
|
Style/WhileUntilModifier:
|
477
|
-
|
478
|
-
|
479
|
-
Enabled: false
|
480
|
-
MaxLineLength: 100
|
720
|
+
MaxLineLength: 80
|
721
|
+
|
481
722
|
Style/WordArray:
|
482
|
-
Description: Use %w or %W for arrays of words.
|
483
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-w
|
484
|
-
Enabled: false
|
485
723
|
MinSize: 0
|
486
|
-
WordRegex
|
724
|
+
# The regular expression WordRegex decides what is considered a word.
|
725
|
+
WordRegex: !ruby/regexp '/\A[\p{Word}]+\z/'
|
726
|
+
|
727
|
+
##################### Metrics ##################################
|
728
|
+
|
487
729
|
Metrics/AbcSize:
|
488
|
-
|
489
|
-
|
490
|
-
Enabled: true
|
730
|
+
# The ABC size is a calculated magnitude, so this number can be a Fixnum or
|
731
|
+
# a Float.
|
491
732
|
Max: 15
|
733
|
+
|
492
734
|
Metrics/BlockNesting:
|
493
|
-
Description: Avoid excessive block nesting
|
494
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count
|
495
|
-
Enabled: false
|
496
735
|
Max: 3
|
736
|
+
|
497
737
|
Metrics/ClassLength:
|
498
|
-
|
499
|
-
Enabled: false
|
500
|
-
CountComments: false
|
738
|
+
CountComments: false # count full line comments?
|
501
739
|
Max: 100
|
740
|
+
|
741
|
+
Metrics/ModuleLength:
|
742
|
+
CountComments: false # count full line comments?
|
743
|
+
Max: 100
|
744
|
+
|
745
|
+
# Avoid complex methods.
|
502
746
|
Metrics/CyclomaticComplexity:
|
503
|
-
Description: A complexity metric that is strongly correlated to the number of test
|
504
|
-
cases needed to validate a method.
|
505
|
-
Enabled: false
|
506
747
|
Max: 6
|
748
|
+
|
507
749
|
Metrics/LineLength:
|
508
|
-
Description: Limit lines to 100 characters.
|
509
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#80-character-limits
|
510
|
-
Enabled: true
|
511
750
|
Max: 100
|
751
|
+
# To make it possible to copy or click on URIs in the code, we allow lines
|
752
|
+
# contaning a URI to be longer than Max.
|
512
753
|
AllowURI: true
|
513
754
|
URISchemes:
|
514
|
-
|
515
|
-
|
755
|
+
- http
|
756
|
+
- https
|
757
|
+
|
516
758
|
Metrics/MethodLength:
|
517
|
-
|
518
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
|
519
|
-
Enabled: false
|
520
|
-
CountComments: false
|
759
|
+
CountComments: false # count full line comments?
|
521
760
|
Max: 10
|
761
|
+
|
522
762
|
Metrics/ParameterLists:
|
523
|
-
Description: Avoid parameter lists longer than three or four parameters.
|
524
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
|
525
|
-
Enabled: false
|
526
763
|
Max: 5
|
527
764
|
CountKeywordArgs: true
|
765
|
+
|
528
766
|
Metrics/PerceivedComplexity:
|
529
|
-
Description: A complexity metric geared towards measuring complexity for a human
|
530
|
-
reader.
|
531
|
-
Enabled: false
|
532
767
|
Max: 7
|
768
|
+
|
769
|
+
##################### Lint ##################################
|
770
|
+
|
771
|
+
# Allow safe assignment in conditions.
|
533
772
|
Lint/AssignmentInCondition:
|
534
|
-
Description: Don't use assignment in conditions.
|
535
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
|
536
|
-
Enabled: false
|
537
773
|
AllowSafeAssignment: true
|
774
|
+
|
775
|
+
# Align ends correctly.
|
538
776
|
Lint/EndAlignment:
|
539
|
-
|
540
|
-
|
777
|
+
# The value `keyword` means that `end` should be aligned with the matching
|
778
|
+
# keyword (if, while, etc.).
|
779
|
+
# The value `variable` means that in assignments, `end` should be aligned
|
780
|
+
# with the start of the variable on the left hand side of `=`. In all other
|
781
|
+
# situations, `end` should still be aligned with the keyword.
|
541
782
|
AlignWith: keyword
|
542
783
|
SupportedStyles:
|
543
|
-
|
544
|
-
|
784
|
+
- keyword
|
785
|
+
- variable
|
786
|
+
AutoCorrect: false
|
787
|
+
|
545
788
|
Lint/DefEndAlignment:
|
546
|
-
|
547
|
-
|
789
|
+
# The value `def` means that `end` should be aligned with the def keyword.
|
790
|
+
# The value `start_of_line` means that `end` should be aligned with method
|
791
|
+
# calls like `private`, `public`, etc, if present in front of the `def`
|
792
|
+
# keyword on the same line.
|
548
793
|
AlignWith: start_of_line
|
549
794
|
SupportedStyles:
|
550
|
-
|
551
|
-
|
795
|
+
- start_of_line
|
796
|
+
- def
|
797
|
+
AutoCorrect: false
|
798
|
+
|
799
|
+
##################### Rails ##################################
|
800
|
+
|
552
801
|
Rails/ActionFilter:
|
553
|
-
Description: Enforces consistent use of action filter methods.
|
554
|
-
Enabled: false
|
555
802
|
EnforcedStyle: action
|
556
803
|
SupportedStyles:
|
557
|
-
|
558
|
-
|
804
|
+
- action
|
805
|
+
- filter
|
559
806
|
Include:
|
560
|
-
|
807
|
+
- app/controllers/**/*.rb
|
808
|
+
|
809
|
+
Rails/Date:
|
810
|
+
# The value `always` disallows usage of `Date.today`, `Date.current`,
|
811
|
+
# `Date#to_time` etc.
|
812
|
+
# The value `acceptable` allows usage of `Date.current`, `Date.yesterday`, etc
|
813
|
+
# (but not `Date.today`) which are overriden by ActiveSupport to handle current
|
814
|
+
# time zone.
|
815
|
+
EnforcedStyle: always
|
816
|
+
SupportedStyles:
|
817
|
+
- always
|
818
|
+
- acceptable
|
819
|
+
|
561
820
|
Rails/DefaultScope:
|
562
|
-
Description: Checks if the argument passed to default_scope is a block.
|
563
|
-
Enabled: true
|
564
821
|
Include:
|
565
|
-
|
822
|
+
- app/models/**/*.rb
|
823
|
+
|
824
|
+
Rails/FindBy:
|
825
|
+
Include:
|
826
|
+
- app/models/**/*.rb
|
827
|
+
|
828
|
+
Rails/FindEach:
|
829
|
+
Include:
|
830
|
+
- app/models/**/*.rb
|
831
|
+
|
566
832
|
Rails/HasAndBelongsToMany:
|
567
|
-
Description: Prefer has_many :through to has_and_belongs_to_many.
|
568
|
-
Enabled: true
|
569
833
|
Include:
|
570
|
-
|
834
|
+
- app/models/**/*.rb
|
835
|
+
|
571
836
|
Rails/Output:
|
572
|
-
Description: Checks for calls to puts, print, etc.
|
573
|
-
Enabled: true
|
574
837
|
Include:
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
838
|
+
- app/**/*.rb
|
839
|
+
- config/**/*.rb
|
840
|
+
- db/**/*.rb
|
841
|
+
- lib/**/*.rb
|
842
|
+
|
579
843
|
Rails/ReadWriteAttribute:
|
580
|
-
Description: Checks for read_attribute(:attr) and write_attribute(:attr, val).
|
581
|
-
Enabled: true
|
582
844
|
Include:
|
583
|
-
|
845
|
+
- app/models/**/*.rb
|
846
|
+
|
584
847
|
Rails/ScopeArgs:
|
585
|
-
Description: Checks the arguments of ActiveRecord scopes.
|
586
|
-
Enabled: true
|
587
848
|
Include:
|
588
|
-
|
849
|
+
- app/models/**/*.rb
|
850
|
+
|
851
|
+
Rails/TimeZone:
|
852
|
+
# The value `always` means that `Time` should be used with `zone`.
|
853
|
+
# The value `acceptable` allows usage of `in_time_zone` instead of `zone`.
|
854
|
+
EnforcedStyle: always
|
855
|
+
SupportedStyles:
|
856
|
+
- always
|
857
|
+
- acceptable
|
858
|
+
|
589
859
|
Rails/Validation:
|
590
|
-
Description: Use validates :attribute, hash of validations.
|
591
|
-
Enabled: true
|
592
860
|
Include:
|
593
|
-
|
594
|
-
Style/InlineComment:
|
595
|
-
Description: Avoid inline comments.
|
596
|
-
Enabled: false
|
597
|
-
Style/MethodCalledOnDoEndBlock:
|
598
|
-
Description: Avoid chaining a method call on a do...end block.
|
599
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
|
600
|
-
Enabled: false
|
601
|
-
Style/SymbolArray:
|
602
|
-
Description: Use %i or %I for arrays of symbols.
|
603
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-i
|
604
|
-
Enabled: false
|
605
|
-
Style/ExtraSpacing:
|
606
|
-
Description: Do not use unnecessary spacing.
|
607
|
-
Enabled: true
|
608
|
-
Style/AccessorMethodName:
|
609
|
-
Description: Check the naming of accessor methods for get_/set_.
|
610
|
-
Enabled: false
|
611
|
-
Style/Alias:
|
612
|
-
Description: Use alias_method instead of alias.
|
613
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
|
614
|
-
Enabled: false
|
615
|
-
Style/AlignArray:
|
616
|
-
Description: Align the elements of an array literal if they span more than one line.
|
617
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays
|
618
|
-
Enabled: true
|
619
|
-
Style/ArrayJoin:
|
620
|
-
Description: Use Array#join instead of Array#*.
|
621
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#array-join
|
622
|
-
Enabled: false
|
623
|
-
Style/AsciiComments:
|
624
|
-
Description: Use only ascii symbols in comments.
|
625
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-comments
|
626
|
-
Enabled: false
|
627
|
-
Style/AsciiIdentifiers:
|
628
|
-
Description: Use only ascii symbols in identifiers.
|
629
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-identifiers
|
630
|
-
Enabled: false
|
631
|
-
Style/Attr:
|
632
|
-
Description: Checks for uses of Module#attr.
|
633
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr
|
634
|
-
Enabled: false
|
635
|
-
Style/BeginBlock:
|
636
|
-
Description: Avoid the use of BEGIN blocks.
|
637
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks
|
638
|
-
Enabled: true
|
639
|
-
Style/BlockComments:
|
640
|
-
Description: Do not use block comments.
|
641
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-block-comments
|
642
|
-
Enabled: true
|
643
|
-
Style/BlockEndNewline:
|
644
|
-
Description: Put end statement of multiline block on its own line.
|
645
|
-
Enabled: true
|
646
|
-
Style/Blocks:
|
647
|
-
Description: Avoid using {...} for multi-line blocks (multiline chaining is always
|
648
|
-
ugly). Prefer {...} over do...end for single-line blocks.
|
649
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
|
650
|
-
Enabled: true
|
651
|
-
Style/CaseEquality:
|
652
|
-
Description: Avoid explicit use of the case equality operator(===).
|
653
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-case-equality
|
654
|
-
Enabled: false
|
655
|
-
Style/CharacterLiteral:
|
656
|
-
Description: Checks for uses of character literals.
|
657
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-character-literals
|
658
|
-
Enabled: false
|
659
|
-
Style/ClassAndModuleCamelCase:
|
660
|
-
Description: Use CamelCase for classes and modules.
|
661
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#camelcase-classes
|
662
|
-
Enabled: true
|
663
|
-
Style/ClassMethods:
|
664
|
-
Description: Use self when defining module/class methods.
|
665
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#def-self-singletons
|
666
|
-
Enabled: true
|
667
|
-
Style/ClassVars:
|
668
|
-
Description: Avoid the use of class variables.
|
669
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-class-vars
|
670
|
-
Enabled: false
|
671
|
-
Style/ColonMethodCall:
|
672
|
-
Description: 'Do not use :: for method call.'
|
673
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#double-colons
|
674
|
-
Enabled: false
|
675
|
-
Style/CommentIndentation:
|
676
|
-
Description: Indentation of comments.
|
677
|
-
Enabled: true
|
678
|
-
Style/ConstantName:
|
679
|
-
Description: Constants should use SCREAMING_SNAKE_CASE.
|
680
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#screaming-snake-case
|
681
|
-
Enabled: true
|
682
|
-
Style/DefWithParentheses:
|
683
|
-
Description: Use def with parentheses when there are arguments.
|
684
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-parens
|
685
|
-
Enabled: true
|
686
|
-
Style/DeprecatedHashMethods:
|
687
|
-
Description: Checks for use of deprecated Hash methods.
|
688
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-key
|
689
|
-
Enabled: false
|
690
|
-
Style/Documentation:
|
691
|
-
Description: Document classes and non-namespace modules.
|
692
|
-
Enabled: false
|
693
|
-
Style/DoubleNegation:
|
694
|
-
Description: Checks for uses of double negation (!!).
|
695
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
|
696
|
-
Enabled: false
|
697
|
-
Style/EachWithObject:
|
698
|
-
Description: Prefer `each_with_object` over `inject` or `reduce`.
|
699
|
-
Enabled: false
|
700
|
-
Style/ElseAlignment:
|
701
|
-
Description: Align elses and elsifs correctly.
|
702
|
-
Enabled: true
|
703
|
-
Style/EmptyElse:
|
704
|
-
Description: Avoid empty else-clauses.
|
705
|
-
Enabled: true
|
706
|
-
Style/EmptyLines:
|
707
|
-
Description: Don't use several empty lines in a row.
|
708
|
-
Enabled: true
|
709
|
-
Style/EmptyLinesAroundAccessModifier:
|
710
|
-
Description: Keep blank lines around access modifiers.
|
711
|
-
Enabled: true
|
712
|
-
Style/EmptyLinesAroundMethodBody:
|
713
|
-
Description: Keeps track of empty lines around method bodies.
|
714
|
-
Enabled: true
|
715
|
-
Style/EmptyLiteral:
|
716
|
-
Description: Prefer literals to Array.new/Hash.new/String.new.
|
717
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
|
718
|
-
Enabled: false
|
719
|
-
Style/EndBlock:
|
720
|
-
Description: Avoid the use of END blocks.
|
721
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-END-blocks
|
722
|
-
Enabled: true
|
723
|
-
Style/EndOfLine:
|
724
|
-
Description: Use Unix-style line endings.
|
725
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#crlf
|
726
|
-
Enabled: true
|
727
|
-
Style/EvenOdd:
|
728
|
-
Description: Favor the use of Fixnum#even? && Fixnum#odd?
|
729
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
|
730
|
-
Enabled: false
|
731
|
-
Style/FlipFlop:
|
732
|
-
Description: Checks for flip flops
|
733
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-flip-flops
|
734
|
-
Enabled: false
|
735
|
-
Style/IfWithSemicolon:
|
736
|
-
Description: Do not use if x; .... Use the ternary operator instead.
|
737
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs
|
738
|
-
Enabled: false
|
739
|
-
Style/IndentationConsistency:
|
740
|
-
Description: Keep indentation straight.
|
741
|
-
Enabled: true
|
742
|
-
Style/IndentArray:
|
743
|
-
Description: Checks the indentation of the first element in an array literal.
|
744
|
-
Enabled: true
|
745
|
-
Style/InfiniteLoop:
|
746
|
-
Description: Use Kernel#loop for infinite loops.
|
747
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#infinite-loop
|
748
|
-
Enabled: true
|
749
|
-
Style/Lambda:
|
750
|
-
Description: Use the new lambda literal syntax for single-line blocks.
|
751
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#lambda-multi-line
|
752
|
-
Enabled: false
|
753
|
-
Style/LeadingCommentSpace:
|
754
|
-
Description: Comments should start with a space.
|
755
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-space
|
756
|
-
Enabled: true
|
757
|
-
Style/LineEndConcatenation:
|
758
|
-
Description: Use \ instead of + or << to concatenate two string literals at line
|
759
|
-
end.
|
760
|
-
Enabled: false
|
761
|
-
Style/MethodCallParentheses:
|
762
|
-
Description: Do not use parentheses for method calls with no arguments.
|
763
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-args-no-parens
|
764
|
-
Enabled: true
|
765
|
-
Style/ModuleFunction:
|
766
|
-
Description: Checks for usage of `extend self` in modules.
|
767
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
|
768
|
-
Enabled: false
|
769
|
-
Style/MultilineBlockChain:
|
770
|
-
Description: Avoid multi-line chains of blocks.
|
771
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
|
772
|
-
Enabled: true
|
773
|
-
Style/MultilineBlockLayout:
|
774
|
-
Description: Ensures newlines after multiline block do statements.
|
775
|
-
Enabled: true
|
776
|
-
Style/MultilineIfThen:
|
777
|
-
Description: Do not use then for multi-line if/unless.
|
778
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-then
|
779
|
-
Enabled: true
|
780
|
-
Style/MultilineTernaryOperator:
|
781
|
-
Description: 'Avoid multi-line ?: (the ternary operator); use if/unless instead.'
|
782
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary
|
783
|
-
Enabled: true
|
784
|
-
Style/NegatedIf:
|
785
|
-
Description: Favor unless over if for negative conditions (or control flow or).
|
786
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#unless-for-negatives
|
787
|
-
Enabled: false
|
788
|
-
Style/NegatedWhile:
|
789
|
-
Description: Favor until over while for negative conditions.
|
790
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#until-for-negatives
|
791
|
-
Enabled: false
|
792
|
-
Style/NestedTernaryOperator:
|
793
|
-
Description: Use one expression per branch in a ternary operator.
|
794
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-ternary
|
795
|
-
Enabled: true
|
796
|
-
Style/NilComparison:
|
797
|
-
Description: Prefer x.nil? to x == nil.
|
798
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
|
799
|
-
Enabled: false
|
800
|
-
Style/Not:
|
801
|
-
Description: Use ! instead of not.
|
802
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#bang-not-not
|
803
|
-
Enabled: false
|
804
|
-
Style/OneLineConditional:
|
805
|
-
Description: Favor the ternary operator(?:) over if/then/else/end constructs.
|
806
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
|
807
|
-
Enabled: false
|
808
|
-
Style/OpMethod:
|
809
|
-
Description: When defining binary operators, name the argument other.
|
810
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#other-arg
|
811
|
-
Enabled: false
|
812
|
-
Style/PerlBackrefs:
|
813
|
-
Description: Avoid Perl-style regex back references.
|
814
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
|
815
|
-
Enabled: false
|
816
|
-
Style/Proc:
|
817
|
-
Description: Use proc instead of Proc.new.
|
818
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc
|
819
|
-
Enabled: false
|
820
|
-
Style/RedundantBegin:
|
821
|
-
Description: Don't use begin blocks when they are not needed.
|
822
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#begin-implicit
|
823
|
-
Enabled: true
|
824
|
-
Style/RedundantException:
|
825
|
-
Description: Checks for an obsolete RuntimeException argument in raise/fail.
|
826
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror
|
827
|
-
Enabled: true
|
828
|
-
Style/RedundantSelf:
|
829
|
-
Description: Don't use self where it's not needed.
|
830
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-self-unless-required
|
831
|
-
Enabled: true
|
832
|
-
Style/RescueModifier:
|
833
|
-
Description: Avoid using rescue in its modifier form.
|
834
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers
|
835
|
-
Enabled: true
|
836
|
-
Style/SelfAssignment:
|
837
|
-
Description: Checks for places where self-assignment shorthand should have been
|
838
|
-
used.
|
839
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#self-assignment
|
840
|
-
Enabled: false
|
841
|
-
Style/SingleSpaceBeforeFirstArg:
|
842
|
-
Description: Checks that exactly one space is used between a method name and the
|
843
|
-
first argument for method calls without parentheses.
|
844
|
-
Enabled: true
|
845
|
-
Style/SpaceAfterColon:
|
846
|
-
Description: Use spaces after colons.
|
847
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
848
|
-
Enabled: true
|
849
|
-
Style/SpaceAfterComma:
|
850
|
-
Description: Use spaces after commas.
|
851
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
852
|
-
Enabled: true
|
853
|
-
Style/SpaceAfterControlKeyword:
|
854
|
-
Description: Use spaces after if/elsif/unless/while/until/case/when.
|
855
|
-
Enabled: true
|
856
|
-
Style/SpaceAfterMethodName:
|
857
|
-
Description: Do not put a space between a method name and the opening parenthesis
|
858
|
-
in a method definition.
|
859
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
|
860
|
-
Enabled: true
|
861
|
-
Style/SpaceAfterNot:
|
862
|
-
Description: Tracks redundant space after the ! operator.
|
863
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-bang
|
864
|
-
Enabled: true
|
865
|
-
Style/SpaceAfterSemicolon:
|
866
|
-
Description: Use spaces after semicolons.
|
867
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
868
|
-
Enabled: true
|
869
|
-
Style/SpaceBeforeComma:
|
870
|
-
Description: No spaces before commas.
|
871
|
-
Enabled: true
|
872
|
-
Style/SpaceBeforeComment:
|
873
|
-
Description: Checks for missing space between code and a comment on the same line.
|
874
|
-
Enabled: true
|
875
|
-
Style/SpaceBeforeSemicolon:
|
876
|
-
Description: No spaces before semicolons.
|
877
|
-
Enabled: true
|
878
|
-
Style/SpaceAroundOperators:
|
879
|
-
Description: Use spaces around operators.
|
880
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
881
|
-
Enabled: true
|
882
|
-
Style/SpaceBeforeModifierKeyword:
|
883
|
-
Description: Put a space before the modifier keyword.
|
884
|
-
Enabled: true
|
885
|
-
Style/SpaceInsideBrackets:
|
886
|
-
Description: No spaces after [ or before ].
|
887
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
|
888
|
-
Enabled: true
|
889
|
-
Style/SpaceInsideParens:
|
890
|
-
Description: No spaces after ( or before ).
|
891
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
|
892
|
-
Enabled: true
|
893
|
-
Style/SpaceInsideRangeLiteral:
|
894
|
-
Description: No spaces inside range literals.
|
895
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals
|
896
|
-
Enabled: true
|
897
|
-
Style/SpecialGlobalVars:
|
898
|
-
Description: Avoid Perl-style global variables.
|
899
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
|
900
|
-
Enabled: false
|
901
|
-
Style/StructInheritance:
|
902
|
-
Description: Checks for inheritance from Struct.new.
|
903
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new
|
904
|
-
Enabled: true
|
905
|
-
Style/Tab:
|
906
|
-
Description: No hard tabs.
|
907
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
|
908
|
-
Enabled: true
|
909
|
-
Style/TrailingWhitespace:
|
910
|
-
Description: Avoid trailing whitespace.
|
911
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace
|
912
|
-
Enabled: true
|
913
|
-
Style/UnlessElse:
|
914
|
-
Description: Do not use unless with else. Rewrite these with the positive case first.
|
915
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-else-with-unless
|
916
|
-
Enabled: true
|
917
|
-
Style/UnneededCapitalW:
|
918
|
-
Description: Checks for %W when interpolation is not needed.
|
919
|
-
Enabled: true
|
920
|
-
Style/UnneededPercentQ:
|
921
|
-
Description: Checks for %q/%Q when single quotes or double quotes would do.
|
922
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q
|
923
|
-
Enabled: true
|
924
|
-
Style/UnneededPercentX:
|
925
|
-
Description: Checks for %x when `` would do.
|
926
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-x
|
927
|
-
Enabled: true
|
928
|
-
Style/VariableInterpolation:
|
929
|
-
Description: Don't interpolate global, instance and class variables directly in
|
930
|
-
strings.
|
931
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
|
932
|
-
Enabled: false
|
933
|
-
Style/WhenThen:
|
934
|
-
Description: Use when x then ... for one-line cases.
|
935
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
|
936
|
-
Enabled: false
|
937
|
-
Style/WhileUntilDo:
|
938
|
-
Description: Checks for redundant do after while or until.
|
939
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do
|
940
|
-
Enabled: true
|
941
|
-
Lint/AmbiguousOperator:
|
942
|
-
Description: Checks for ambiguous operators in the first argument of a method invocation
|
943
|
-
without parentheses.
|
944
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-as-args
|
945
|
-
Enabled: false
|
946
|
-
Lint/AmbiguousRegexpLiteral:
|
947
|
-
Description: Checks for ambiguous regexp literals in the first argument of a method
|
948
|
-
invocation without parenthesis.
|
949
|
-
Enabled: false
|
950
|
-
Lint/BlockAlignment:
|
951
|
-
Description: Align block ends correctly.
|
952
|
-
Enabled: true
|
953
|
-
Lint/ConditionPosition:
|
954
|
-
Description: Checks for condition placed in a confusing position relative to the
|
955
|
-
keyword.
|
956
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#same-line-condition
|
957
|
-
Enabled: false
|
958
|
-
Lint/Debugger:
|
959
|
-
Description: Check for debugger calls.
|
960
|
-
Enabled: true
|
961
|
-
Lint/DeprecatedClassMethods:
|
962
|
-
Description: Check for deprecated class method calls.
|
963
|
-
Enabled: false
|
964
|
-
Lint/DuplicateMethods:
|
965
|
-
Description: Check for duplicate methods calls.
|
966
|
-
Enabled: true
|
967
|
-
Lint/ElseLayout:
|
968
|
-
Description: Check for odd code arrangement in an else block.
|
969
|
-
Enabled: false
|
970
|
-
Lint/EmptyEnsure:
|
971
|
-
Description: Checks for empty ensure block.
|
972
|
-
Enabled: true
|
973
|
-
Lint/EmptyInterpolation:
|
974
|
-
Description: Checks for empty string interpolation.
|
975
|
-
Enabled: true
|
976
|
-
Lint/EndInMethod:
|
977
|
-
Description: END blocks should not be placed inside method definitions.
|
978
|
-
Enabled: true
|
979
|
-
Lint/EnsureReturn:
|
980
|
-
Description: Do not use return in an ensure block.
|
981
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-return-ensure
|
982
|
-
Enabled: true
|
983
|
-
Lint/Eval:
|
984
|
-
Description: The use of eval represents a serious security risk.
|
985
|
-
Enabled: true
|
986
|
-
Lint/HandleExceptions:
|
987
|
-
Description: Don't suppress exception.
|
988
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
|
989
|
-
Enabled: false
|
990
|
-
Lint/InvalidCharacterLiteral:
|
991
|
-
Description: Checks for invalid character literals with a non-escaped whitespace
|
992
|
-
character.
|
993
|
-
Enabled: false
|
994
|
-
Lint/LiteralInCondition:
|
995
|
-
Description: Checks of literals used in conditions.
|
996
|
-
Enabled: false
|
997
|
-
Lint/LiteralInInterpolation:
|
998
|
-
Description: Checks for literals used in interpolation.
|
999
|
-
Enabled: false
|
1000
|
-
Lint/Loop:
|
1001
|
-
Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while
|
1002
|
-
for post-loop tests.
|
1003
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#loop-with-break
|
1004
|
-
Enabled: false
|
1005
|
-
Lint/ParenthesesAsGroupedExpression:
|
1006
|
-
Description: Checks for method calls with a space before the opening parenthesis.
|
1007
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
|
1008
|
-
Enabled: false
|
1009
|
-
Lint/RequireParentheses:
|
1010
|
-
Description: Use parentheses in the method call to avoid confusion about precedence.
|
1011
|
-
Enabled: false
|
1012
|
-
Lint/RescueException:
|
1013
|
-
Description: Avoid rescuing the Exception class.
|
1014
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-blind-rescues
|
1015
|
-
Enabled: true
|
1016
|
-
Lint/ShadowingOuterLocalVariable:
|
1017
|
-
Description: Do not use the same name as outer local variable for block arguments
|
1018
|
-
or block local variables.
|
1019
|
-
Enabled: true
|
1020
|
-
Lint/SpaceBeforeFirstArg:
|
1021
|
-
Description: Put a space between a method name and the first argument in a method
|
1022
|
-
call without parentheses.
|
1023
|
-
Enabled: true
|
1024
|
-
Lint/StringConversionInInterpolation:
|
1025
|
-
Description: Checks for Object#to_s usage in string interpolation.
|
1026
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-to-s
|
1027
|
-
Enabled: true
|
1028
|
-
Lint/UnderscorePrefixedVariableName:
|
1029
|
-
Description: Do not use prefix `_` for a variable that is used.
|
1030
|
-
Enabled: false
|
1031
|
-
Lint/UnusedBlockArgument:
|
1032
|
-
Description: Checks for unused block arguments.
|
1033
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
|
1034
|
-
Enabled: true
|
1035
|
-
Lint/UnusedMethodArgument:
|
1036
|
-
Description: Checks for unused method arguments.
|
1037
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
|
1038
|
-
Enabled: true
|
1039
|
-
Lint/UnreachableCode:
|
1040
|
-
Description: Unreachable code.
|
1041
|
-
Enabled: true
|
1042
|
-
Lint/UselessAccessModifier:
|
1043
|
-
Description: Checks for useless access modifiers.
|
1044
|
-
Enabled: true
|
1045
|
-
Lint/UselessAssignment:
|
1046
|
-
Description: Checks for useless assignment to a local variable.
|
1047
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
|
1048
|
-
Enabled: true
|
1049
|
-
Lint/UselessComparison:
|
1050
|
-
Description: Checks for comparison of something with itself.
|
1051
|
-
Enabled: true
|
1052
|
-
Lint/UselessElseWithoutRescue:
|
1053
|
-
Description: Checks for useless `else` in `begin..end` without `rescue`.
|
1054
|
-
Enabled: true
|
1055
|
-
Lint/UselessSetterCall:
|
1056
|
-
Description: Checks for useless setter call to a local variable.
|
1057
|
-
Enabled: true
|
1058
|
-
Lint/Void:
|
1059
|
-
Description: Possible use of operator/literal/variable in void context.
|
1060
|
-
Enabled: false
|
1061
|
-
Rails/Delegate:
|
1062
|
-
Description: Prefer delegate method for delegations.
|
1063
|
-
Enabled: false
|
861
|
+
- app/models/**/*.rb
|