-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gracefully handle
validate
when an unknown pack is referenced (#131)
* adding failing tests * adding anyhow to simply result errors * avoiding panics on validation
- Loading branch information
Showing
13 changed files
with
136 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
tests/fixtures/references_unknown_pack/config/initializers/inflections.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ActiveSupport::Inflector.inflections do |do_not_couple_implementation_to_this_string| | ||
do_not_couple_implementation_to_this_string.acronym 'API' | ||
|
||
# Using single vs double quotes inconsistently | ||
do_not_couple_implementation_to_this_string.acronym "CSV" | ||
end |
Empty file.
2 changes: 2 additions & 0 deletions
2
tests/fixtures/references_unknown_pack/packs/feature_flags/app/services/feature_flags.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# feature_flags, a utility pack, should not rely on Payments, a product pack | ||
Payments |
2 changes: 2 additions & 0 deletions
2
tests/fixtures/references_unknown_pack/packs/feature_flags/package.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
enforce_architecture: true | ||
layer: product |
2 changes: 2 additions & 0 deletions
2
tests/fixtures/references_unknown_pack/packs/payments/app/services/payments.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module Payments | ||
end |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/references_unknown_pack/packs/payments/package.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
enforce_architecture: true | ||
dependencies: | ||
- packs/unknown-pack | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# See: Setting up the configuration file | ||
# https://github.com/Shopify/packwerk/blob/main/USAGE.md#setting-up-the-configuration-file | ||
|
||
# List of patterns for folder paths to include | ||
# include: | ||
# - "**/*.{rb,rake,erb}" | ||
|
||
# List of patterns for folder paths to exclude | ||
# exclude: | ||
# - "{bin,node_modules,script,tmp,vendor}/**/*" | ||
|
||
# Patterns to find package configuration files | ||
# package_paths: "**/" | ||
|
||
# List of custom associations, if any | ||
# custom_associations: | ||
# - "cache_belongs_to" | ||
|
||
# Whether or not you want the cache enabled (disabled by default) | ||
cache: false | ||
|
||
# Where you want the cache to be stored (default below) | ||
# cache_directory: 'tmp/cache/packwerk' | ||
|
||
architecture_layers: | ||
- tooling | ||
- deprecated | ||
- product | ||
- utilities |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters