-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.rubocop.yml
More file actions
209 lines (159 loc) · 5.62 KB
/
Copy path.rubocop.yml
File metadata and controls
209 lines (159 loc) · 5.62 KB
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
plugins:
- rubocop-rspec
AllCops:
TargetRubyVersion: 3.2
NewCops: enable
SuggestExtensions: false
Exclude:
- "vendor/**/*"
- "*.gemspec"
- "lib/pinot/proto/**/*" # generated protobuf file
# ── Layout ──────────────────────────────────────────────────────────────────
Layout/LineLength:
Max: 120
AllowedPatterns:
- '^\s*#' # comments
- '^\s*raise ' # long error messages
- '^\s*[A-Z_]+ = ' # long constant assignments (inline JSON fixtures in specs)
- '^\s*descriptor_data' # generated protobuf data
Exclude:
# spec files contain inline JSON test fixtures that cannot be line-wrapped
- "spec/**/*"
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented_relative_to_receiver
# ── Style ────────────────────────────────────────────────────────────────────
Style/StringLiterals:
EnforcedStyle: double_quotes
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
Style/Documentation:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false
Style/GuardClause:
Enabled: false
Style/NumericPredicate:
Enabled: false
Style/ExplicitBlockArgument:
Enabled: false
Style/CaseEquality:
Enabled: false
# ── Metrics ─────────────────────────────────────────────────────────────────
Metrics/MethodLength:
Max: 30
Exclude:
# Transport#execute has retry loop + error mapping — intentionally long
- "lib/pinot/transport.rb"
# from_config handles 4 transport types — intentionally long
- "lib/pinot/connection_factory.rb"
Metrics/ClassLength:
Max: 200
Metrics/BlockLength:
Max: 50
Exclude:
- "spec/**/*"
Metrics/AbcSize:
Max: 30
Exclude:
# BrokerResponse#initialize maps 20+ JSON fields
- "lib/pinot/response.rb"
# Transport#execute has retry + error mapping
- "lib/pinot/transport.rb"
# ClientConfig#validate! has many field checks
- "lib/pinot/config.rb"
# from_config dispatches across 4 transport types
- "lib/pinot/connection_factory.rb"
# test helper builds complex mock
- "spec/pinot/transport_spec.rb"
Metrics/CyclomaticComplexity:
Max: 12
Exclude:
# get_int / get_long / BrokerResponse#initialize branch heavily on types
- "lib/pinot/response.rb"
# from_config dispatches across 4 transport types
- "lib/pinot/connection_factory.rb"
Metrics/PerceivedComplexity:
Max: 12
Exclude:
- "lib/pinot/response.rb"
- "lib/pinot/connection_factory.rb"
Metrics/ParameterLists:
Max: 8
Exclude:
# ClientConfig constructor mirrors all config options — intentionally wide
- "lib/pinot/config.rb"
# ── Naming ───────────────────────────────────────────────────────────────────
Naming/MethodParameterName:
MinNameLength: 1 # allow single-letter params: e, k, v
Naming/AccessorMethodName:
Enabled: false # allow get_int, get_long etc. (Pinot API convention)
Naming/PredicateMethod:
Enabled: false # setup_watcher and similar internal names
# ── Lint ─────────────────────────────────────────────────────────────────────
Lint/DuplicateMethods:
Enabled: true
Exclude:
# OTel spec redefines FakeTracerProvider#tracer intentionally
- "spec/pinot/open_telemetry_spec.rb"
Lint/FloatOutOfRange:
Enabled: true
Exclude:
# boundary value tests intentionally use out-of-range float literals
- "spec/pinot/response_spec.rb"
Lint/SuppressedException:
Enabled: true
AllowComments: true
Exclude:
# rescue blocks in specs intentionally swallow errors to test behaviour
- "spec/**/*"
Lint/EmptyBlock:
Exclude:
# paginator tests intentionally pass no-op blocks to test iteration
- "spec/pinot/paginator_spec.rb"
Lint/EmptyClass:
Exclude:
# gRPC spec defines empty stub classes as stand-ins
- "spec/pinot/grpc_transport_spec.rb"
Lint/RequireParentheses:
Enabled: true
# ── RSpec ────────────────────────────────────────────────────────────────────
RSpec/ExampleLength:
Max: 40
RSpec/MultipleExpectations:
Max: 8
Exclude:
# response_spec mirrors Go test payloads — many assertions per example is correct
- "spec/pinot/response_spec.rb"
- "spec/integration/advanced_spec.rb"
RSpec/NestedGroups:
Max: 5
RSpec/DescribeClass:
Enabled: false
RSpec/SpecFilePathFormat:
Enabled: false
RSpec/SpecFilePathSuffix:
Enabled: false
RSpec/VerifiedDoubles:
Enabled: false
RSpec/MessageSpies:
Enabled: false
RSpec/StubbedMock:
Enabled: false
RSpec/NoExpectationExample:
Enabled: false
RSpec/MultipleMemoizedHelpers:
Max: 10
RSpec/NamedSubject:
Enabled: false
RSpec/DescribeMethod:
Enabled: false
RSpec/MultipleDescribes:
Enabled: false
RSpec/AnyInstance:
Exclude:
# railtie_spec uses allow_any_instance_of(Object) to simulate LoadError on require
- "spec/pinot/railtie_spec.rb"
RSpec/IdenticalEqualityAssertion:
Enabled: false
RSpec/ExpectInLet:
Enabled: false