-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Checker error template overrides (#2)
* adding checker error template overrides * bumping version * adding error template overrides description
- Loading branch information
Showing
42 changed files
with
318 additions
and
21 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/layer_violations_with_overrides/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
...ixtures/layer_violations_with_overrides/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/layer_violations_with_overrides/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_layers: true | ||
layer: utilities |
2 changes: 2 additions & 0 deletions
2
tests/fixtures/layer_violations_with_overrides/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 |
2 changes: 2 additions & 0 deletions
2
tests/fixtures/layer_violations_with_overrides/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,2 @@ | ||
enforce_layers: true | ||
layer: product |
32 changes: 32 additions & 0 deletions
32
tests/fixtures/layer_violations_with_overrides/packwerk.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,32 @@ | ||
# 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' | ||
|
||
layers: | ||
- tooling | ||
- deprecated | ||
- product | ||
- utilities | ||
|
||
checker_overrides: | ||
layer_error_template: "{{reference_location}}Layer violation: `{{constant_name}}` belongs to `{{defining_pack_name}}` (whose layer is `{{defining_layer}}`) cannot be accessed from `{{referencing_pack_name}}` (whose layer is `{{referencing_layer}}`). See https://go/pks-layer" |
3 changes: 3 additions & 0 deletions
3
tests/fixtures/privacy_violation_overrides/app/company_data/widget.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,3 @@ | ||
module Company | ||
class Widget end | ||
end |
1 change: 1 addition & 0 deletions
1
tests/fixtures/privacy_violation_overrides/app/services/some_root_class.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 @@ | ||
class SomeRootClass; end |
5 changes: 5 additions & 0 deletions
5
tests/fixtures/privacy_violation_overrides/frontend/ui_helper.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,5 @@ | ||
module UiHelper | ||
def self.help | ||
"I'm a helper" | ||
end | ||
end |
1 change: 1 addition & 0 deletions
1
tests/fixtures/privacy_violation_overrides/node_modules/file.rb
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
tests/fixtures/privacy_violation_overrides/node_modules/subfolder/file.rb
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Empty file.
1 change: 1 addition & 0 deletions
1
tests/fixtures/privacy_violation_overrides/packs/bar/app/models/concerns/some_concern.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 @@ | ||
module SomeConcern; end |
3 changes: 3 additions & 0 deletions
3
tests/fixtures/privacy_violation_overrides/packs/bar/app/services/bar.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,3 @@ | ||
module Bar | ||
def bar; end | ||
end |
1 change: 1 addition & 0 deletions
1
tests/fixtures/privacy_violation_overrides/packs/bar/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 @@ | ||
enforce_privacy: true |
Empty file.
Empty file.
9 changes: 9 additions & 0 deletions
9
tests/fixtures/privacy_violation_overrides/packs/foo/app/services/foo.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,9 @@ | ||
module Foo | ||
def calls_bar_without_a_stated_dependency | ||
::Bar | ||
end | ||
|
||
def calls_baz_with_a_stated_dependency | ||
Baz | ||
end | ||
end |
5 changes: 5 additions & 0 deletions
5
tests/fixtures/privacy_violation_overrides/packs/foo/app/services/foo/bar.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,5 @@ | ||
# This defines ::Foo::Bar, which is different than ::Bar | ||
module Foo | ||
module Bar | ||
end | ||
end |
1 change: 1 addition & 0 deletions
1
tests/fixtures/privacy_violation_overrides/packs/foo/app/views/foo.erb
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 changes: 4 additions & 0 deletions
4
tests/fixtures/privacy_violation_overrides/packs/foo/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_dependencies: true | ||
enforce_privacy: true | ||
dependencies: | ||
- packs/baz |
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,30 @@ | ||
# 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 | ||
|
||
autoload_roots: | ||
app/company_data: "::Company" | ||
|
||
# Where you want the cache to be stored (default below) | ||
# cache_directory: 'tmp/cache/packwerk' | ||
|
||
checker_overrides: | ||
privacy_error_template: "{{reference_location}}Privacy violation: `{{constant_name}}` is private to `{{defining_pack_name}}`, but referenced from `{{referencing_pack_name}}`. See https://go/pks-privacy" | ||
dependency_error_template: "{{reference_location}}Dependency violation: `{{constant_name}}` belongs to `{{defining_pack_name}}`, but `{{referencing_pack_relative_yml}}` does not specify a dependency on `{{defining_pack_name}}`. See https://go/pks-dependency" |
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 @@ | ||
# some ruby script |
Empty file.
5 changes: 5 additions & 0 deletions
5
tests/fixtures/visibility_violations_with_overrides/packs/baz/app/services/baz.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,5 @@ | ||
module Baz | ||
def sumpn | ||
Foo.nothing | ||
end | ||
end |
2 changes: 2 additions & 0 deletions
2
tests/fixtures/visibility_violations_with_overrides/packs/baz/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 @@ | ||
dependencies: | ||
- packs/foos/foo |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/visibility_violations_with_overrides/packs/foos/foo/app/services/foo.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,4 @@ | ||
module Foo | ||
def self.nothing | ||
end | ||
end |
5 changes: 5 additions & 0 deletions
5
tests/fixtures/visibility_violations_with_overrides/packs/foos/foo/app/services/other_foo.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,5 @@ | ||
module OtherFoo | ||
def calls_bar_without_a_stated_dependency | ||
::Bar | ||
end | ||
end |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/visibility_violations_with_overrides/packs/foos/foo/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_visibility: true | ||
visible_to: | ||
- packs/foos/too | ||
|
5 changes: 5 additions & 0 deletions
5
tests/fixtures/visibility_violations_with_overrides/packs/foos/too/app/services/ref_foo.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,5 @@ | ||
module Too | ||
def sumpn | ||
Foo.nothing | ||
end | ||
end |
1 change: 1 addition & 0 deletions
1
tests/fixtures/visibility_violations_with_overrides/packs/foos/too/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 changes: 2 additions & 0 deletions
2
tests/fixtures/visibility_violations_with_overrides/packs/foos/zoo/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 @@ | ||
dependencies: | ||
- packs/foos/foo |
25 changes: 25 additions & 0 deletions
25
tests/fixtures/visibility_violations_with_overrides/packwerk.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,25 @@ | ||
# 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' | ||
checker_overrides: | ||
visibility_error_template: "{{reference_location}}Visibility violation: `{{constant_name}}` belongs to `{{defining_pack_name}}`, which is not visible to `{{referencing_pack_name}}`. See https://go/pks-visibility" |
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
Oops, something went wrong.