packwerk-extensions 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/packwerk/architecture/validator.rb +8 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 661762b44e28e84ff3b70007bc039b6f767ddf638524f5a069a832e1f0d2fb34
|
4
|
+
data.tar.gz: a229b9432f95c10b211a411fee200e48721ff8d3c6b3fd1b745f8211cf58038a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32e5084af7d8e7cba4b743d0be13d29c1ea05b0c6e00ab7d0b9a38a229545093cf21f9e18da883987e487588f5bb7a47cc8728912332c9f295a42b03432bafc3
|
7
|
+
data.tar.gz: 01ff189cc3e645da3eeab3176351ebc0d23d274a9d20269f32733cdb2771169f365857bc946a66e5982c447887f81817fee047b82709e34115f18abaa53a0479
|
@@ -22,11 +22,12 @@ module Packwerk
|
|
22
22
|
results << result
|
23
23
|
next if !result.ok?
|
24
24
|
|
25
|
-
|
25
|
+
package = Package.from(package, layers)
|
26
|
+
|
27
|
+
result = check_layer_setting(package, f)
|
26
28
|
results << result
|
27
29
|
next if !result.ok?
|
28
30
|
|
29
|
-
package = Package.from(package, layers)
|
30
31
|
results += check_dependencies_setting(package_set, package, f)
|
31
32
|
end
|
32
33
|
|
@@ -65,17 +66,16 @@ module Packwerk
|
|
65
66
|
end
|
66
67
|
|
67
68
|
sig do
|
68
|
-
params(
|
69
|
+
params(package: Package, config_file_path: String).returns(Result)
|
69
70
|
end
|
70
|
-
def check_layer_setting(
|
71
|
-
|
72
|
-
enforce_architecture_enabled = !(enforce_architecture.nil? || enforce_architecture == false)
|
71
|
+
def check_layer_setting(package, config_file_path)
|
72
|
+
layer = package.layer
|
73
73
|
valid_layer = layer.nil? || layers.names.include?(layer)
|
74
74
|
|
75
|
-
if layer.nil? &&
|
75
|
+
if layer.nil? && package.enforces?
|
76
76
|
Result.new(
|
77
77
|
ok: false,
|
78
|
-
error_value: "Invalid 'layer' option in #{config_file_path.inspect}: #{layer.inspect}. `layer` must be set if `enforce_architecture` is on."
|
78
|
+
error_value: "Invalid 'layer' option in #{config_file_path.inspect}: #{package.layer.inspect}. `layer` must be set if `enforce_architecture` is on."
|
79
79
|
)
|
80
80
|
elsif valid_layer
|
81
81
|
Result.new(ok: true)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: packwerk-extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gusto Engineers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: packwerk
|