lib/packwerk/reference_checking/checkers/dependency_checker.rb in packwerk-2.2.0 vs lib/packwerk/reference_checking/checkers/dependency_checker.rb in packwerk-2.2.1

- old
+ new

@@ -21,10 +21,26 @@ end def invalid_reference?(reference) return false unless reference.source_package return false unless reference.source_package.enforce_dependencies? return false if reference.source_package.dependency?(reference.constant.package) + true + end + + sig do + override + .params(reference: Packwerk::Reference) + .returns(String) + end + def message(reference) + <<~EOS + Dependency violation: #{reference.constant.name} belongs to '#{reference.constant.package}', but '#{reference.source_package}' does not specify a dependency on '#{reference.constant.package}'. + Are we missing an abstraction? + Is the code making the reference, and the referenced constant, in the right packages? + + #{standard_help_message(reference)} + EOS end end end end end