-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.rubocop.yml
More file actions
219 lines (192 loc) · 5.4 KB
/
.rubocop.yml
File metadata and controls
219 lines (192 loc) · 5.4 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
210
211
212
213
214
215
216
217
218
219
plugins:
- rubocop-rspec
AllCops:
TargetRubyVersion: 2.7
NewCops: enable
SuggestExtensions: false
Style/Documentation:
Enabled: false
Metrics/BlockLength:
Exclude:
- 'spec/**/*'
Naming/FileName:
Exclude:
- 'lib/bsv-sdk.rb'
- 'lib/bsv-attest.rb'
- 'lib/bsv-x402.rb'
# Cryptographic and protocol code uses standard short names (r, s, x, y, n, m, bn, v, etc.)
Naming/MethodParameterName:
AllowedNames:
- r
- s
- v
- z
- x
- y
- n
- m
- bn
- tx
- p1
- p2
# verify(), verify_proof(), and cast_bool() are standard cryptographic/protocol API names.
Naming/PredicateMethod:
AllowedMethods:
- verify
- verify_proof
- cast_bool
- execute
# Cryptographic, script-parsing, and protocol object code is inherently complex;
# splitting into tiny methods would harm readability and auditability.
Metrics/AbcSize:
Exclude:
- 'lib/bsv/primitives/**/*'
- 'lib/bsv/script/**/*'
- 'lib/bsv/transaction/**/*'
- 'lib/bsv/network/**/*'
- 'lib/bsv/wallet/**/*'
- 'lib/bsv/attest.rb'
- 'lib/bsv/attest/**/*'
- 'lib/bsv/x402.rb'
- 'lib/bsv/x402/**/*'
- 'spec/**/*'
Metrics/MethodLength:
Exclude:
- 'lib/bsv/primitives/**/*'
- 'lib/bsv/script/**/*'
- 'lib/bsv/transaction/**/*'
- 'lib/bsv/network/**/*'
- 'lib/bsv/wallet/**/*'
- 'lib/bsv/attest.rb'
- 'lib/bsv/attest/**/*'
- 'lib/bsv/x402.rb'
- 'lib/bsv/x402/**/*'
- 'spec/**/*'
Metrics/CyclomaticComplexity:
Exclude:
- 'lib/bsv/primitives/**/*'
- 'lib/bsv/script/**/*'
- 'lib/bsv/transaction/**/*'
- 'lib/bsv/network/**/*'
- 'lib/bsv/wallet/**/*'
- 'lib/bsv/attest.rb'
- 'lib/bsv/attest/**/*'
- 'lib/bsv/x402.rb'
- 'lib/bsv/x402/**/*'
- 'spec/**/*'
Metrics/PerceivedComplexity:
Exclude:
- 'lib/bsv/primitives/**/*'
- 'lib/bsv/script/**/*'
- 'lib/bsv/transaction/**/*'
- 'lib/bsv/network/**/*'
- 'lib/bsv/wallet/**/*'
- 'lib/bsv/attest.rb'
- 'lib/bsv/attest/**/*'
- 'lib/bsv/x402.rb'
- 'lib/bsv/x402/**/*'
- 'spec/**/*'
Metrics/ModuleLength:
Exclude:
- 'lib/bsv/primitives/ecdsa.rb'
- 'lib/bsv/script/opcodes.rb'
- 'lib/bsv/script/interpreter/operations/**/*'
- 'spec/**/*'
Metrics/ClassLength:
Exclude:
- 'lib/bsv/primitives/**/*'
- 'lib/bsv/script/**/*'
- 'lib/bsv/transaction/transaction.rb'
- 'lib/bsv/transaction/merkle_path.rb'
- 'lib/bsv/transaction/beef.rb'
- 'lib/bsv/x402/**/*'
Metrics/ParameterLists:
Exclude:
- 'lib/bsv/primitives/**/*'
- 'lib/bsv/script/**/*'
- 'lib/bsv/transaction/**/*'
- 'lib/bsv/x402/**/*'
# The interpreter condition stack uses :true/:false symbols intentionally
# (matching the Go SDK pattern) to distinguish from boolean values.
Lint/BooleanSymbol:
Exclude:
- 'lib/bsv/script/interpreter/**/*'
Layout/LineLength:
Max: 150
Exclude:
- 'spec/**/*'
RSpec/ContextWording:
Exclude:
- 'spec/bsv/primitives/**/*'
# Specs for low-level modules legitimately need multiple assertions
# per example and longer examples for thorough test coverage.
RSpec/MultipleExpectations:
Exclude:
- 'spec/bsv/primitives/**/*'
- 'spec/bsv/script/**/*'
- 'spec/bsv/transaction/**/*'
- 'spec/bsv/network/**/*'
- 'spec/bsv/wallet/**/*'
- 'spec/bsv/attest_spec.rb'
- 'spec/bsv/attest/**/*'
- 'spec/x402/**/*'
- 'spec/integration/**/*'
- 'spec/conformance/**/*'
RSpec/MultipleMemoizedHelpers:
Exclude:
- 'spec/bsv/primitives/**/*'
- 'spec/bsv/script/**/*'
- 'spec/bsv/transaction/**/*'
- 'spec/x402/**/*'
- 'spec/conformance/**/*'
RSpec/ExampleLength:
Exclude:
- 'spec/bsv/primitives/**/*'
- 'spec/bsv/script/**/*'
- 'spec/bsv/transaction/**/*'
- 'spec/bsv/network/**/*'
- 'spec/bsv/wallet/**/*'
- 'spec/bsv/attest_spec.rb'
- 'spec/bsv/attest/**/*'
- 'spec/x402/**/*'
- 'spec/integration/**/*'
- 'spec/conformance/**/*'
# Bitcoin opcodes use numbered names (OP_1, OP_2, etc.) — protocol constants.
Naming/VariableNumber:
Exclude:
- 'spec/**/*'
# Interpreter sub-specs and conformance specs legitimately describe parent
# classes or use string descriptions for cross-cutting vector suites.
RSpec/SpecFilePathFormat:
Exclude:
- 'spec/bsv/transaction/p2pkh_spec.rb'
- 'spec/bsv/script/interpreter/**/*'
- 'spec/bsv/primitives/shamir/**/*'
- 'spec/bsv/transaction/benford_number/**/*'
- 'spec/conformance/**/*'
- 'spec/x402/**/*'
# Vector and conformance specs use string describes for cross-cutting test suites.
RSpec/DescribeClass:
Exclude:
- 'spec/bsv/transaction/tx_vectors_spec.rb'
- 'spec/bsv/transaction/sighash_vectors_spec.rb'
- 'spec/bsv/script/interpreter/script_vectors_spec.rb'
- 'spec/integration/**/*'
# Vector specs define constants at spec scope for shared test infrastructure.
Lint/ConstantDefinitionInBlock:
Exclude:
- 'spec/bsv/script/interpreter/script_vectors_spec.rb'
RSpec/LeakyConstantDeclaration:
Exclude:
- 'spec/bsv/script/interpreter/script_vectors_spec.rb'
# Dynamic test generation produces describe blocks populated at runtime.
RSpec/EmptyExampleGroup:
Exclude:
- 'spec/bsv/script/interpreter/script_vectors_spec.rb'
# Integration tests use before(:context) which requires instance variables.
RSpec/BeforeAfterAll:
Exclude:
- 'spec/integration/**/*'
RSpec/InstanceVariable:
Exclude:
- 'spec/integration/**/*'