modularization_statistics 1.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +67 -0
- data/lib/modularization_statistics/gauge_metric.rb +39 -0
- data/lib/modularization_statistics/private/datadog_reporter.rb +325 -0
- data/lib/modularization_statistics/private/source_code_file.rb +24 -0
- data/lib/modularization_statistics/private.rb +8 -0
- data/lib/modularization_statistics/tag.rb +28 -0
- data/lib/modularization_statistics/tags.rb +20 -0
- data/lib/modularization_statistics.rb +134 -0
- data/sorbet/config +3 -0
- data/sorbet/rbi/gems/bigrails-teams@0.1.0.rbi +120 -0
- data/sorbet/rbi/gems/code_ownership@1.23.0.rbi +336 -0
- data/sorbet/rbi/gems/dogapi@1.45.0.rbi +551 -0
- data/sorbet/rbi/gems/manual.rbi +4 -0
- data/sorbet/rbi/gems/package_protections@0.64.0.rbi +632 -0
- data/sorbet/rbi/gems/parse_packwerk@0.10.0.rbi +140 -0
- data/sorbet/rbi/gems/rspec@3.10.0.rbi +13 -0
- data/sorbet/rbi/todo.rbi +5 -0
- metadata +220 -0
@@ -0,0 +1,632 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `package_protections` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem package_protections`.
|
6
|
+
|
7
|
+
module PackageProtections
|
8
|
+
class << self
|
9
|
+
sig { returns(T::Array[::PackageProtections::ProtectionInterface]) }
|
10
|
+
def all; end
|
11
|
+
|
12
|
+
sig { void }
|
13
|
+
def bust_cache!; end
|
14
|
+
|
15
|
+
sig do
|
16
|
+
params(
|
17
|
+
packages: T::Array[::ParsePackwerk::Package],
|
18
|
+
new_violations: T::Array[::PackageProtections::PerFileViolation]
|
19
|
+
).returns(T::Array[::PackageProtections::Offense])
|
20
|
+
end
|
21
|
+
def get_offenses(packages:, new_violations:); end
|
22
|
+
|
23
|
+
sig do
|
24
|
+
params(
|
25
|
+
package_names: T::Array[::String],
|
26
|
+
all_packages: T::Array[::ParsePackwerk::Package]
|
27
|
+
).returns(T::Array[::ParsePackwerk::Package])
|
28
|
+
end
|
29
|
+
def packages_for_names(package_names, all_packages); end
|
30
|
+
|
31
|
+
sig { params(identifier: ::String).returns(T::Hash[T.untyped, T.untyped]) }
|
32
|
+
def private_cop_config(identifier); end
|
33
|
+
|
34
|
+
sig { params(root_pathname: ::Pathname).returns(::String) }
|
35
|
+
def rubocop_yml(root_pathname: T.unsafe(nil)); end
|
36
|
+
|
37
|
+
sig do
|
38
|
+
params(
|
39
|
+
packages: T::Array[::ParsePackwerk::Package],
|
40
|
+
protection_identifiers: T::Array[::String],
|
41
|
+
verbose: T::Boolean
|
42
|
+
).void
|
43
|
+
end
|
44
|
+
def set_defaults!(packages, protection_identifiers: T.unsafe(nil), verbose: T.unsafe(nil)); end
|
45
|
+
|
46
|
+
sig { params(identifier: ::String).returns(::PackageProtections::ProtectionInterface) }
|
47
|
+
def with_identifier(identifier); end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
PackageProtections::EXPECTED_PACK_DIRECTORIES = T.let(T.unsafe(nil), Array)
|
52
|
+
PackageProtections::Identifier = T.type_alias { ::String }
|
53
|
+
class PackageProtections::IncorrectPublicApiUsageError < ::StandardError; end
|
54
|
+
|
55
|
+
class PackageProtections::Offense < ::T::Struct
|
56
|
+
const :file, ::String
|
57
|
+
const :message, ::String
|
58
|
+
const :package, ::ParsePackwerk::Package
|
59
|
+
const :violation_type, ::String
|
60
|
+
|
61
|
+
sig { returns(::String) }
|
62
|
+
def package_name; end
|
63
|
+
|
64
|
+
class << self
|
65
|
+
def inherited(s); end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
PackageProtections::PROTECTIONS_TODO_YML = T.let(T.unsafe(nil), String)
|
70
|
+
|
71
|
+
class PackageProtections::PerFileViolation < ::T::Struct
|
72
|
+
const :class_name, ::String
|
73
|
+
const :constant_source_package, ::String
|
74
|
+
const :filepath, ::String
|
75
|
+
const :reference_source_package, ::ParsePackwerk::Package
|
76
|
+
const :type, ::String
|
77
|
+
|
78
|
+
sig { returns(T::Boolean) }
|
79
|
+
def dependency?; end
|
80
|
+
|
81
|
+
sig { returns(T::Boolean) }
|
82
|
+
def privacy?; end
|
83
|
+
|
84
|
+
class << self
|
85
|
+
sig do
|
86
|
+
params(
|
87
|
+
violation: ::ParsePackwerk::Violation,
|
88
|
+
reference_source_package: ::ParsePackwerk::Package
|
89
|
+
).returns(T::Array[::PackageProtections::PerFileViolation])
|
90
|
+
end
|
91
|
+
def from(violation, reference_source_package); end
|
92
|
+
|
93
|
+
def inherited(s); end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
module PackageProtections::Private
|
98
|
+
class << self
|
99
|
+
sig { returns(T::Array[::PackageProtections::ProtectedPackage]) }
|
100
|
+
def all_protected_packages; end
|
101
|
+
|
102
|
+
sig { void }
|
103
|
+
def bust_cache!; end
|
104
|
+
|
105
|
+
sig do
|
106
|
+
params(
|
107
|
+
packages: T::Array[::ParsePackwerk::Package],
|
108
|
+
new_violations: T::Array[::PackageProtections::PerFileViolation]
|
109
|
+
).returns(T::Array[::PackageProtections::Offense])
|
110
|
+
end
|
111
|
+
def get_offenses(packages:, new_violations:); end
|
112
|
+
|
113
|
+
sig { params(name: ::String).returns(::PackageProtections::ProtectedPackage) }
|
114
|
+
def get_package_with_name(name); end
|
115
|
+
|
116
|
+
sig do
|
117
|
+
params(
|
118
|
+
package_names: T::Array[::String],
|
119
|
+
all_packages: T::Array[::ParsePackwerk::Package]
|
120
|
+
).returns(T::Array[::ParsePackwerk::Package])
|
121
|
+
end
|
122
|
+
def packages_for_names(package_names, all_packages); end
|
123
|
+
|
124
|
+
sig { params(identifier: ::String).returns(T::Hash[T.untyped, T.untyped]) }
|
125
|
+
def private_cop_config(identifier); end
|
126
|
+
|
127
|
+
sig { params(root_pathname: ::Pathname).returns(::String) }
|
128
|
+
def rubocop_yml(root_pathname:); end
|
129
|
+
|
130
|
+
sig do
|
131
|
+
params(
|
132
|
+
packages: T::Array[::ParsePackwerk::Package],
|
133
|
+
protection_identifiers: T::Array[::String],
|
134
|
+
verbose: T::Boolean
|
135
|
+
).void
|
136
|
+
end
|
137
|
+
def set_defaults!(packages, protection_identifiers:, verbose:); end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
class PackageProtections::Private::ColorizedString
|
142
|
+
sig { params(original_string: ::String, color: ::PackageProtections::Private::ColorizedString::Color).void }
|
143
|
+
def initialize(original_string, color = T.unsafe(nil)); end
|
144
|
+
|
145
|
+
sig { returns(::PackageProtections::Private::ColorizedString) }
|
146
|
+
def blue; end
|
147
|
+
|
148
|
+
sig { returns(::String) }
|
149
|
+
def colorized_to_s; end
|
150
|
+
|
151
|
+
sig { returns(::PackageProtections::Private::ColorizedString) }
|
152
|
+
def green; end
|
153
|
+
|
154
|
+
sig { returns(::PackageProtections::Private::ColorizedString) }
|
155
|
+
def light_blue; end
|
156
|
+
|
157
|
+
sig { returns(::PackageProtections::Private::ColorizedString) }
|
158
|
+
def pink; end
|
159
|
+
|
160
|
+
sig { returns(::PackageProtections::Private::ColorizedString) }
|
161
|
+
def red; end
|
162
|
+
|
163
|
+
sig { returns(::String) }
|
164
|
+
def to_s; end
|
165
|
+
|
166
|
+
sig { returns(::PackageProtections::Private::ColorizedString) }
|
167
|
+
def white; end
|
168
|
+
|
169
|
+
sig { returns(::PackageProtections::Private::ColorizedString) }
|
170
|
+
def yellow; end
|
171
|
+
|
172
|
+
private
|
173
|
+
|
174
|
+
sig { returns(::Integer) }
|
175
|
+
def color_code; end
|
176
|
+
|
177
|
+
sig do
|
178
|
+
params(
|
179
|
+
color: ::PackageProtections::Private::ColorizedString::Color
|
180
|
+
).returns(::PackageProtections::Private::ColorizedString)
|
181
|
+
end
|
182
|
+
def colorize(color); end
|
183
|
+
end
|
184
|
+
|
185
|
+
class PackageProtections::Private::ColorizedString::Color < ::T::Enum
|
186
|
+
enums do
|
187
|
+
Black = new
|
188
|
+
Red = new
|
189
|
+
Green = new
|
190
|
+
Yellow = new
|
191
|
+
Blue = new
|
192
|
+
Pink = new
|
193
|
+
LightBlue = new
|
194
|
+
White = new
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
class PackageProtections::Private::IncomingPrivacyProtection
|
199
|
+
include ::PackageProtections::ProtectionInterface
|
200
|
+
|
201
|
+
sig do
|
202
|
+
override
|
203
|
+
.params(
|
204
|
+
protected_packages: T::Array[::PackageProtections::ProtectedPackage]
|
205
|
+
).returns(T::Array[::PackageProtections::Offense])
|
206
|
+
end
|
207
|
+
def get_offenses_for_existing_violations(protected_packages); end
|
208
|
+
|
209
|
+
sig do
|
210
|
+
override
|
211
|
+
.params(
|
212
|
+
new_violations: T::Array[::PackageProtections::PerFileViolation]
|
213
|
+
).returns(T::Array[::PackageProtections::Offense])
|
214
|
+
end
|
215
|
+
def get_offenses_for_new_violations(new_violations); end
|
216
|
+
|
217
|
+
sig { override.returns(::String) }
|
218
|
+
def humanized_protection_description; end
|
219
|
+
|
220
|
+
sig { override.returns(::String) }
|
221
|
+
def humanized_protection_name; end
|
222
|
+
|
223
|
+
sig { override.returns(::String) }
|
224
|
+
def identifier; end
|
225
|
+
|
226
|
+
sig do
|
227
|
+
override
|
228
|
+
.params(
|
229
|
+
behavior: ::PackageProtections::ViolationBehavior,
|
230
|
+
package: ::ParsePackwerk::Package
|
231
|
+
).returns(T.nilable(::String))
|
232
|
+
end
|
233
|
+
def unmet_preconditions_for_behavior(behavior, package); end
|
234
|
+
|
235
|
+
private
|
236
|
+
|
237
|
+
sig { params(per_file_violation: ::PackageProtections::PerFileViolation).returns(::String) }
|
238
|
+
def message_for_fail_on_any(per_file_violation); end
|
239
|
+
|
240
|
+
sig { params(per_file_violation: ::PackageProtections::PerFileViolation).returns(::String) }
|
241
|
+
def message_for_fail_on_new(per_file_violation); end
|
242
|
+
end
|
243
|
+
|
244
|
+
PackageProtections::Private::IncomingPrivacyProtection::IDENTIFIER = T.let(T.unsafe(nil), String)
|
245
|
+
|
246
|
+
class PackageProtections::Private::MetadataModifiers
|
247
|
+
class << self
|
248
|
+
sig do
|
249
|
+
params(
|
250
|
+
package: ::ParsePackwerk::Package,
|
251
|
+
protection_identifier: ::String,
|
252
|
+
violation_behavior: ::PackageProtections::ViolationBehavior
|
253
|
+
).returns(::ParsePackwerk::Package)
|
254
|
+
end
|
255
|
+
def package_with_modified_protection(package, protection_identifier, violation_behavior); end
|
256
|
+
end
|
257
|
+
end
|
258
|
+
|
259
|
+
class PackageProtections::Private::MultipleNamespacesProtection
|
260
|
+
include ::PackageProtections::ProtectionInterface
|
261
|
+
include ::PackageProtections::RubocopProtectionInterface
|
262
|
+
|
263
|
+
sig do
|
264
|
+
override
|
265
|
+
.params(
|
266
|
+
packages: T::Array[::PackageProtections::ProtectedPackage]
|
267
|
+
).returns(T::Array[::PackageProtections::RubocopProtectionInterface::CopConfig])
|
268
|
+
end
|
269
|
+
def cop_configs(packages); end
|
270
|
+
|
271
|
+
sig { params(package: ::PackageProtections::ProtectedPackage).returns(T::Hash[T.untyped, T.untyped]) }
|
272
|
+
def custom_cop_config(package); end
|
273
|
+
|
274
|
+
sig do
|
275
|
+
override
|
276
|
+
.params(
|
277
|
+
protected_packages: T::Array[::PackageProtections::ProtectedPackage]
|
278
|
+
).returns(T::Array[::PackageProtections::Offense])
|
279
|
+
end
|
280
|
+
def get_offenses_for_existing_violations(protected_packages); end
|
281
|
+
|
282
|
+
sig { override.returns(::String) }
|
283
|
+
def humanized_protection_description; end
|
284
|
+
|
285
|
+
sig { override.returns(::String) }
|
286
|
+
def humanized_protection_name; end
|
287
|
+
|
288
|
+
sig { override.returns(::String) }
|
289
|
+
def identifier; end
|
290
|
+
|
291
|
+
sig do
|
292
|
+
override
|
293
|
+
.params(
|
294
|
+
behavior: ::PackageProtections::ViolationBehavior,
|
295
|
+
package: ::ParsePackwerk::Package
|
296
|
+
).returns(T.nilable(::String))
|
297
|
+
end
|
298
|
+
def unmet_preconditions_for_behavior(behavior, package); end
|
299
|
+
end
|
300
|
+
|
301
|
+
PackageProtections::Private::MultipleNamespacesProtection::COP_NAME = T.let(T.unsafe(nil), String)
|
302
|
+
PackageProtections::Private::MultipleNamespacesProtection::IDENTIFIER = T.let(T.unsafe(nil), String)
|
303
|
+
|
304
|
+
class PackageProtections::Private::OutgoingDependencyProtection
|
305
|
+
include ::PackageProtections::ProtectionInterface
|
306
|
+
|
307
|
+
sig do
|
308
|
+
override
|
309
|
+
.params(
|
310
|
+
protected_packages: T::Array[::PackageProtections::ProtectedPackage]
|
311
|
+
).returns(T::Array[::PackageProtections::Offense])
|
312
|
+
end
|
313
|
+
def get_offenses_for_existing_violations(protected_packages); end
|
314
|
+
|
315
|
+
sig do
|
316
|
+
override
|
317
|
+
.params(
|
318
|
+
new_violations: T::Array[::PackageProtections::PerFileViolation]
|
319
|
+
).returns(T::Array[::PackageProtections::Offense])
|
320
|
+
end
|
321
|
+
def get_offenses_for_new_violations(new_violations); end
|
322
|
+
|
323
|
+
sig { override.returns(::String) }
|
324
|
+
def humanized_protection_description; end
|
325
|
+
|
326
|
+
sig { override.returns(::String) }
|
327
|
+
def humanized_protection_name; end
|
328
|
+
|
329
|
+
sig { override.returns(::String) }
|
330
|
+
def identifier; end
|
331
|
+
|
332
|
+
sig do
|
333
|
+
override
|
334
|
+
.params(
|
335
|
+
behavior: ::PackageProtections::ViolationBehavior,
|
336
|
+
package: ::ParsePackwerk::Package
|
337
|
+
).returns(T.nilable(::String))
|
338
|
+
end
|
339
|
+
def unmet_preconditions_for_behavior(behavior, package); end
|
340
|
+
|
341
|
+
private
|
342
|
+
|
343
|
+
sig { params(per_file_violation: ::PackageProtections::PerFileViolation).returns(::String) }
|
344
|
+
def message_for_fail_on_any(per_file_violation); end
|
345
|
+
|
346
|
+
sig { params(per_file_violation: ::PackageProtections::PerFileViolation).returns(::String) }
|
347
|
+
def message_for_fail_on_new(per_file_violation); end
|
348
|
+
end
|
349
|
+
|
350
|
+
PackageProtections::Private::OutgoingDependencyProtection::IDENTIFIER = T.let(T.unsafe(nil), String)
|
351
|
+
|
352
|
+
class PackageProtections::Private::Output
|
353
|
+
class << self
|
354
|
+
sig { params(str: ::String).void }
|
355
|
+
def p(str); end
|
356
|
+
|
357
|
+
sig { params(str: ::PackageProtections::Private::ColorizedString, colorized: T::Boolean).void }
|
358
|
+
def p_colorized(str, colorized:); end
|
359
|
+
end
|
360
|
+
end
|
361
|
+
|
362
|
+
class PackageProtections::Private::TypedApiProtection
|
363
|
+
include ::PackageProtections::ProtectionInterface
|
364
|
+
include ::PackageProtections::RubocopProtectionInterface
|
365
|
+
|
366
|
+
sig do
|
367
|
+
override
|
368
|
+
.params(
|
369
|
+
packages: T::Array[::PackageProtections::ProtectedPackage]
|
370
|
+
).returns(T::Array[::PackageProtections::RubocopProtectionInterface::CopConfig])
|
371
|
+
end
|
372
|
+
def cop_configs(packages); end
|
373
|
+
|
374
|
+
sig do
|
375
|
+
override
|
376
|
+
.params(
|
377
|
+
protected_packages: T::Array[::PackageProtections::ProtectedPackage]
|
378
|
+
).returns(T::Array[::PackageProtections::Offense])
|
379
|
+
end
|
380
|
+
def get_offenses_for_existing_violations(protected_packages); end
|
381
|
+
|
382
|
+
sig { override.returns(::String) }
|
383
|
+
def humanized_protection_description; end
|
384
|
+
|
385
|
+
sig { override.returns(::String) }
|
386
|
+
def humanized_protection_name; end
|
387
|
+
|
388
|
+
sig { override.returns(::String) }
|
389
|
+
def identifier; end
|
390
|
+
|
391
|
+
sig do
|
392
|
+
override
|
393
|
+
.params(
|
394
|
+
behavior: ::PackageProtections::ViolationBehavior,
|
395
|
+
package: ::ParsePackwerk::Package
|
396
|
+
).returns(T.nilable(::String))
|
397
|
+
end
|
398
|
+
def unmet_preconditions_for_behavior(behavior, package); end
|
399
|
+
end
|
400
|
+
|
401
|
+
PackageProtections::Private::TypedApiProtection::COP_NAME = T.let(T.unsafe(nil), String)
|
402
|
+
PackageProtections::Private::TypedApiProtection::IDENTIFIER = T.let(T.unsafe(nil), String)
|
403
|
+
|
404
|
+
class PackageProtections::Private::VisibilityProtection
|
405
|
+
include ::PackageProtections::ProtectionInterface
|
406
|
+
|
407
|
+
sig { returns(::PackageProtections::ViolationBehavior) }
|
408
|
+
def default_behavior; end
|
409
|
+
|
410
|
+
sig do
|
411
|
+
override
|
412
|
+
.params(
|
413
|
+
protected_packages: T::Array[::PackageProtections::ProtectedPackage]
|
414
|
+
).returns(T::Array[::PackageProtections::Offense])
|
415
|
+
end
|
416
|
+
def get_offenses_for_existing_violations(protected_packages); end
|
417
|
+
|
418
|
+
sig do
|
419
|
+
override
|
420
|
+
.params(
|
421
|
+
new_violations: T::Array[::PackageProtections::PerFileViolation]
|
422
|
+
).returns(T::Array[::PackageProtections::Offense])
|
423
|
+
end
|
424
|
+
def get_offenses_for_new_violations(new_violations); end
|
425
|
+
|
426
|
+
sig { override.returns(::String) }
|
427
|
+
def humanized_protection_description; end
|
428
|
+
|
429
|
+
sig { override.returns(::String) }
|
430
|
+
def humanized_protection_name; end
|
431
|
+
|
432
|
+
sig { override.returns(::String) }
|
433
|
+
def identifier; end
|
434
|
+
|
435
|
+
sig do
|
436
|
+
override
|
437
|
+
.params(
|
438
|
+
behavior: ::PackageProtections::ViolationBehavior,
|
439
|
+
package: ::ParsePackwerk::Package
|
440
|
+
).returns(T.nilable(::String))
|
441
|
+
end
|
442
|
+
def unmet_preconditions_for_behavior(behavior, package); end
|
443
|
+
|
444
|
+
private
|
445
|
+
|
446
|
+
sig { params(per_file_violation: ::PackageProtections::PerFileViolation).returns(::String) }
|
447
|
+
def message_for_fail_on_any(per_file_violation); end
|
448
|
+
|
449
|
+
sig { params(per_file_violation: ::PackageProtections::PerFileViolation).returns(::String) }
|
450
|
+
def message_for_fail_on_new(per_file_violation); end
|
451
|
+
end
|
452
|
+
|
453
|
+
PackageProtections::Private::VisibilityProtection::IDENTIFIER = T.let(T.unsafe(nil), String)
|
454
|
+
|
455
|
+
class PackageProtections::ProtectedPackage < ::T::Struct
|
456
|
+
const :deprecated_references, ::ParsePackwerk::DeprecatedReferences
|
457
|
+
const :original_package, ::ParsePackwerk::Package
|
458
|
+
const :protections, T::Hash[::String, ::PackageProtections::ViolationBehavior]
|
459
|
+
|
460
|
+
sig { returns(T::Array[::String]) }
|
461
|
+
def dependencies; end
|
462
|
+
|
463
|
+
sig { returns(T::Hash[T.untyped, T.untyped]) }
|
464
|
+
def metadata; end
|
465
|
+
|
466
|
+
sig { returns(::String) }
|
467
|
+
def name; end
|
468
|
+
|
469
|
+
sig { params(key: ::String).returns(::PackageProtections::ViolationBehavior) }
|
470
|
+
def violation_behavior_for(key); end
|
471
|
+
|
472
|
+
sig { returns(T::Array[::ParsePackwerk::Violation]) }
|
473
|
+
def violations; end
|
474
|
+
|
475
|
+
sig { returns(T::Set[::String]) }
|
476
|
+
def visible_to; end
|
477
|
+
|
478
|
+
sig { returns(::Pathname) }
|
479
|
+
def yml; end
|
480
|
+
|
481
|
+
class << self
|
482
|
+
sig { params(original_package: ::ParsePackwerk::Package).returns(::PackageProtections::ProtectedPackage) }
|
483
|
+
def from(original_package); end
|
484
|
+
|
485
|
+
sig do
|
486
|
+
params(
|
487
|
+
protection: ::PackageProtections::ProtectionInterface,
|
488
|
+
metadata: T::Hash[T.untyped, T.untyped],
|
489
|
+
package: ::ParsePackwerk::Package
|
490
|
+
).returns(::PackageProtections::ViolationBehavior)
|
491
|
+
end
|
492
|
+
def get_violation_behavior(protection, metadata, package); end
|
493
|
+
|
494
|
+
def inherited(s); end
|
495
|
+
end
|
496
|
+
end
|
497
|
+
|
498
|
+
module PackageProtections::ProtectionInterface
|
499
|
+
requires_ancestor { Kernel }
|
500
|
+
|
501
|
+
abstract!
|
502
|
+
|
503
|
+
sig { returns(::PackageProtections::ViolationBehavior) }
|
504
|
+
def default_behavior; end
|
505
|
+
|
506
|
+
sig do
|
507
|
+
params(
|
508
|
+
protected_packages: T::Array[::PackageProtections::ProtectedPackage],
|
509
|
+
new_violations: T::Array[::PackageProtections::PerFileViolation]
|
510
|
+
).returns(T::Array[::PackageProtections::Offense])
|
511
|
+
end
|
512
|
+
def get_offenses(protected_packages, new_violations); end
|
513
|
+
|
514
|
+
sig do
|
515
|
+
abstract
|
516
|
+
.params(
|
517
|
+
protected_packages: T::Array[::PackageProtections::ProtectedPackage]
|
518
|
+
).returns(T::Array[::PackageProtections::Offense])
|
519
|
+
end
|
520
|
+
def get_offenses_for_existing_violations(protected_packages); end
|
521
|
+
|
522
|
+
sig do
|
523
|
+
abstract
|
524
|
+
.params(
|
525
|
+
new_violations: T::Array[::PackageProtections::PerFileViolation]
|
526
|
+
).returns(T::Array[::PackageProtections::Offense])
|
527
|
+
end
|
528
|
+
def get_offenses_for_new_violations(new_violations); end
|
529
|
+
|
530
|
+
sig { abstract.returns(::String) }
|
531
|
+
def humanized_protection_description; end
|
532
|
+
|
533
|
+
sig { abstract.returns(::String) }
|
534
|
+
def humanized_protection_name; end
|
535
|
+
|
536
|
+
sig { abstract.returns(::String) }
|
537
|
+
def identifier; end
|
538
|
+
|
539
|
+
sig do
|
540
|
+
params(
|
541
|
+
behavior: ::PackageProtections::ViolationBehavior,
|
542
|
+
package: ::ParsePackwerk::Package
|
543
|
+
).returns(T::Boolean)
|
544
|
+
end
|
545
|
+
def supports_violation_behavior?(behavior, package); end
|
546
|
+
|
547
|
+
sig do
|
548
|
+
abstract
|
549
|
+
.params(
|
550
|
+
behavior: ::PackageProtections::ViolationBehavior,
|
551
|
+
package: ::ParsePackwerk::Package
|
552
|
+
).returns(T.nilable(::String))
|
553
|
+
end
|
554
|
+
def unmet_preconditions_for_behavior(behavior, package); end
|
555
|
+
end
|
556
|
+
|
557
|
+
module PackageProtections::RubocopProtectionInterface
|
558
|
+
include ::PackageProtections::ProtectionInterface
|
559
|
+
|
560
|
+
abstract!
|
561
|
+
|
562
|
+
sig do
|
563
|
+
abstract
|
564
|
+
.params(
|
565
|
+
packages: T::Array[::PackageProtections::ProtectedPackage]
|
566
|
+
).returns(T::Array[::PackageProtections::RubocopProtectionInterface::CopConfig])
|
567
|
+
end
|
568
|
+
def cop_configs(packages); end
|
569
|
+
|
570
|
+
sig { params(package: ::PackageProtections::ProtectedPackage).returns(T::Hash[T.untyped, T.untyped]) }
|
571
|
+
def custom_cop_config(package); end
|
572
|
+
|
573
|
+
sig do
|
574
|
+
override
|
575
|
+
.params(
|
576
|
+
new_violations: T::Array[::PackageProtections::PerFileViolation]
|
577
|
+
).returns(T::Array[::PackageProtections::Offense])
|
578
|
+
end
|
579
|
+
def get_offenses_for_new_violations(new_violations); end
|
580
|
+
|
581
|
+
private
|
582
|
+
|
583
|
+
sig { params(rule: ::String).returns(T::Set[::String]) }
|
584
|
+
def exclude_for_rule(rule); end
|
585
|
+
|
586
|
+
class << self
|
587
|
+
sig { void }
|
588
|
+
def bust_rubocop_todo_yml_cache; end
|
589
|
+
|
590
|
+
sig { returns(T.untyped) }
|
591
|
+
def rubocop_todo_yml; end
|
592
|
+
end
|
593
|
+
end
|
594
|
+
|
595
|
+
class PackageProtections::RubocopProtectionInterface::CopConfig < ::T::Struct
|
596
|
+
const :enabled, T::Boolean, default: T.unsafe(nil)
|
597
|
+
const :exclude_paths, T::Array[::String], default: T.unsafe(nil)
|
598
|
+
const :include_paths, T::Array[::String], default: T.unsafe(nil)
|
599
|
+
const :name, ::String
|
600
|
+
|
601
|
+
sig { returns(::String) }
|
602
|
+
def to_rubocop_yml_compatible_format; end
|
603
|
+
|
604
|
+
class << self
|
605
|
+
def inherited(s); end
|
606
|
+
end
|
607
|
+
end
|
608
|
+
|
609
|
+
class PackageProtections::ViolationBehavior < ::T::Enum
|
610
|
+
enums do
|
611
|
+
FailOnAny = new
|
612
|
+
FailOnNew = new
|
613
|
+
FailNever = new
|
614
|
+
end
|
615
|
+
|
616
|
+
sig { returns(T::Boolean) }
|
617
|
+
def enabled?; end
|
618
|
+
|
619
|
+
sig { returns(T::Boolean) }
|
620
|
+
def fail_never?; end
|
621
|
+
|
622
|
+
sig { returns(T::Boolean) }
|
623
|
+
def fail_on_any?; end
|
624
|
+
|
625
|
+
sig { returns(T::Boolean) }
|
626
|
+
def fail_on_new?; end
|
627
|
+
|
628
|
+
class << self
|
629
|
+
sig { params(value: T.untyped).returns(::PackageProtections::ViolationBehavior) }
|
630
|
+
def from_raw_value(value); end
|
631
|
+
end
|
632
|
+
end
|