package_protections 3.1.0 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aabad25e536a226f791248e858e8db7fc67410b2d623879326165630bfd0922d
|
4
|
+
data.tar.gz: 64b1d4b5ab05315e9c5ecefdd3105af7485a6f2ed0ba59b9ae456c306b824d72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58aea344a1b283458d878b224c02fd339e27ca541f2ee025a65970ca94fc717ad5b95137e577760cb512fabf4c5657ccb15f8bc57f78330960294a47c2ad1898
|
7
|
+
data.tar.gz: 2700f4963e5fe0c5b987aede413458a7181ee8e471b9689bf0dcd0659bd535e99ffee83487ae88c1acfbcc245e8f62da91c070a77bcbea060a4a59bc00b21e19
|
@@ -10,36 +10,6 @@ module RuboCop
|
|
10
10
|
extend T::Sig
|
11
11
|
include ::PackageProtections::RubocopProtectionInterface
|
12
12
|
|
13
|
-
# We override `cop_configs` for this protection.
|
14
|
-
# The default behavior disables cops when a package has turned off a protection.
|
15
|
-
# However: namespace violations can occur even when one package has TURNED OFF their namespace protection
|
16
|
-
# but another package has it turned on. Therefore, all packages must always be opted in no matter what.
|
17
|
-
#
|
18
|
-
sig do
|
19
|
-
params(packages: T::Array[::PackageProtections::ProtectedPackage])
|
20
|
-
.returns(T::Array[::PackageProtections::RubocopProtectionInterface::CopConfig])
|
21
|
-
end
|
22
|
-
def cop_configs(packages)
|
23
|
-
include_packs = T.let([], T::Array[String])
|
24
|
-
packages.each do |p|
|
25
|
-
enabled_for_pack = !p.violation_behavior_for(NamespacedUnderPackageName::IDENTIFIER).fail_never?
|
26
|
-
if enabled_for_pack
|
27
|
-
include_packs << p.name
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
[
|
32
|
-
::PackageProtections::RubocopProtectionInterface::CopConfig.new(
|
33
|
-
name: cop_name,
|
34
|
-
enabled: include_packs.any?,
|
35
|
-
metadata: {
|
36
|
-
'IncludePacks' => include_packs,
|
37
|
-
'GloballyPermittedNamespaces' => ::RuboCop::Packs.config.globally_permitted_namespaces
|
38
|
-
}
|
39
|
-
)
|
40
|
-
]
|
41
|
-
end
|
42
|
-
|
43
13
|
sig { override.returns(T::Array[String]) }
|
44
14
|
def included_globs_for_pack
|
45
15
|
[
|