gazelle_styleguide 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ Mjg3ODdhOGUyZGUyOWM0NTZiMmJmZmNkM2RmYzI3ZDkyMGRiMWYxNw==
5
+ data.tar.gz: !binary |-
6
+ OGRmNjI1ZDYzZjY3MGRmNmMxNmJmNDA2MzA1OWQ1YTNhYjQ0OTIxNA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ MzJhMzE1ODk0NDBiZjcwNzQ4Y2MwOGRhMjUyZDI0YTI5NGJhZmZkMTQwZGU3
10
+ NzNhMzM1NDIwODQ1OWFkMDM0NmNhZDc1MDhkZDIyZDcyYWQxNmJiMjA5OGIy
11
+ YjAwNWE3MTlkOGI0MmQ0ZDc1ZmE1MWUwZGUzNDQ3MzUzOWNkNWM=
12
+ data.tar.gz: !binary |-
13
+ OTM4Njg3NmVjMDVkYzJmYmE1NTQ2N2ZmZjk2MTZlOGNjMDAyOWIxM2M5YTVm
14
+ NzFjNmMzMWJlNGJlZjM0NmIxMmNhZmU0ODFhYjZmY2MwODQ3YTQ3YTZhYTAw
15
+ MmNkOTlhYjhkZjAyMDFkNmVkYTIyNWQ2ZGVlYTJmZTZjMTQ4N2U=
data/.hound.yml ADDED
@@ -0,0 +1,471 @@
1
+ # Common configuration.
2
+ AllCops:
3
+ # Include gemspec and Rakefile
4
+ Include:
5
+ - '**/*.gemspec'
6
+ - '**/Rakefile'
7
+ - '**/*.rake'
8
+ - '**/Gemfile'
9
+ Exclude:
10
+ - 'vendor/**'
11
+ RunRailsCops: true
12
+
13
+ # Indent private/protected/public as deep as method definitions
14
+ AccessModifierIndentation:
15
+ EnforcedStyle: outdent
16
+ SupportedStyles:
17
+ - outdent
18
+ - indent
19
+
20
+ # Indentation of `when`.
21
+ CaseIndentation:
22
+ IndentWhenRelativeTo: end
23
+ SupportedStyles:
24
+ - case
25
+ - end
26
+ IndentOneStep: false
27
+
28
+ ClassLength:
29
+ CountComments: false # count full line comments?
30
+ Max: 200
31
+
32
+ # Align ends correctly.
33
+ EndAlignment:
34
+ # The value `keyword` means that `end` should be aligned with the matching
35
+ # keyword (if, while, etc.).
36
+ # The value `variable` means that in assignments, `end` should be aligned
37
+ # with the start of the variable on the left hand side of `=`. In all other
38
+ # situations, `end` should still be aligned with the keyword.
39
+ AlignWith: variable
40
+ SupportedStyles:
41
+ - keyword
42
+ - variable
43
+
44
+ # Built-in global variables are allowed by default.
45
+ GlobalVars:
46
+ AllowedVariables: ['$1', '$2', '$3', '$4', '$5', '$6']
47
+
48
+ LineLength:
49
+ Max: 120
50
+
51
+ MethodLength:
52
+ CountComments: false # count full line comments?
53
+ Max: 20
54
+
55
+ NumericLiterals:
56
+ MinDigits: 10
57
+
58
+ SignalException:
59
+ EnforcedStyle: only_raise
60
+ SupportedStyles:
61
+ - only_raise
62
+ - only_fail
63
+ - semantic
64
+
65
+ SpaceBeforeBlockBraces:
66
+ EnforcedStyle: no_space
67
+ SupportedStyles:
68
+ - space
69
+ - no_space
70
+
71
+ SpaceInsideBlockBraces:
72
+ EnforcedStyle: no_space
73
+ SupportedStyles:
74
+ - space
75
+ - no_space
76
+ # Valid values are: space, no_space
77
+ EnforcedStyleForEmptyBraces: no_space
78
+ # Space between { and |. Overrides EnforcedStyle if there is a conflict.
79
+ SpaceBeforeBlockParameters: false
80
+
81
+ SpaceInsideHashLiteralBraces:
82
+ EnforcedStyle: no_space
83
+ EnforcedStyleForEmptyBraces: no_space
84
+ SupportedStyles:
85
+ - space
86
+ - no_space
87
+
88
+ WordArray:
89
+ MinSize: 0
90
+
91
+ ##########################################################################
92
+ ####################### DEFAULTS FROM RUBOCOP ############################
93
+ ##########################################################################
94
+
95
+ # Align the elements of a hash literal if they span more than one line.
96
+ AlignHash:
97
+ # Alignment of entries using hash rocket as separator. Valid values are:
98
+ #
99
+ # key - left alignment of keys
100
+ # 'a' => 2
101
+ # 'bb' => 3
102
+ # separator - alignment of hash rockets, keys are right aligned
103
+ # 'a' => 2
104
+ # 'bb' => 3
105
+ # table - left alignment of keys, hash rockets, and values
106
+ # 'a' => 2
107
+ # 'bb' => 3
108
+ EnforcedHashRocketStyle: key
109
+ # Alignment of entries using colon as separator. Valid values are:
110
+ #
111
+ # key - left alignment of keys
112
+ # a: 0
113
+ # bb: 1
114
+ # separator - alignment of colons, keys are right aligned
115
+ # a: 0
116
+ # bb: 1
117
+ # table - left alignment of keys and values
118
+ # a: 0
119
+ # bb: 1
120
+ EnforcedColonStyle: key
121
+ # Select whether hashes that are the last argument in a method call should be
122
+ # inspected? Valid values are:
123
+ #
124
+ # always_inspect - Inspect both implicit and explicit hashes.
125
+ # Registers and offence for:
126
+ # function(a: 1,
127
+ # b: 2)
128
+ # Registers an offence for:
129
+ # function({a: 1,
130
+ # b: 2})
131
+ # always_ignore - Ignore both implicit and explicit hashes.
132
+ # Accepts:
133
+ # function(a: 1,
134
+ # b: 2)
135
+ # Accepts:
136
+ # function({a: 1,
137
+ # b: 2})
138
+ # ignore_implicit - Ingore only implicit hashes.
139
+ # Accepts:
140
+ # function(a: 1,
141
+ # b: 2)
142
+ # Registers an offence for:
143
+ # function({a: 1,
144
+ # b: 2})
145
+ # ignore_explicit - Ingore only explicit hashes.
146
+ # Accepts:
147
+ # function({a: 1,
148
+ # b: 2})
149
+ # Registers an offence for:
150
+ # function(a: 1,
151
+ # b: 2)
152
+ EnforcedLastArgumentHashStyle: always_inspect
153
+ SupportedLastArgumentHashStyles:
154
+ - always_inspect
155
+ - always_ignore
156
+ - ignore_implicit
157
+ - ignore_explicit
158
+
159
+ AlignParameters:
160
+ # Alignment of parameters in multi-line method calls.
161
+ #
162
+ # The `with_first_parameter` style aligns the following lines along the same column
163
+ # as the first parameter.
164
+ #
165
+ # method_call(a,
166
+ # b)
167
+ #
168
+ # The `with_fixed_indentation` style alignes the following lines with one
169
+ # level of indenation relative to the start of the line with the method call.
170
+ #
171
+ # method_call(a,
172
+ # b)
173
+ EnforcedStyle: with_first_parameter
174
+ SupportedStyles:
175
+ - with_first_parameter
176
+ - with_fixed_indentation
177
+
178
+ # Allow safe assignment in conditions.
179
+ AssignmentInCondition:
180
+ AllowSafeAssignment: true
181
+
182
+ BlockNesting:
183
+ Max: 3
184
+
185
+ BracesAroundHashParameters:
186
+ EnforcedStyle: no_braces
187
+ SupportedStyles:
188
+ - braces
189
+ - no_braces
190
+
191
+ ClassAndModuleChildren:
192
+ # Checks the style of children definitions at classes and modules.
193
+ #
194
+ # Basically there are two different styles:
195
+ #
196
+ # `nested` - have each child on a separat line
197
+ # class Foo
198
+ # class Bar
199
+ # end
200
+ # end
201
+ #
202
+ # `compact` - combine definitions as much as possible
203
+ # class Foo::Bar
204
+ # end
205
+ #
206
+ # The compact style is only forced, for classes / modules with one child.
207
+ EnforcedStyle: nested
208
+ SupportedStyles:
209
+ - nested
210
+ - compact
211
+
212
+ # Align with the style guide.
213
+ CollectionMethods:
214
+ # Mapping from undesired method to desired_method
215
+ # e.g. to use `detect` over `find`:
216
+ #
217
+ # CollectionMethods:
218
+ # PreferredMethods:
219
+ # find: detect
220
+ PreferredMethods:
221
+ collect: 'map'
222
+ collect!: 'map!'
223
+ inject: 'reduce'
224
+ detect: 'find'
225
+ find_all: 'select'
226
+
227
+ # Checks formatting of special comments
228
+ CommentAnnotation:
229
+ Keywords:
230
+ - TODO
231
+ - FIXME
232
+ - OPTIMIZE
233
+ - HACK
234
+ - REVIEW
235
+
236
+ # Avoid complex methods.
237
+ CyclomaticComplexity:
238
+ Max: 6
239
+
240
+ # Multi-line method chaining should be done with leading dots.
241
+ DotPosition:
242
+ EnforcedStyle: leading
243
+ SupportedStyles:
244
+ - leading
245
+ - trailing
246
+
247
+ # Use empty lines between defs.
248
+ EmptyLineBetweenDefs:
249
+ # If true, this parameter means that single line method definitions don't
250
+ # need an empty line between them.
251
+ AllowAdjacentOneLineDefs: false
252
+
253
+ FileName:
254
+ Exclude:
255
+ - Rakefile
256
+ - Gemfile
257
+ - Capfile
258
+
259
+ # Checks use of for or each in multiline loops.
260
+ For:
261
+ EnforcedStyle: each
262
+ SupportedStyles:
263
+ - for
264
+ - each
265
+
266
+ # Enforce the method used for string formatting.
267
+ FormatString:
268
+ EnforcedStyle: format
269
+ SupportedStyles:
270
+ - format
271
+ - sprintf
272
+ - percent
273
+
274
+ HashSyntax:
275
+ EnforcedStyle: ruby19
276
+ SupportedStyles:
277
+ - ruby19
278
+ - hash_rockets
279
+
280
+ IfUnlessModifier:
281
+ MaxLineLength: 79
282
+
283
+ # Checks the indentation of the first key in a hash literal.
284
+ IndentHash:
285
+ # The value `special_inside_parentheses` means that hash literals with braces
286
+ # that have their opening brace on the same line as a surrounding opening
287
+ # round parenthesis, shall have their first key indented relative to the
288
+ # first position inside the parenthesis.
289
+ # The value `consistent` means that the indentation of the first key shall
290
+ # always be relative to the first position of the line where the opening
291
+ # brace is.
292
+ EnforcedStyle: special_inside_parentheses
293
+ SupportedStyles:
294
+ - special_inside_parentheses
295
+ - consistent
296
+
297
+ LambdaCall:
298
+ EnforcedStyle: call
299
+ SupportedStyles:
300
+ - call
301
+ - braces
302
+
303
+ MethodDefParentheses:
304
+ EnforcedStyle: require_parentheses
305
+ SupportedStyles:
306
+ - require_parentheses
307
+ - require_no_parentheses
308
+
309
+ MethodLength:
310
+ CountComments: false # count full line comments?
311
+ Max: 10
312
+
313
+ MethodName:
314
+ EnforcedStyle: snake_case
315
+ SupportedStyles:
316
+ - snake_case
317
+ - camelCase
318
+
319
+ ParameterLists:
320
+ Max: 5
321
+ CountKeywordArgs: true
322
+
323
+ # Allow safe assignment in conditions.
324
+ ParenthesesAroundCondition:
325
+ AllowSafeAssignment: true
326
+
327
+ PercentLiteralDelimiters:
328
+ PreferredDelimiters:
329
+ '%': ()
330
+ '%i': ()
331
+ '%q': ()
332
+ '%Q': ()
333
+ '%r': '{}'
334
+ '%s': ()
335
+ '%w': ()
336
+ '%W': ()
337
+ '%x': ()
338
+
339
+ PredicateName:
340
+ NamePrefixBlacklist:
341
+ - is_
342
+ - has_
343
+ - have_
344
+
345
+ RaiseArgs:
346
+ EnforcedStyle: exploded
347
+ SupportedStyles:
348
+ - compact # raise Exception.new(msg)
349
+ - exploded # raise Exception, msg
350
+
351
+
352
+ RedundantReturn:
353
+ # When true allows code like `return x, y`.
354
+ AllowMultipleReturnValues: false
355
+
356
+ RegexpLiteral:
357
+ # The maximum number of (escaped) slashes that a slash-delimited regexp is
358
+ # allowed to have. If there are more slashes, a %r regexp shall be used.
359
+ MaxSlashes: 1
360
+
361
+ Semicolon:
362
+ # Allow ; to separate several expressions on the same line.
363
+ AllowAsExpressionSeparator: false
364
+
365
+ SingleLineBlockParams:
366
+ Methods:
367
+ - reduce:
368
+ - a
369
+ - e
370
+ - inject:
371
+ - a
372
+ - e
373
+
374
+ SingleLineMethods:
375
+ AllowIfMethodIsEmpty: true
376
+
377
+ StringLiterals:
378
+ EnforcedStyle: single_quotes
379
+ SupportedStyles:
380
+ - single_quotes
381
+ - double_quotes
382
+
383
+ SpaceAroundEqualsInParameterDefault:
384
+ EnforcedStyle: space
385
+ SupportedStyles:
386
+ - space
387
+ - no_space
388
+
389
+ TrailingBlankLines:
390
+ EnforcedStyle: final_newline
391
+ SupportedStyles:
392
+ - final_newline
393
+ - final_blank_line
394
+
395
+ TrailingComma:
396
+ EnforcedStyleForMultiline: no_comma
397
+ SupportedStyles:
398
+ - comma
399
+ - no_comma
400
+
401
+ # TrivialAccessors doesn't require exact name matches and doesn't allow
402
+ # predicated methods by default.
403
+ TrivialAccessors:
404
+ ExactNameMatch: false
405
+ AllowPredicates: false
406
+ # Allows trivial writers that don't end in an equal sign. e.g.
407
+ #
408
+ # def on_exception(action)
409
+ # @on_exception=action
410
+ # end
411
+ # on_exception :restart
412
+ #
413
+ # Commonly used in DSLs
414
+ AllowDSLWriters: false
415
+ Whitelist:
416
+ - to_ary
417
+ - to_a
418
+ - to_c
419
+ - to_enum
420
+ - to_h
421
+ - to_hash
422
+ - to_i
423
+ - to_int
424
+ - to_io
425
+ - to_open
426
+ - to_path
427
+ - to_proc
428
+ - to_r
429
+ - to_regexp
430
+ - to_str
431
+ - to_s
432
+ - to_sym
433
+
434
+ VariableName:
435
+ EnforcedStyle: snake_case
436
+ SupportedStyles:
437
+ - snake_case
438
+ - camelCase
439
+
440
+ WhileUntilModifier:
441
+ MaxLineLength: 79
442
+
443
+ ##################### Rails ##################################
444
+
445
+ ActionFilter:
446
+ EnforcedStyle: action
447
+ SupportedStyles:
448
+ - action
449
+ - filter
450
+ Include:
451
+ - app/controllers/*.rb
452
+
453
+ DefaultScope:
454
+ Include:
455
+ - app/models/*.rb
456
+
457
+ HasAndBelongsToMany:
458
+ Include:
459
+ - app/models/*.rb
460
+
461
+ ReadWriteAttribute:
462
+ Include:
463
+ - app/models/*.rb
464
+
465
+ ScopeArgs:
466
+ Include:
467
+ - app/models/*.rb
468
+
469
+ Validation:
470
+ Include:
471
+ - app/models/*.rb