Skip to content

Commit 3c6b354

Browse files
authored
Merge pull request #423 from derekprior/dp-dependency-violation-messages
Clarify dependency violation message
2 parents ab53e75 + bedddc2 commit 3c6b354

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

TROUBLESHOOT.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ See: [USAGE.md - Enforcing dependency boundary](USAGE.md#Enforcing-dependency-bo
2828

2929
> /Users/JaneDoe/src/github.com/sample-project/billing/app/jobs/document_processing_job.rb:48:6
3030
> Dependency violation: ::Edi::Source belongs to 'edi', but 'billing' does not specify a dependency on 'edi'.
31-
> Are we missing an abstraction?
32-
> Is the code making the reference, and the referenced constant, in the right packages?
31+
> Are the constant and its references in the right packages?
3332
>
3433
> Inference details: 'Edi::Source' refers to ::Edi::Source which seems to be defined in edi/app/models/edi/source.rb.
3534

lib/packwerk/reference_checking/checkers/dependency_checker.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ def message(reference)
4040

4141
<<~EOS
4242
Dependency violation: #{const_name} belongs to '#{const_package}', but '#{ref_package}' does not specify a dependency on '#{const_package}'.
43-
Are we missing an abstraction?
44-
Is the code making the reference, and the referenced constant, in the right packages?
43+
Are the constant and its references in the right packages?
4544
4645
#{standard_help_message(reference)}
4746
EOS

test/unit/packwerk/reference_offense_test.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ class ReferenceOffenseTest < Minitest::Test
2929

3030
expected = <<~EXPECTED
3131
Dependency violation: ::SomeName belongs to 'destination_package', but 'components/source' does not specify a dependency on 'destination_package'.
32-
Are we missing an abstraction?
33-
Is the code making the reference, and the referenced constant, in the right packages?
32+
Are the constant and its references in the right packages?
3433
3534
Inference details: this is a reference to ::SomeName which seems to be defined in some/location.rb.
3635
To receive help interpreting or resolving this error message, see: https://github.com/Shopify/packwerk/blob/main/TROUBLESHOOT.md#Troubleshooting-violations

0 commit comments

Comments
 (0)