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