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