|
1 |
| -AllCops: |
2 |
| - TargetRubyVersion: 2.2 |
3 |
| -Metrics/AbcSize: |
4 |
| - Enabled: false |
| 1 | +################################################################################ |
| 2 | +# Metrics |
| 3 | +################################################################################ |
5 | 4 |
|
6 | 5 | Metrics/LineLength:
|
7 | 6 | Enabled: false
|
8 | 7 |
|
9 |
| -Rails/TimeZone: |
| 8 | +Metrics/AbcSize: |
10 | 9 | Enabled: false
|
11 | 10 |
|
12 |
| -SignalException: |
| 11 | +################################################################################ |
| 12 | +# Style |
| 13 | +################################################################################ |
| 14 | + |
| 15 | +# Executables are conventionally named bin/foo-bar |
| 16 | +Style/FileName: |
| 17 | + Exclude: |
| 18 | + - bin/**/* |
| 19 | + |
| 20 | +# We don't (currently) document our code |
| 21 | +Style/Documentation: |
13 | 22 | Enabled: false
|
14 | 23 |
|
| 24 | +# Always use double-quotes to keep things simple |
15 | 25 | Style/StringLiterals:
|
16 |
| - Enabled: false |
| 26 | + EnforcedStyle: double_quotes |
17 | 27 |
|
18 |
| -Style/Documentation: |
| 28 | +# Use a trailing comma to keep diffs clean when elements are inserted or removed |
| 29 | +Style/TrailingComma: |
| 30 | + EnforcedStyleForMultiline: comma |
| 31 | + |
| 32 | +# We avoid GuardClause because it can result in "suprise return" |
| 33 | +Style/GuardClause: |
19 | 34 | Enabled: false
|
20 | 35 |
|
21 |
| -Style/TrailingCommaInLiteral: |
| 36 | +# We avoid IfUnlessModifier because it can result in "suprise if" |
| 37 | +Style/IfUnlessModifier: |
22 | 38 | Enabled: false
|
23 | 39 |
|
24 |
| -Style/ClassAndModuleChildren: |
| 40 | +# We don't care about the fail/raise distinction |
| 41 | +Style/SignalException: |
| 42 | + EnforcedStyle: only_raise |
| 43 | + |
| 44 | +Style/DotPosition: |
| 45 | + EnforcedStyle: trailing |
| 46 | + |
| 47 | +# Common globals we allow |
| 48 | +Style/GlobalVars: |
| 49 | + AllowedVariables: |
| 50 | + - "$statsd" |
| 51 | + - "$mongo" |
| 52 | + - "$rollout" |
| 53 | + |
| 54 | +# Allow $! in config/initializers |
| 55 | +Style/SpecialGlobalVars: |
25 | 56 | Exclude:
|
26 |
| - - 'spec/**/*' |
| 57 | + - config/initializers/**/* |
27 | 58 |
|
28 |
| -Style/IfUnlessModifier: |
| 59 | +# We have common cases where has_ and have_ make sense |
| 60 | +Style/PredicateName: |
| 61 | + Enabled: true |
| 62 | + NamePrefixBlacklist: |
| 63 | + - is_ |
| 64 | + |
| 65 | +# We use %w[ ], not %w( ) because the former looks like an array |
| 66 | +Style/PercentLiteralDelimiters: |
| 67 | + PreferredDelimiters: |
| 68 | + "%w": [] |
| 69 | + "%W": [] |
| 70 | + |
| 71 | +# Allow "trivial" accessors when defined as a predicate? method |
| 72 | +Style/TrivialAccessors: |
| 73 | + AllowPredicates: true |
| 74 | + |
| 75 | +Style/Next: |
29 | 76 | Enabled: false
|
30 | 77 |
|
31 |
| -Style/DotPosition: |
| 78 | +# We think it's OK to use the "extend self" module pattern |
| 79 | +Style/ModuleFunction: |
32 | 80 | Enabled: false
|
33 | 81 |
|
34 |
| -Style/GuardClause: |
| 82 | +################################################################################ |
| 83 | +# Rails - disable things because we're primarily non-rails |
| 84 | +################################################################################ |
| 85 | + |
| 86 | +Rails/Delegate: |
35 | 87 | Enabled: false
|
36 | 88 |
|
37 |
| -Style/StringLiteralsInInterpolation: |
| 89 | +Rails/TimeZone: |
38 | 90 | Enabled: false
|
39 | 91 |
|
40 |
| -Style/PercentLiteralDelimiters: |
41 |
| - PreferredDelimiters: |
42 |
| - '%w': [] |
43 |
| - '%W': [] |
| 92 | +################################################################################ |
| 93 | +# Specs - be more lenient on length checks and block styles |
| 94 | +################################################################################ |
| 95 | + |
| 96 | +Metrics/ModuleLength: |
| 97 | + Exclude: |
| 98 | + - spec/**/* |
| 99 | + |
| 100 | +Metrics/MethodLength: |
| 101 | + Exclude: |
| 102 | + - spec/**/* |
| 103 | + |
| 104 | +Style/ClassAndModuleChildren: |
| 105 | + Exclude: |
| 106 | + - spec/**/* |
| 107 | + |
| 108 | +Style/BlockDelimiters: |
| 109 | + Exclude: |
| 110 | + - spec/**/* |
0 commit comments