-
Notifications
You must be signed in to change notification settings - Fork 12
/
.rubocop.yml
179 lines (145 loc) · 3.85 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
AllCops:
TargetRubyVersion: 2.6
Exclude:
- app/views/**/*
- bin/**/*
- spec/**/*
- config/**/*
- lib/**/*
- tmp/**/*
- db/**/*
- Gemfile
# This is for the APIs.
Naming/PredicateName:
Enabled: false
# I can set other things than accessors.
Naming/AccessorMethodName:
Enabled: false
# It's okay to sometimes use short names.
Naming/UncommunicativeMethodParamName:
Enabled: false
# I'm getting old and liking those double quote strings more, as I write
# n languages where they are the only ones. 😅
Style/StringLiterals:
EnforcedStyle: double_quotes
# Don't complain on missing documentation for every class.
Style/Documentation:
Enabled: false
# Disallow constructs like render :template and return.
Style/AndOr:
Enabled: false
# Let me write them typographic (–) dashes in comments.
Style/AsciiComments:
Enabled: false
# Since module_function is a visibility modifier, you can't have private
# singleton methods. E.g. in some cases, we _do_ need to use extend self.
Style/ModuleFunction:
Enabled: false
# I think this results in uglier code, depending on the situation.
#
# Example:
#
# if old_password or password
# change_password(old_password, password)
# end
#
# Versus:
#
# change_password(old_password, password) if old_password or password
#
# It depends, but if I have a complex condition or a longer line, I prefer the
# more explicit if condition.
Style/IfUnlessModifier:
Enabled: false
# Recently, I tend to prefer the named boolean operators. Yeah, they do have
# different precedence, but still.
Style/Not:
Enabled: false
# I don't think this results in better code. We're flatting it out, while it is
# really nested. Why hide that?
Style/GuardClause:
Enabled: false
# Inheriting from the Struct.new isn't so bad. Yeah, it creates a longer
# ancestor chain, but I wanna grep classes, not DSL's.
Style/StructInheritance:
Enabled: false
Style/StabbyLambdaParentheses:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: true
Layout/MultilineMethodCallBraceLayout:
Enabled: false
# No need for Ruby 1.9 compatible code.
Layout/SpaceInLambdaLiteral:
Enabled: false
Layout/AlignParameters:
EnforcedStyle: with_fixed_indentation
# Allow defining classes with short nesting like class Admin::AbuseController.
Style/ClassAndModuleChildren:
Enabled: false
# We had a failing test in invoiceable_spec. Let's keep it for now.
Style/DateTime:
Enabled: false
# This cop does not work well in heavy meta-programming cases, where the arity
# of the block is of importance.
#
# column :label do |key|
# key.label
# end
#
# Does not equal:
#
# column :label, &label
#
# ... in the table_cloth case.
Style/SymbolProc:
Enabled: false
# I think it's safe to ignore the 80 chars limit.
Metrics/LineLength:
Enabled: false
Metrics/AbcSize:
Enabled: false
# We have some big chunk of classes and methods. Reducing those metrics can
# help us clean up the code.
Metrics/ClassLength:
Max: 250
Metrics/MethodLength:
Max: 70
Metrics/BlockLength:
Max: 40
Metrics/BlockNesting:
Max: 5
Metrics/CyclomaticComplexity:
Max: 11
Metrics/PerceivedComplexity:
Max: 13
Metrics/ParameterLists:
Max: 8
# Sometimes life leaves you no choice. True story.
Lint/HandleExceptions:
Enabled: false
# I use it. It's okay.
Lint/AssignmentInCondition:
Enabled: false
# Polymorphism may require it.
Lint/UnusedMethodArgument:
Enabled: false
# It's okay to use class-global caching.
Style/ClassVars:
Enabled: false
# We have lot's of those, so disable it for now.
Style/RescueStandardError:
Enabled: false
Style/FormatStringToken:
Enabled: false
Style/Lambda:
Enabled: false
# It's a feature, not a bug.
Style/OptionalArguments:
Enabled: false
Layout/RescueEnsureAlignment:
Enabled: false
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Layout/IndentFirstHashElement:
EnforcedStyle: consistent