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