php-composer 0.1.0

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.
Files changed (41) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +1006 -0
  5. data/Gemfile +15 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +35 -0
  8. data/Rakefile +1 -0
  9. data/lib/composer.rb +52 -0
  10. data/lib/composer/error.rb +8 -0
  11. data/lib/composer/json/json_file.rb +270 -0
  12. data/lib/composer/json/json_formatter.rb +159 -0
  13. data/lib/composer/json/json_validaton_error.rb +29 -0
  14. data/lib/composer/manager.rb +79 -0
  15. data/lib/composer/package/alias_package.rb +273 -0
  16. data/lib/composer/package/base_package.rb +130 -0
  17. data/lib/composer/package/complete_package.rb +55 -0
  18. data/lib/composer/package/dumper/hash_dumper.rb +169 -0
  19. data/lib/composer/package/link.rb +51 -0
  20. data/lib/composer/package/link_constraint/base_constraint.rb +36 -0
  21. data/lib/composer/package/link_constraint/empty_constraint.rb +35 -0
  22. data/lib/composer/package/link_constraint/multi_constraint.rb +67 -0
  23. data/lib/composer/package/link_constraint/specific_constraint.rb +41 -0
  24. data/lib/composer/package/link_constraint/version_constraint.rb +221 -0
  25. data/lib/composer/package/loader/hash_loader.rb +316 -0
  26. data/lib/composer/package/loader/json_loader.rb +47 -0
  27. data/lib/composer/package/loader/project_attributes_loader.rb +71 -0
  28. data/lib/composer/package/loader/project_root_package_loader.rb +28 -0
  29. data/lib/composer/package/package.rb +118 -0
  30. data/lib/composer/package/root_alias_package.rb +37 -0
  31. data/lib/composer/package/root_package.rb +37 -0
  32. data/lib/composer/package/version/version_parser.rb +583 -0
  33. data/lib/composer/package/version/version_selector.rb +106 -0
  34. data/lib/composer/provider.rb +94 -0
  35. data/lib/composer/repository/array_repository.rb +195 -0
  36. data/lib/composer/repository/filesystem_repository.rb +86 -0
  37. data/lib/composer/repository/writeable_array_repository.rb +60 -0
  38. data/lib/composer/version.rb +3 -0
  39. data/php-composer.gemspec +31 -0
  40. data/resources/composer-schema.json +421 -0
  41. metadata +188 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 88072883dc0713384ff1f98f0d94f9f1361224f9
