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