-
Notifications
You must be signed in to change notification settings - Fork 57
/
.rubocop.yml
236 lines (185 loc) · 5.08 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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
AllCops:
NewCops: enable
Exclude:
- "*-core.rb"
- "tools/plot.rb"
- "tmp/**"
- "test/**"
- "benchmark/*-core-opt-*.rb"
- "benchmark/Dockerfile.*"
# "eval" is the swiss army knife
Security/Eval:
Enabled: false
# Marshal.load is needed when needed
Security/MarshalLoad:
Enabled: false
# "while true" loop is easy and fast
Lint/Loop:
Enabled: false
Style/InfiniteLoop:
Enabled: false
# `String#%` is a great invention of Ruby
Style/FormatString:
EnforcedStyle: percent
# I hate frozen string literal
Style/FrozenStringLiteralComment:
Enabled: false
# 10_000 looks dirty to me
Style/NumericLiterals:
MinDigits: 6
# explicit return is sometimes good for consistency
Style/RedundantReturn:
Enabled: false
# `x == :error ? error-case : normal-case` does not look beautiful to me
Style/NegatedIfElseCondition:
Enabled: false
# I like `foo {|x| bar(x) }` and `foo { bar }`
Layout/SpaceInsideBlockBraces:
EnforcedStyleForEmptyBraces: space
SpaceBeforeBlockParameters: false
# `"foo#{bar}baz"` looks too dense to me
Layout/SpaceInsideStringInterpolation:
EnforcedStyle: space
# I consistently use double quotes
Style/StringLiterals:
EnforcedStyle: double_quotes
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
# A trailing comma in array/hash literal is super cool
Style/TrailingCommaInArrayLiteral:
Enabled: false
Style/TrailingCommaInHashLiteral:
Enabled: false
# I don't like this so much but virtually needed for ffi struct layout
Style/TrailingCommaInArguments:
Enabled: false
# I don't want to fill my code with `.freeze`
Style/MutableConstant:
Enabled: false
# I have no idea why this is prohibited...
Style/ParallelAssignment:
Enabled: false
# Backrefs are indeed dirty, but `Regexp.last_match` is too verbose
Style/PerlBackrefs:
Enabled: false
# I think `{|ary| ary.size }` is not so bad since its type is explicit
Style/SymbolProc:
Enabled: false
# Wrapping a code is so bad? Case-by-case.
Style/GuardClause:
Enabled: false
# I use hyphen-separated case for script program.
Naming/FileName:
Exclude:
- 'tools/*.rb'
# I don't care class/module size
Metrics/ClassLength:
Max: 1000
Metrics/ModuleLength:
Max: 1000
# I accept two-screen size (about 100 lines?)
Metrics/MethodLength:
Max: 100
Metrics/BlockLength:
Max: 100
# Don't worry, my terminal is big enough
Layout/LineLength:
Max: 120
# Code metrics is good, but I think the default is too strict...
Metrics/CyclomaticComplexity:
Max: 40
Metrics/PerceivedComplexity:
Max: 40
Metrics/AbcSize:
Max: 100
Metrics/BlockNesting:
Max: 5
# I like `x == 0`
Style/NumericPredicate:
EnforcedStyle: comparison
# I like `foo1` and `foo_bar_1`
Naming/VariableNumber:
Enabled: false
# empty is empty
Style/EmptyMethod:
Enabled: false
Lint/EmptyWhen:
Enabled: false
# if-elsif-elsif... looks awkward to me
Style/EmptyCaseCondition:
Enabled: false
# `rescue StandardError` looks redundant to me
Style/RescueStandardError:
Enabled: false
# `END` is always my heredoc delimiter
Naming/HeredocDelimiterNaming:
Enabled: false
# I like `%w()`
Style/PercentLiteralDelimiters:
PreferredDelimiters:
'%w': '()'
# I cannot use `%i()` since I want to make this code run in 1.8
Style/SymbolArray:
EnforcedStyle: brackets
# `0 <= n && n <= 0x7f` is completely innocent
Style/YodaCondition:
Enabled: false
# I understand but `while true` is faster than `loop do`
Lint/LiteralAsCondition:
Enabled: false
# What I want to do is to puts a message to stderr, not to warn users
Style/StderrPuts:
Exclude:
- 'tools/shim.rb'
# Leave me alone
Style/CommentedKeyword:
Enabled: false
# I want to casually use %s for simple format
Style/FormatStringToken:
Enabled: false
# Indeed, if having a single-line body is not so smart, but just not smart
Style/IfUnlessModifier:
Enabled: false
# Let me choose "" + ""
Style/StringConcatenation:
Enabled: false
# Keyword arguments cannot be used in Ruby 1.8
Style/OptionalBooleanParameter:
Enabled: false
# I don't use `Kernel#Array`
Style/ArrayCoercion:
Enabled: false
# `(1 + 1)**-1` looks awkward
Layout/SpaceAroundOperators:
Enabled: false
# One-letter variable is cute
Naming/MethodParameterName:
Enabled: false
# It highly depends on the context
Layout/EmptyLineAfterGuardClause:
Enabled: false
# Hash table literal is a kind of an art, difficult for machine
Layout/HashAlignment:
Enabled: false
# The program needs to work on old rubies
Style/SafeNavigation:
Enabled: false
# I want to use %w() only when the length is long
Style/WordArray:
Enabled: false
# I want to align lines
Layout/SpaceAroundMethodCallOperator:
Enabled: false
# shim is shim
Layout/EmptyLinesAroundAttributeAccessor:
Exclude:
- 'tools/shim.rb'
# This is sometimes a good habit
Style/RedundantAssignment:
Enabled: false
# We support Ruby 1.8
Gemspec/RequiredRubyVersion:
Enabled: false
# Ruby 1.8 does not allow rescue clause in a block
Style/RedundantBegin:
Enabled: false