-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.googlestyle.yaml
239 lines (185 loc) · 5.36 KB
/
.googlestyle.yaml
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
237
238
239
# from https://github.com/googleapis/ruby-style
#
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
AllCops:
NewCops: disable
SuggestExtensions: false
TargetRubyVersion: 3.1
# Enforcing a blank line often worsens vertical layout.
Layout/EmptyLineAfterGuardClause:
Enabled: false
# For the extra line between copyright and code.
Layout/EmptyLines:
Enabled: false
# This tends to be problematic, especially for nested hashes. In many cases,
# our code adheres to the "table" style, but we do not want to enforce it.
Layout/HashAlignment:
Enabled: false
# Our current preferred line length.
Layout/LineLength:
Max: 120
# Added in Rubocop 1.7
Layout/SpaceBeforeBrackets:
Enabled: true
# Added in Rubocop 1.7
Lint/AmbiguousAssignment:
Enabled: true
# Added in Rubocop 1.8
Lint/DeprecatedConstants:
Enabled: true
# Added in Rubocop 1.3
Lint/DuplicateBranch:
Enabled: true
# Added in Rubocop 1.1
Lint/DuplicateRegexpCharacterClassElement:
Enabled: true
# Added in Rubocop 1.1
Lint/EmptyBlock:
Enabled: true
# Added in Rubocop 1.3
Lint/EmptyClass:
Enabled: true
# Added in Rubocop 1.8
Lint/LambdaWithoutLiteralBlock:
Enabled: true
# Added in Rubocop 1.2
Lint/NoReturnInBeginEndBlocks:
Enabled: true
# Added in Rubocop 1.9
Lint/NumberedParameterAssignment:
Enabled: true
# Added in Rubocop 1.9
Lint/OrAssignmentToConstant:
Enabled: true
# Added in Rubocop 1.8
Lint/RedundantDirGlobSort:
Enabled: true
# Added in Rubocop 1.9
Lint/SymbolConversion:
Enabled: true
# Added in Rubocop 1.1
Lint/ToEnumArguments:
Enabled: true
# Added in Rubocop 1.9
Lint/TripleQuotes:
Enabled: true
# Added in Rubocop 1.5
Lint/UnexpectedBlockArity:
Enabled: true
# Added in Rubocop 1.1
Lint/UnmodifiedReduceAccumulator:
Enabled: true
Metrics/AbcSize:
Max: 30
Metrics/CyclomaticComplexity:
Max: 10
Metrics/MethodLength:
Max: 25
# Sometimes problematic for API calls which might have a lot of parameters,
# and for generated code.
Metrics/ParameterLists:
Enabled: false
Metrics/PerceivedComplexity:
Max: 10
# Does not allow distinguishing verbs (e.g. is vs has). Also causes problems
# for generated code that might have generated method names.
Naming/PredicateName:
Enabled: false
# Numbers are occasionally semantically useful in names, and also occasionally
# appear in generated code.
Naming/VariableNumber:
Enabled: false
# Better to separate accessors for yardoc and type declarations.
Style/AccessorGrouping:
EnforcedStyle: separated
# Added in Rubocop 1.1
Style/ArgumentsForwarding:
Enabled: true
# Problematic for generated code which might include unicode in comments.
Style/AsciiComments:
Enabled: false
# There are cases where we use the === operator as a general interface, e.g.
# when specifying type checker objects.
Style/CaseEquality:
Enabled: false
# Added in Rubocop 1.2
Style/CollectionCompact:
Enabled: true
# Added in Rubocop 1.1
Style/DocumentDynamicEvalDefinition:
Enabled: true
# We prefer consistent method indentation.
Style/EmptyMethod:
EnforcedStyle: expanded
# Added in Rubocop 1.8
Style/EndlessMethod:
Enabled: true
# Frozen string literals are no more as of Ruby 3.
Style/FrozenStringLiteralComment:
Enabled: false
# Added in Rubocop 1.7
Style/HashExcept:
Enabled: true
# It is sometimes preferable to use the non-modifier form even for single-line
# expressions, for readability.
Style/IfUnlessModifier:
Enabled: false
# Added in Rubocop 1.9
Style/IfWithBooleanLiteralBranches:
Enabled: true
# We adopt Seattle-style paren usage
Style/MethodCallWithArgsParentheses:
AllowParenthesesInCamelCaseMethod: true
AllowParenthesesInChaining: true
AllowParenthesesInMultilineCall: true
Enabled: true
EnforcedStyle: require_parentheses
# We adopt Seattle-style paren usage
Style/MethodDefParentheses:
EnforcedStyle: require_no_parentheses
# Enable use of the different semantics of module_function and extend self.
Style/ModuleFunction:
Enabled: false
# Added in Rubocop 1.2
Style/NegatedIfElseCondition:
Enabled: true
# Added in Rubocop 1.3
Style/NilLambda:
Enabled: true
# Added in Rubocop 1.4
Style/RedundantArgument:
Enabled: true
# Disabled because we prefer to keep begin-end blocks in memoization for
# readability (see https://github.com/rubocop/rubocop/pull/9602).
Style/RedundantBegin:
Enabled: false
# The idiom is useful in a variety of cases. We prefer to allow it.
Style/RescueModifier:
Enabled: false
# We prefer standardizing on double-quoted strings for readability.
Style/StringLiterals:
EnforcedStyle: double_quotes
# Added in Rubocop 1.1
Style/SwapValues:
Enabled: true
# We prefer traditional bracket style for all arrays.
Style/SymbolArray:
EnforcedStyle: brackets
# There are some cases where a full method shows intent better than an attr.
Style/TrivialAccessors:
Enabled: false
# We prefer traditional bracket style for all arrays.
Style/WordArray:
EnforcedStyle: brackets