-
Notifications
You must be signed in to change notification settings - Fork 1
/
.rubocop.yml
228 lines (178 loc) · 5.74 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
# softened a bit with http://relaxed.ruby.style/rubocop.yml
require:
- rubocop-rspec
inherit_from: .rubocop_todo.yml
AllCops:
# EnabledByDefault: true
TargetRubyVersion: 2.5
# Cop names are not d§splayed in offense messages by default. Change behavior
# by overriding DisplayCopNames, or by giving the -D/--display-cop-names
# option.
DisplayCopNames: true
# Style guide URLs are not displayed in offense messages by default. Change
# behavior by overriding DisplayStyleGuide, or by giving the
# -S/--display-style-guide option.
DisplayStyleGuide: false
# Gems in consecutive lines should be alphabetically sorted
Bundler/OrderedGems:
TreatCommentsAsGroupSeparators: true
# Layout ######################################################################
# Checks that the closing brace in an array literal is either on the same line
# as the last array element, or a new line.
Layout/MultilineArrayBraceLayout:
Enabled: true
EnforcedStyle: symmetrical
# Checks that the closing brace in a hash literal is either on the same line as
# the last hash element, or a new line.
Layout/MultilineHashBraceLayout:
Enabled: true
EnforcedStyle: symmetrical
# Checks that the closing brace in a method call is either on the same line as
# the last method argument, or a new line.
Layout/MultilineMethodCallBraceLayout:
Enabled: true
EnforcedStyle: symmetrical
# Checks indentation of binary operations that span more than one line.
Layout/MultilineOperationIndentation:
Enabled: true
EnforcedStyle: indented
# Checks for padding/surrounding spaces inside string interpolation.
Layout/SpaceInsideStringInterpolation:
EnforcedStyle: no_space
Enabled: true
Layout/EndOfLine:
EnforcedStyle: lf
# Naming ######################################################################
# Check the naming of accessor methods for get_/set_.
Naming/AccessorMethodName:
Enabled: false
Naming/UncommunicativeMethodParamName:
MinNameLength: 2
# Use the configured style when naming variables.
Naming/VariableName:
EnforcedStyle: snake_case
Enabled: true
# Use the configured style when numbering variables.
Naming/VariableNumber:
Enabled: false
# Style #######################################################################
# Use alias_method instead of alias.
Style/Alias:
EnforcedStyle: prefer_alias_method
Enabled: true
Style/AsciiComments:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styleasciicomments
# This cop checks that comment annotation keywords are written according
# to guidelines.
Style/CommentAnnotation:
Enabled: false
# Document classes and non-namespace modules.
Style/Documentation:
Enabled: false
# Checks if there is a magic comment to enforce string literals
Style/FrozenStringLiteralComment:
Enabled: false
Style/RegexpLiteral:
EnforcedStyle: mixed
Enabled: false
# Checks for proper usage of fail and raise.
Style/SignalException:
EnforcedStyle: only_raise
Enabled: true
# Check for the usage of parentheses around stabby lambda arguments.
Style/StabbyLambdaParentheses:
EnforcedStyle: require_parentheses
Enabled: true
# Checks if configured preferred methods are used over non-preferred.
Style/StringMethods:
PreferredMethods:
intern: to_sym
Enabled: true
# Checks for %q/%Q when single quotes or double quotes would do.
Style/UnneededPercentQ:
Enabled: false
# Metrics #####################################################################
# A calculated magnitude based on number of assignments,
# branches, and conditions.
Metrics/AbcSize:
Enabled: true
Max: 58
# This cop checks if the length of a block exceeds some maximum value.
Metrics/BlockLength:
Enabled: false
# Avoid excessive block nesting.
Metrics/BlockNesting:
Enabled: true
Max: 4
# Avoid classes longer than 100 lines of code.
Metrics/ClassLength:
Enabled: false
# A complexity metric that is strongly correlated to the number
# of test cases needed to validate a method.
Metrics/CyclomaticComplexity:
Enabled: true
Max: 25
# Limit lines to 80 characters.
Metrics/LineLength:
Max: 140
# Avoid methods longer than 10 lines of code.
Metrics/MethodLength:
Max: 100
# Avoid modules longer than 100 lines of code.
Metrics/ModuleLength:
Enabled: false
# Avoid parameter lists longer than three or four parameters.
Metrics/ParameterLists:
Enabled: true
Max: 8
# A complexity metric geared towards measuring complexity for a human reader.
Metrics/PerceivedComplexity:
Enabled: true
Max: 25
# Lint ########################################################################
# This cop looks for use of the same name as outer local variables
# for block arguments or block local variables.
Lint/ShadowingOuterLocalVariable:
Enabled: false
# Rails #######################################################################
# Enables Rails cops.
Rails:
Enabled: false
# RSpec #######################################################################
# Checks for long example.
RSpec/ExampleLength:
Enabled: false
Max: 10
# Do not use should when describing your tests.
RSpec/ExampleWording:
Enabled: false
CustomTransform:
be: is
have: has
not: does not
IgnoredWords: []
# Checks the file and folder naming of the spec file.
RSpec/FilePath:
Enabled: true
CustomTransform:
RuboCop: rubocop
RSpec: rspec
RSpec/ImplicitExpect:
EnforcedStyle: should
Enabled: true
# incorrect treats shoulda-matchers
RSpec/ImplicitSubject:
Enabled: false
# Checks for `subject` definitions that come after `let` definitions.
RSpec/LeadingSubject:
Enabled: false
# Checks for explicitly referenced test subjects.
RSpec/NamedSubject:
Enabled: false
# Enforces the usage of the same method on all negative message expectations.
RSpec/NotToNot:
EnforcedStyle: not_to
Enabled: true
Style/IfUnlessModifier:
Enabled: false