packwerk-extensions 0.0.8 → 0.0.9

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: 661762b44e28e84ff3b70007bc039b6f767ddf638524f5a069a832e1f0d2fb34
4
- data.tar.gz: a229b9432f95c10b211a411fee200e48721ff8d3c6b3fd1b745f8211cf58038a
3
+ metadata.gz: a4cd61088407945a3e4f58a0a5a3959759683e9186646a4fca4959b79bcbb9b3
4
+ data.tar.gz: 855d5ce12ce1d3dba10f06e67e8c25e519d46073fc7eaaa1df67a9fc2777fa09
5
5
  SHA512:
6
- metadata.gz: 32e5084af7d8e7cba4b743d0be13d29c1ea05b0c6e00ab7d0b9a38a229545093cf21f9e18da883987e487588f5bb7a47cc8728912332c9f295a42b03432bafc3
7
- data.tar.gz: 01ff189cc3e645da3eeab3176351ebc0d23d274a9d20269f32733cdb2771169f365857bc946a66e5982c447887f81817fee047b82709e34115f18abaa53a0479
6
+ metadata.gz: 7efea5e86a203158a431c43acb5bf422257e5d9d1ec4ddddc13000b733ca8f000c713dbe72bf30cf7a735c5292a736de2570909cd7cc96182e61cc4af8c92804
7
+ data.tar.gz: a265c58f6976133334b818847154d5fe3663144c1e956b607b6ec7d315de7c7d9086968329a438eb0dac9384b380f942b8bac8e36ca41345cbf08cc0f7029245
data/README.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # packwerk-extensions
2
2
 
3
- `packwerk-extensions` is a home for checker extensions for packwerk.
3
+ `packwerk-extensions` is a home for checker extensions for [packwerk](https://github.com/Shopify/packwerk) 3.
4
+
5
+ Note that packwerk has not yet released packwerk 3. If you'd like to use `packwerk-extensions`, you'll need to point your `Gemfile` at the `packwerk` `main` branch:
6
+ ```ruby
7
+ gem 'packwerk', github: 'Shopify/packwerk', branch: 'main'
8
+ ```
4
9
 
5
10
  Currently, it ships the following checkers to help improve the boundaries between packages. These checkers are:
6
11
  - A `privacy` checker that ensures other packages are using your package's public API
@@ -91,20 +91,21 @@ module Packwerk
91
91
  params(config_file_path: String, setting: T.untyped).returns(Result)
92
92
  end
93
93
  def check_enforce_architecture_setting(config_file_path, setting)
94
+ activated_value = [true, 'strict'].include?(setting)
94
95
  valid_value = [true, nil, false, 'strict'].include?(setting)
95
96
  layers_set = layers.names.any?
96
- if valid_value && layers_set
97
- Result.new(ok: true)
98
- elsif valid_value
97
+ if !valid_value
99
98
  Result.new(
100
99
  ok: false,
101
- error_value: "Cannot set 'enforce_architecture' option in #{config_file_path.inspect} until `architectural_layers` have been specified in `packwerk.yml`"
100
+ error_value: "Invalid 'enforce_architecture' option in #{config_file_path.inspect}: #{setting.inspect}"
102
101
  )
103
- else
102
+ elsif activated_value && !layers_set
104
103
  Result.new(
105
104
  ok: false,
106
- error_value: "Invalid 'enforce_architecture' option in #{config_file_path.inspect}: #{setting.inspect}"
105
+ error_value: "Cannot set 'enforce_architecture' option in #{config_file_path.inspect} until `architectural_layers` have been specified in `packwerk.yml`"
107
106
  )
107
+ else
108
+ Result.new(ok: true)
108
109
  end
109
110
  end
110
111
  end
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.8
4
+ version: 0.0.9
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-29 00:00:00.000000000 Z
11
+ date: 2022-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: packwerk