This repository has been archived by the owner on Dec 25, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
221 lines (174 loc) · 4.41 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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
require: rubocop-rails
inherit_from: .rubocop_todo.yml
# REQUIRED STUFF FOR SETUP
AllCops:
Exclude:
- db/migrate/*.rb
- db/schema.rb
# The most poorly written thing I've ever seen in Ruby.
- lib/simpletextile.rb
- lib/retard_filter.rb
- vendor/**/*
- public/**/*
- tmp/**/*
#Include:
#- "**/*.eye"
TargetRubyVersion: 2.6
Rails:
Enabled: true
Rails/UnknownEnv:
Environments:
- production
- staging
- development
- test
# This is already safe.
Rails/OutputSafety:
Enabled: false
Rails/DynamicFindBy:
Whitelist:
- find_by_slug_or_id
- find_by_sql
# "Fixing" this would make our code slower and more complex.
Rails/HasAndBelongsToMany:
Enabled: false
# This is utterly retarded.
Bundler/OrderedGems:
Enabled: false
# We need these.
Style/GlobalVars:
AllowedVariables:
- "$flipper"
- "$redis"
- "$themes"
# End required stuff for our setup
# 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
Exclude:
- 'test/lib/search_parser_test.rb'
# Even more.
Layout/FirstHashElementIndentation:
EnforcedStyle: consistent
Exclude:
- 'test/lib/search_parser_test.rb'
# 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
# has_blah? is okay.
Naming/PredicateName:
AllowedMethods:
- has_array_field
- has_tag_proxy
- has_thumbnails?
# 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
# RANDOM CRAP
# Single quotes are required here.
Lint/PercentStringArray:
Exclude:
- config/initializers/secure_headers.rb
# Loosen metrics
Metrics/ClassLength:
Max: 700
Metrics/BlockLength:
Max: 400
Metrics/LineLength:
Exclude:
- app/helpers/oc_avatar_helper.rb
Max: 300
Metrics/ModuleLength:
Max: 250
Metrics/ParameterLists:
Max: 7
# fp
Naming/MethodParameterName:
AllowedNames: io, id, to, by, on, in, at, ip, db, fp
# This incorrectly flags some has_many relationships
Rails/HasManyOrHasOneDependent:
Enabled: false
# Pointless
Rails/HelperInstanceVariable:
Enabled: false
Rails/Output:
Exclude:
- db/seeds.rb
- db/seeds_development.rb
# Broken in rubocop 0.73
Layout/EmptyLinesAroundAccessModifier:
Enabled: false
Lint/UselessAccessModifier:
Enabled: false
# TODO: This is HORRID and only here because fixing it is a huge task that should not be done in normal Rubocop stuff
Style/MethodMissingSuper:
Exclude:
- 'lib/has_array_field.rb'
Style/MissingRespondToMissing:
Exclude:
- 'lib/has_array_field.rb'