4
+ data.tar.gz: 6c9b041212927d480583a92bad382dbbcc62e0b2
5
+ SHA512:
6
+ metadata.gz: d5742e4541cbb44d0372038c4595466c656d83d71c53f2020e5f3b28275eafe1f0090aeab302ed1d0316cfbcde323a280135cf8ee16cd93d12a5f188288931a1
7
+ data.tar.gz: ba066bed89028e51539066320d1755bbf2126d29d4bc86ae8f610308e44d5f87088f7f34a2f5c418264ea6fdf91f04edfdf61df4b6f741fde1843a7694ff5511
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.idea/
3
+ /.yardoc
4
+ /Gemfile.lock
5
+ /_yardoc/
6
+ /coverage/
7
+ /doc/
8
+ /pkg/
9
+ /spec/reports/
10
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,1006 @@
1
+ Style/AccessModifierIndentation:
2
+ Description: Check indentation of private/protected visibility modifiers.
3
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected'
4
+ Enabled: true
5
+
6
+ Style/AccessorMethodName:
7
+ Description: Check the naming of accessor methods for get_/set_.
8
+ Enabled: false
9
+
10
+ Style/Alias:
11
+ Description: 'Use alias_method instead of alias.'
12
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
13
+ Enabled: true
14
+
15
+ Style/AlignArray:
16
+ Description: >-
17
+ Align the elements of an array literal if they span more than
18
+ one line.
19
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays'
20
+ Enabled: true
21
+
22
+ Style/AlignHash:
23
+ Description: >-
24
+ Align the elements of a hash literal if they span more than
25
+ one line.
26
+ Enabled: true
27
+
28
+ Style/AlignParameters:
29
+ Description: >-
30
+ Align the parameters of a method call if they span more
31
+ than one line.
32
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
33
+ Enabled: false
34
+
35
+ Style/AndOr:
36
+ Description: 'Use &&/|| instead of and/or.'
37
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-and-or-or'
38
+ Enabled: false
39
+
40
+ Style/ArrayJoin:
41
+ Description: 'Use Array#join instead of Array#*.'
42
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
43
+ Enabled: false
44
+
45
+ Style/AsciiComments:
46
+ Description: 'Use only ascii symbols in comments.'
47
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
48
+ Enabled: true
49
+
50
+ Style/AsciiIdentifiers:
51
+ Description: 'Use only ascii symbols in identifiers.'
52
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
53
+ Enabled: true
54
+
55
+ Style/Attr:
56
+ Description: 'Checks for uses of Module#attr.'
57
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
58
+ Enabled: false
59
+
60
+ Style/BeginBlock:
61
+ Description: 'Avoid the use of BEGIN blocks.'
62
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks'
63
+ Enabled: true
64
+
65
+ Style/BarePercentLiterals:
66
+ Description: 'Checks if usage of %() or %Q() matches configuration.'
67
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand'
68
+ Enabled: false
69
+
70
+ Style/BlockComments:
71
+ Description: 'Do not use block comments.'
72
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-block-comments'
73
+ Enabled: false
74
+
75
+ Style/BlockEndNewline:
76
+ Description: 'Put end statement of multiline block on its own line.'
77
+ Enabled: true
78
+
79
+ Style/Blocks:
80
+ Description: >-
81
+ Avoid using {...} for multi-line blocks (multiline chaining is
82
+ always ugly).
83
+ Prefer {...} over do...end for single-line blocks.
84
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
85
+ Enabled: true
86
+
87
+ Style/BracesAroundHashParameters:
88
+ Description: 'Enforce braces style around hash parameters.'
89
+ Enabled: false
90
+
91
+ Style/CaseEquality:
92
+ Description: 'Avoid explicit use of the case equality operator(===).'
93
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
94
+ Enabled: false
95
+
96
+ Style/CaseIndentation:
97
+ Description: 'Indentation of when in a case/when/[else/]end.'
98
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-when-to-case'
99
+ Enabled: true
100
+
101
+ Style/CharacterLiteral:
102
+ Description: 'Checks for uses of character literals.'
103
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
104
+ Enabled: true
105
+
106
+ Style/ClassAndModuleCamelCase:
107
+ Description: 'Use CamelCase for classes and modules.'
108
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#camelcase-classes'
109
+ Enabled: true
110
+
111
+ Style/ClassAndModuleChildren:
112
+ Description: 'Checks style of children classes and modules.'
113
+ Enabled: false
114
+
115
+ Style/ClassCheck:
116
+ Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
117
+ Enabled: false
118
+
119
+ Style/ClassMethods:
120
+ Description: 'Use self when defining module/class methods.'
121
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#def-self-singletons'
122
+ Enabled: false
123
+
124
+ Style/ClassVars:
125
+ Description: 'Avoid the use of class variables.'
126
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
127
+ Enabled: true
128
+
129
+ Style/ColonMethodCall:
130
+ Description: 'Do not use :: for method call.'
131
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
132
+ Enabled: false
133
+
134
+ Style/CommentAnnotation:
135
+ Description: >-
136
+ Checks formatting of special comments
137
+ (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
138
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
139
+ Enabled: false
140
+
141
+ Style/CommentIndentation:
142
+ Description: 'Indentation of comments.'
143
+ Enabled: true
144
+
145
+ Style/ConstantName:
146
+ Description: 'Constants should use SCREAMING_SNAKE_CASE.'
147
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#screaming-snake-case'
148
+ Enabled: true
149
+
150
+ Style/DefWithParentheses:
151
+ Description: 'Use def with parentheses when there are arguments.'
152
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
153
+ Enabled: false
154
+
155
+ Style/DeprecatedHashMethods:
156
+ Description: 'Checks for use of deprecated Hash methods.'
157
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-key'
158
+ Enabled: false
159
+
160
+ Style/Documentation:
161
+ Description: 'Document classes and non-namespace modules.'
162
+ Enabled: false
163
+
164
+ Style/DotPosition:
165
+ Description: 'Checks the position of the dot in multi-line method calls.'
166
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
167
+ Enabled: false
168
+
169
+ Style/DoubleNegation:
170
+ Description: 'Checks for uses of double negation (!!).'
171
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
172
+ Enabled: false
173
+
174
+ Style/EachWithObject:
175
+ Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
176
+ Enabled: false
177
+
178
+ Style/ElseAlignment:
179
+ Description: 'Align elses and elsifs correctly.'
180
+ Enabled: true
181
+
182
+ Style/EmptyElse:
183
+ Description: 'Avoid empty else-clauses.'
184
+ Enabled: false
185
+
186
+ Style/EmptyLineBetweenDefs:
187
+ Description: 'Use empty lines between defs.'
188
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods'
189
+ Enabled: false
190
+
191
+ Style/EmptyLines:
192
+ Description: "Don't use several empty lines in a row."
193
+ Enabled: false
194
+
195
+ Style/EmptyLinesAroundAccessModifier:
196
+ Description: "Keep blank lines around access modifiers."
197
+ Enabled: false
198
+
199
+ Style/EmptyLinesAroundBlockBody:
200
+ Description: "Keeps track of empty lines around block bodies."
201
+ Enabled: false
202
+
203
+ Style/EmptyLinesAroundClassBody:
204
+ Description: "Keeps track of empty lines around class bodies."
205
+ Enabled: false
206
+
207
+ Style/EmptyLinesAroundModuleBody:
208
+ Description: "Keeps track of empty lines around module bodies."
209
+ Enabled: false
210
+
211
+ Style/EmptyLinesAroundMethodBody:
212
+ Description: "Keeps track of empty lines around method bodies."
213
+ Enabled: false
214
+
215
+ Style/EmptyLiteral:
216
+ Description: 'Prefer literals to Array.new/Hash.new/String.new.'
217
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
218
+ Enabled: false
219
+
220
+ Style/EndBlock:
221
+ Description: 'Avoid the use of END blocks.'
222
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-END-blocks'
223
+ Enabled: false
224
+
225
+ Style/EndOfLine:
226
+ Description: 'Use Unix-style line endings.'
227
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#crlf'
228
+ Enabled: false
229
+
230
+ Style/EvenOdd:
231
+ Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
232
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
233
+ Enabled: false
234
+
235
+ Style/FileName:
236
+ Description: 'Use snake_case for source file names.'
237
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
238
+ Enabled: false
239
+
240
+ Style/FlipFlop:
241
+ Description: 'Checks for flip flops'
242
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
243
+ Enabled: false
244
+
245
+ Style/For:
246
+ Description: 'Checks use of for or each in multiline loops.'
247
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-for-loops'
248
+ Enabled: false
249
+
250
+ Style/FormatString:
251
+ Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
252
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
253
+ Enabled: false
254
+
255
+ Style/GlobalVars:
256
+ Description: 'Do not introduce global variables.'
257
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
258
+ Enabled: false
259
+
260
+ Style/GuardClause:
261
+ Description: 'Check for conditionals that can be replaced with guard clauses'
262
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
263
+ Enabled: false
264
+
265
+ Style/HashSyntax:
266
+ Description: >-
267
+ Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
268
+ { :a => 1, :b => 2 }.
269
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-literals'
270
+ Enabled: true
271
+
272
+ Style/IfUnlessModifier:
273
+ Description: >-
274
+ Favor modifier if/unless usage when you have a
275
+ single-line body.
276
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
277
+ Enabled: false
278
+
279
+ Style/IfWithSemicolon:
280
+ Description: 'Do not use if x; .... Use the ternary operator instead.'
281
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
282
+ Enabled: false
283
+
284
+ Style/IndentationConsistency:
285
+ Description: 'Keep indentation straight.'
286
+ Enabled: true
287
+
288
+ Style/IndentationWidth:
289
+ Description: 'Use 2 spaces for indentation.'
290
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
291
+ Enabled: true
292
+
293
+ Style/IndentArray:
294
+ Description: >-
295
+ Checks the indentation of the first element in an array
296
+ literal.
297
+ Enabled: false
298
+
299
+ Style/IndentHash:
300
+ Description: 'Checks the indentation of the first key in a hash literal.'
301
+ Enabled: false
302
+
303
+ Style/InfiniteLoop:
304
+ Description: 'Use Kernel#loop for infinite loops.'
305
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#infinite-loop'
306
+ Enabled: false
307
+
308
+ Style/Lambda:
309
+ Description: 'Use the new lambda literal syntax for single-line blocks.'
310
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
311
+ Enabled: false
312
+
313
+ Style/LambdaCall:
314
+ Description: 'Use lambda.call(...) instead of lambda.(...).'
315
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
316
+ Enabled: false
317
+
318
+ Style/LeadingCommentSpace:
319
+ Description: 'Comments should start with a space.'
320
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space'
321
+ Enabled: false
322
+
323
+ Style/LineEndConcatenation:
324
+ Description: >-
325
+ Use \ instead of + or << to concatenate two string literals at
326
+ line end.
327
+ Enabled: false
328
+
329
+ Style/MethodCallParentheses:
330
+ Description: 'Do not use parentheses for method calls with no arguments.'
331
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens'
332
+ Enabled: false
333
+
334
+ Style/MethodDefParentheses:
335
+ Description: >-
336
+ Checks if the method definitions have or don't have
337
+ parentheses.
338
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
339
+ Enabled: false
340
+
341
+ Style/MethodName:
342
+ Description: 'Use the configured style when naming methods.'
343
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
344
+ Enabled: false
345
+
346
+ Style/ModuleFunction:
347
+ Description: 'Checks for usage of `extend self` in modules.'
348
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
349
+ Enabled: false
350
+
351
+ Style/MultilineBlockChain:
352
+ Description: 'Avoid multi-line chains of blocks.'
353
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
354
+ Enabled: false
355
+
356
+ Style/MultilineBlockLayout:
357
+ Description: 'Ensures newlines after multiline block do statements.'
358
+ Enabled: false
359
+
360
+ Style/MultilineIfThen:
361
+ Description: 'Do not use then for multi-line if/unless.'
362
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-then'
363
+ Enabled: false
364
+
365
+ Style/MultilineOperationIndentation:
366
+ Description: >-
367
+ Checks indentation of binary operations that span more than
368
+ one line.
369
+ Enabled: false
370
+
371
+ Style/MultilineTernaryOperator:
372
+ Description: >-
373
+ Avoid multi-line ?: (the ternary operator);
374
+ use if/unless instead.
375
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary'
376
+ Enabled: false
377
+
378
+ Style/NegatedIf:
379
+ Description: >-
380
+ Favor unless over if for negative conditions
381
+ (or control flow or).
382
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
383
+ Enabled: false
384
+
385
+ Style/NegatedWhile:
386
+ Description: 'Favor until over while for negative conditions.'
387
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
388
+ Enabled: false
389
+
390
+ Style/NestedTernaryOperator:
391
+ Description: 'Use one expression per branch in a ternary operator.'
392
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-ternary'
393
+ Enabled: false
394
+
395
+ Style/Next:
396
+ Description: 'Use `next` to skip iteration instead of a condition at the end.'
397
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
398
+ Enabled: false
399
+
400
+ Style/NilComparison:
401
+ Description: 'Prefer x.nil? to x == nil.'
402
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
403
+ Enabled: false
404
+
405
+ Style/NonNilCheck:
406
+ Description: 'Checks for redundant nil checks.'
407
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks'
408
+ Enabled: false
409
+
410
+ Style/Not:
411
+ Description: 'Use ! instead of not.'
412
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
413
+ Enabled: false
414
+
415
+ Style/NumericLiterals:
416
+ Description: >-
417
+ Add underscores to large numeric literals to improve their
418
+ readability.
419
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
420
+ Enabled: false
421
+
422
+ Style/OneLineConditional:
423
+ Description: >-
424
+ Favor the ternary operator(?:) over
425
+ if/then/else/end constructs.
426
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
427
+ Enabled: false
428
+
429
+ Style/OpMethod:
430
+ Description: 'When defining binary operators, name the argument other.'
431
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
432
+ Enabled: false
433
+
434
+ Style/ParenthesesAroundCondition:
435
+ Description: >-
436
+ Don't use parentheses around the condition of an
437
+ if/unless/while.
438
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-parens-if'
439
+ Enabled: false
440
+
441
+ Style/PercentLiteralDelimiters:
442
+ Description: 'Use `%`-literal delimiters consistently'
443
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
444
+ Enabled: false
445
+
446
+ Style/PercentQLiterals:
447
+ Description: 'Checks if uses of %Q/%q match the configured preference.'
448
+ Enabled: false
449
+
450
+ Style/PerlBackrefs:
451
+ Description: 'Avoid Perl-style regex back references.'
452
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
453
+ Enabled: false
454
+
455
+ Style/PredicateName:
456
+ Description: 'Check the names of predicate methods.'
457
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
458
+ Enabled: false
459
+
460
+ Style/Proc:
461
+ Description: 'Use proc instead of Proc.new.'
462
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
463
+ Enabled: false
464
+
465
+ Style/RaiseArgs:
466
+ Description: 'Checks the arguments passed to raise/fail.'
467
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
468
+ Enabled: false
469
+
470
+ Style/RedundantBegin:
471
+ Description: "Don't use begin blocks when they are not needed."
472
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#begin-implicit'
473
+ Enabled: false
474
+
475
+ Style/RedundantException:
476
+ Description: "Checks for an obsolete RuntimeException argument in raise/fail."
477
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror'
478
+ Enabled: false
479
+
480
+ Style/RedundantReturn:
481
+ Description: "Don't use return where it's not required."
482
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-return'
483
+ Enabled: false
484
+
485
+ Style/RedundantSelf:
486
+ Description: "Don't use self where it's not needed."
487
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-self-unless-required'
488
+ Enabled: false
489
+
490
+ Style/RegexpLiteral:
491
+ Description: >-
492
+ Use %r for regular expressions matching more than
493
+ `MaxSlashes` '/' characters.
494
+ Use %r only for regular expressions matching more than
495
+ `MaxSlashes` '/' character.
496
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
497
+ Enabled: false
498
+
499
+ Style/RescueModifier:
500
+ Description: 'Avoid using rescue in its modifier form.'
501
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers'
502
+ Enabled: false
503
+
504
+ Style/SelfAssignment:
505
+ Description: >-
506
+ Checks for places where self-assignment shorthand should have
507
+ been used.
508
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
509
+ Enabled: false
510
+
511
+ Style/Semicolon:
512
+ Description: "Don't use semicolons to terminate expressions."
513
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon'
514
+ Enabled: false
515
+
516
+ Style/SignalException:
517
+ Description: 'Checks for proper usage of fail and raise.'
518
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
519
+ Enabled: false
520
+
521
+ Style/SingleLineBlockParams:
522
+ Description: 'Enforces the names of some block params.'
523
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
524
+ Enabled: false
525
+
526
+ Style/SingleLineMethods:
527
+ Description: 'Avoid single-line methods.'
528
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
529
+ Enabled: false
530
+
531
+ Style/SingleSpaceBeforeFirstArg:
532
+ Description: >-
533
+ Checks that exactly one space is used between a method name
534
+ and the first argument for method calls without parentheses.
535
+ Enabled: false
536
+
537
+ Style/SpaceAfterColon:
538
+ Description: 'Use spaces after colons.'
539
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
540
+ Enabled: false
541
+
542
+ Style/SpaceAfterComma:
543
+ Description: 'Use spaces after commas.'
544
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
545
+ Enabled: false
546
+
547
+ Style/SpaceAfterControlKeyword:
548
+ Description: 'Use spaces after if/elsif/unless/while/until/case/when.'
549
+ Enabled: false
550
+
551
+ Style/SpaceAfterMethodName:
552
+ Description: >-
553
+ Do not put a space between a method name and the opening
554
+ parenthesis in a method definition.
555
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
556
+ Enabled: false
557
+
558
+ Style/SpaceAfterNot:
559
+ Description: Tracks redundant space after the ! operator.
560
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-bang'
561
+ Enabled: false
562
+
563
+ Style/SpaceAfterSemicolon:
564
+ Description: 'Use spaces after semicolons.'
565
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
566
+ Enabled: false
567
+
568
+ Style/SpaceBeforeBlockBraces:
569
+ Description: >-
570
+ Checks that the left block brace has or doesn't have space
571
+ before it.
572
+ Enabled: false
573
+
574
+ Style/SpaceBeforeComma:
575
+ Description: 'No spaces before commas.'
576
+ Enabled: false
577
+
578
+ Style/SpaceBeforeComment:
579
+ Description: >-
580
+ Checks for missing space between code and a comment on the
581
+ same line.
582
+ Enabled: false
583
+
584
+ Style/SpaceBeforeSemicolon:
585
+ Description: 'No spaces before semicolons.'
586
+ Enabled: false
587
+
588
+ Style/SpaceInsideBlockBraces:
589
+ Description: >-
590
+ Checks that block braces have or don't have surrounding space.
591
+ For blocks taking parameters, checks that the left brace has
592
+ or doesn't have trailing space.
593
+ Enabled: false
594
+
595
+ Style/SpaceAroundEqualsInParameterDefault:
596
+ Description: >-
597
+ Checks that the equals signs in parameter default assignments
598
+ have or don't have surrounding space depending on
599
+ configuration.
600
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-around-equals'
601
+ Enabled: false
602
+
603
+ Style/SpaceAroundOperators:
604
+ Description: 'Use spaces around operators.'
605
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
606
+ Enabled: false
607
+
608
+ Style/SpaceBeforeModifierKeyword:
609
+ Description: 'Put a space before the modifier keyword.'
610
+ Enabled: false
611
+
612
+ Style/SpaceInsideBrackets:
613
+ Description: 'No spaces after [ or before ].'
614
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
615
+ Enabled: false
616
+
617
+ Style/SpaceInsideHashLiteralBraces:
618
+ Description: "Use spaces inside hash literal braces - or don't."
619
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
620
+ Enabled: true
621
+
622
+ Style/SpaceInsideParens:
623
+ Description: 'No spaces after ( or before ).'
624
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
625
+ Enabled: false
626
+
627
+ Style/SpaceInsideRangeLiteral:
628
+ Description: 'No spaces inside range literals.'
629
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals'
630
+ Enabled: false
631
+
632
+ Style/SpecialGlobalVars:
633
+ Description: 'Avoid Perl-style global variables.'
634
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
635
+ Enabled: false
636
+
637
+ Style/StringLiterals:
638
+ Description: 'Checks if uses of quotes match the configured preference.'
639
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
640
+ Enabled: false
641
+
642
+ Style/StringLiteralsInInterpolation:
643
+ Description: >-
644
+ Checks if uses of quotes inside expressions in interpolated
645
+ strings match the configured preference.
646
+ Enabled: false
647
+
648
+ Style/SymbolProc:
649
+ Description: 'Use symbols as procs instead of blocks when possible.'
650
+ Enabled: false
651
+
652
+ Style/Tab:
653
+ Description: 'No hard tabs.'
654
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
655
+ Enabled: false
656
+
657
+ Style/TrailingBlankLines:
658
+ Description: 'Checks trailing blank lines and final newline.'
659
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#newline-eof'
660
+ Enabled: true
661
+
662
+ Style/TrailingComma:
663
+ Description: 'Checks for trailing comma in parameter lists and literals.'
664
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
665
+ Enabled: false
666
+
667
+ Style/TrailingWhitespace:
668
+ Description: 'Avoid trailing whitespace.'
669
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace'
670
+ Enabled: false
671
+
672
+ Style/TrivialAccessors:
673
+ Description: 'Prefer attr_* methods to trivial readers/writers.'
674
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
675
+ Enabled: false
676
+
677
+ Style/UnlessElse:
678
+ Description: >-
679
+ Do not use unless with else. Rewrite these with the positive
680
+ case first.
681
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-else-with-unless'
682
+ Enabled: false
683
+
684
+ Style/UnneededCapitalW:
685
+ Description: 'Checks for %W when interpolation is not needed.'
686
+ Enabled: false
687
+
688
+ Style/UnneededPercentQ:
689
+ Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
690
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q'
691
+ Enabled: false
692
+
693
+ Style/UnneededPercentX:
694
+ Description: 'Checks for %x when `` would do.'
695
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-x'
696
+ Enabled: false
697
+
698
+ Style/VariableInterpolation:
699
+ Description: >-
700
+ Don't interpolate global, instance and class variables
701
+ directly in strings.
702
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
703
+ Enabled: false
704
+
705
+ Style/VariableName:
706
+ Description: 'Use the configured style when naming variables.'
707
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
708
+ Enabled: false
709
+
710
+ Style/WhenThen:
711
+ Description: 'Use when x then ... for one-line cases.'
712
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
713
+ Enabled: false
714
+
715
+ Style/WhileUntilDo:
716
+ Description: 'Checks for redundant do after while or until.'
717
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do'
718
+ Enabled: false
719
+
720
+ Style/WhileUntilModifier:
721
+ Description: >-
722
+ Favor modifier while/until usage when you have a
723
+ single-line body.
724
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
725
+ Enabled: false
726
+
727
+ Style/WordArray:
728
+ Description: 'Use %w or %W for arrays of words.'
729
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
730
+ Enabled: false
731
+
732
+ #################### Metrics ################################
733
+
734
+ Metrics/AbcSize:
735
+ Description: >-
736
+ A calculated magnitude based on number of assignments,
737
+ branches, and conditions.
738
+ Enabled: false
739
+
740
+ Metrics/BlockNesting:
741
+ Description: 'Avoid excessive block nesting'
742
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
743
+ Enabled: false
744
+
745
+ Metrics/ClassLength:
746
+ Description: 'Avoid classes longer than 100 lines of code.'
747
+ Enabled: false
748
+
749
+ Metrics/CyclomaticComplexity:
750
+ Description: >-
751
+ A complexity metric that is strongly correlated to the number
752
+ of test cases needed to validate a method.
753
+ Enabled: false
754
+
755
+ Metrics/LineLength:
756
+ Description: 'Limit lines to 80 characters.'
757
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
758
+ Enabled: false
759
+
760
+ Metrics/MethodLength:
761
+ Description: 'Avoid methods longer than 10 lines of code.'
762
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
763
+ Enabled: false
764
+
765
+ Metrics/ParameterLists:
766
+ Description: 'Avoid parameter lists longer than three or four parameters.'
767
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
768
+ Enabled: false
769
+
770
+ Metrics/PerceivedComplexity:
771
+ Description: >-
772
+ A complexity metric geared towards measuring complexity for a
773
+ human reader.
774
+ Enabled: false
775
+
776
+ #################### Lint ################################
777
+ ### Warnings
778
+
779
+ Lint/AmbiguousOperator:
780
+ Description: >-
781
+ Checks for ambiguous operators in the first argument of a
782
+ method invocation without parentheses.
783
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
784
+ Enabled: false
785
+
786
+ Lint/AmbiguousRegexpLiteral:
787
+ Description: >-
788
+ Checks for ambiguous regexp literals in the first argument of
789
+ a method invocation without parenthesis.
790
+ Enabled: false
791
+
792
+ Lint/AssignmentInCondition:
793
+ Description: "Don't use assignment in conditions."
794
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
795
+ Enabled: false
796
+
797
+ Lint/BlockAlignment:
798
+ Description: 'Align block ends correctly.'
799
+ Enabled: false
800
+
801
+ Lint/ConditionPosition:
802
+ Description: >-
803
+ Checks for condition placed in a confusing position relative to
804
+ the keyword.
805
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
806
+ Enabled: false
807
+
808
+ Lint/Debugger:
809
+ Description: 'Check for debugger calls.'
810
+ Enabled: false
811
+
812
+ Lint/DefEndAlignment:
813
+ Description: 'Align ends corresponding to defs correctly.'
814
+ Enabled: false
815
+
816
+ Lint/DeprecatedClassMethods:
817
+ Description: 'Check for deprecated class method calls.'
818
+ Enabled: false
819
+
820
+ Lint/ElseLayout:
821
+ Description: 'Check for odd code arrangement in an else block.'
822
+ Enabled: false
823
+
824
+ Lint/EmptyEnsure:
825
+ Description: 'Checks for empty ensure block.'
826
+ Enabled: false
827
+
828
+ Lint/EmptyInterpolation:
829
+ Description: 'Checks for empty string interpolation.'
830
+ Enabled: false
831
+
832
+ Lint/EndAlignment:
833
+ Description: 'Align ends correctly.'
834
+ Enabled: false
835
+
836
+ Lint/EndInMethod:
837
+ Description: 'END blocks should not be placed inside method definitions.'
838
+ Enabled: false
839
+
840
+ Lint/EnsureReturn:
841
+ Description: 'Do not use return in an ensure block.'
842
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-return-ensure'
843
+ Enabled: false
844
+
845
+ Lint/Eval:
846
+ Description: 'The use of eval represents a serious security risk.'
847
+ Enabled: false
848
+
849
+ Lint/HandleExceptions:
850
+ Description: "Don't suppress exception."
851
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
852
+ Enabled: false
853
+
854
+ Lint/InvalidCharacterLiteral:
855
+ Description: >-
856
+ Checks for invalid character literals with a non-escaped
857
+ whitespace character.
858
+ Enabled: false
859
+
860
+ Lint/LiteralInCondition:
861
+ Description: 'Checks of literals used in conditions.'
862
+ Enabled: false
863
+
864
+ Lint/LiteralInInterpolation:
865
+ Description: 'Checks for literals used in interpolation.'
866
+ Enabled: false
867
+
868
+ Lint/Loop:
869
+ Description: >-
870
+ Use Kernel#loop with break rather than begin/end/until or
871
+ begin/end/while for post-loop tests.
872
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
873
+ Enabled: false
874
+
875
+ Lint/ParenthesesAsGroupedExpression:
876
+ Description: >-
877
+ Checks for method calls with a space before the opening
878
+ parenthesis.
879
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
880
+ Enabled: false
881
+
882
+ Lint/RequireParentheses:
883
+ Description: >-
884
+ Use parentheses in the method call to avoid confusion
885
+ about precedence.
886
+ Enabled: false
887
+
888
+ Lint/RescueException:
889
+ Description: 'Avoid rescuing the Exception class.'
890
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-blind-rescues'
891
+ Enabled: false
892
+
893
+ Lint/ShadowingOuterLocalVariable:
894
+ Description: >-
895
+ Do not use the same name as outer local variable
896
+ for block arguments or block local variables.
897
+ Enabled: false
898
+
899
+ Lint/SpaceBeforeFirstArg:
900
+ Description: >-
901
+ Put a space between a method name and the first argument
902
+ in a method call without parentheses.
903
+ Enabled: false
904
+
905
+ Lint/StringConversionInInterpolation:
906
+ Description: 'Checks for Object#to_s usage in string interpolation.'
907
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-to-s'
908
+ Enabled: false
909
+
910
+ Lint/UnderscorePrefixedVariableName:
911
+ Description: 'Do not use prefix `_` for a variable that is used.'
912
+ Enabled: true
913
+
914
+ Lint/UnusedBlockArgument:
915
+ Description: 'Checks for unused block arguments.'
916
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
917
+ Enabled: false
918
+
919
+ Lint/UnusedMethodArgument:
920
+ Description: 'Checks for unused method arguments.'
921
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
922
+ Enabled: false
923
+
924
+ Lint/UnreachableCode:
925
+ Description: 'Unreachable code.'
926
+ Enabled: false
927
+
928
+ Lint/UselessAccessModifier:
929
+ Description: 'Checks for useless access modifiers.'
930
+ Enabled: false
931
+
932
+ Lint/UselessAssignment:
933
+ Description: 'Checks for useless assignment to a local variable.'
934
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
935
+ Enabled: false
936
+
937
+ Lint/UselessComparison:
938
+ Description: 'Checks for comparison of something with itself.'
939
+ Enabled: false
940
+
941
+ Lint/UselessElseWithoutRescue:
942
+ Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
943
+ Enabled: false
944
+
945
+ Lint/UselessSetterCall:
946
+ Description: 'Checks for useless setter call to a local variable.'
947
+ Enabled: false
948
+
949
+ Lint/Void:
950
+ Description: 'Possible use of operator/literal/variable in void context.'
951
+ Enabled: false
952
+
953
+ ##################### Rails ##################################
954
+
955
+ Rails/ActionFilter:
956
+ Description: 'Enforces consistent use of action filter methods.'
957
+ Enabled: false
958
+
959
+ Rails/DefaultScope:
960
+ Description: 'Checks if the argument passed to default_scope is a block.'
961
+ Enabled: false
962
+
963
+ Rails/Delegate:
964
+ Description: 'Prefer delegate method for delegations.'
965
+ Enabled: false
966
+
967
+ Rails/HasAndBelongsToMany:
968
+ Description: 'Prefer has_many :through to has_and_belongs_to_many.'
969
+ Enabled: true
970
+
971
+ Rails/Output:
972
+ Description: 'Checks for calls to puts, print, etc.'
973
+ Enabled: true
974
+
975
+ Rails/ReadWriteAttribute:
976
+ Description: >-
977
+ Checks for read_attribute(:attr) and
978
+ write_attribute(:attr, val).
979
+ Enabled: false
980
+
981
+ Rails/ScopeArgs:
982
+ Description: 'Checks the arguments of ActiveRecord scopes.'
983
+ Enabled: false
984
+
985
+ Rails/Validation:
986
+ Description: 'Use validates :attribute, hash of validations.'
987
+ Enabled: false
988
+
989
+
990
+ # Exclude some of GitLab files
991
+ #
992
+ #
993
+ AllCops:
994
+ RunRailsCops: true
995
+ Exclude:
996
+ - 'spec/**/*'
997
+ - 'features/**/*'
998
+ - 'vendor/**/*'
999
+ - 'db/**/*'
1000
+ - 'tmp/**/*'
1001
+ - 'bin/**/*'
1002
+ - 'lib/backup/**/*'
1003
+ - 'lib/tasks/**/*'
1004
+ - 'lib/email_validator.rb'
1005
+ - 'lib/gitlab/upgrader.rb'
1006
+ - 'lib/gitlab/seeder.rb'