-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
179 lines (137 loc) · 3.45 KB
/
.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# Offense count: 1
Lint/SuppressedException:
Exclude:
- 'config/unicorn.rb'
# Offense count: 251
Metrics/AbcSize:
Max: 116
# Offense count: 11
# Configuration parameters: CountBlocks.
Metrics/BlockNesting:
Max: 5
# Offense count: 69
Metrics/CyclomaticComplexity:
Max: 36
# Offense count: 224
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/MethodLength:
Max: 123
# Offense count: 68
Metrics/PerceivedComplexity:
Max: 44
# Offense count: 266
Style/Documentation:
Enabled: false
# Offense count: 49
# Configuration parameters: MinBodyLength.
Style/GuardClause:
Enabled: false
AllCops:
TargetRubyVersion: 2.7
Exclude:
- 'db/**/*.rb'
# This is utterly retarded.
Bundler/OrderedGems:
Enabled: false
# We need these.
Style/GlobalVars:
AllowedVariables:
- "$flipper"
- "$redis"
- "$themes"
# STYLE DECISIONS
# Let us line things up
Layout/ArgumentAlignment:
# TODO: EnforcedStyle: with_fixed_indentation
Enabled: false
Layout/HashAlignment:
EnforcedHashRocketStyle: table
EnforcedColonStyle: table
# We really don't care about this.
Lint/AmbiguousRegexpLiteral:
Enabled: false
# Try to avoid excessive indentation.
Layout/EndAlignment:
AutoCorrect: true
EnforcedStyleAlignWith: variable
# YAEIA
Layout/CaseIndentation:
EnforcedStyle: end
# We do not care about potential inheritance issues with these
Style/ClassVars:
Enabled: false
# Consistency is better than brevity.
Style/EmptyMethod:
EnforcedStyle: expanded
# More excessive indentation avoided.
Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent
# Even more.
Layout/FirstHashElementIndentation:
EnforcedStyle: consistent
# We should be able to comment things out, dammit
Layout/CommentIndentation:
Enabled: false
Layout/LeadingCommentSpace:
Enabled: false
# Lambda styles are bizarrely inconsistent. Let's just make them all stabby.
Style/Lambda:
EnforcedStyle: literal
# `extend self` is slightly more readable
Style/ModuleFunction:
EnforcedStyle: extend_self
# `unless` just muddies the logic; only ever use it in modifier form.
Style/NegatedIf:
Enabled: false
# This is both faster and clearer.
Style/NumericPredicate:
AutoCorrect: true
EnforcedStyle: comparison
# e's aren't good
Naming/RescuedExceptionsVariableName:
PreferredName: ex
# Screw %r.
Style/RegexpLiteral:
AllowInnerSlashes: true
EnforcedStyle: slashes
# `rescue` as a modifier is an ugly kludge, but it's better than the block form in 90% of cases.
Style/RescueModifier:
Enabled: false
# &. should only be used where needed
Style/SafeNavigation:
Enabled: false
# Sometimes code is clearer with multiple expressions on one line.
Style/Semicolon:
Enabled: false
# This is just silly.
Naming/VariableNumber:
Enabled: false
# Doesn't really help things
Style/SymbolArray:
EnforcedStyle: brackets
# We use one for modules and one for classes, Rubocop treats them the same
Style/ClassAndModuleChildren:
Enabled: false
# This does not matter and it's useful to show example Unicode in comments
Style/AsciiComments:
Enabled: false
# End style decisions
# Loosen metrics
Metrics/ClassLength:
Max: 700
Metrics/BlockLength:
Max: 400
Layout/LineLength:
Max: 300
Metrics/ModuleLength:
Max: 250
Metrics/ParameterLists:
Max: 7
# fp
Naming/MethodParameterName:
AllowedNames: io, id, to, by, on, in, at, ip, db, fp
# Broken in rubocop 0.73
Layout/EmptyLinesAroundAccessModifier:
Enabled: false
Lint/UselessAccessModifier:
Enabled: false