Method: Packwerk::ReferenceChecking::Checkers::DependencyChecker#message

Defined in:
lib/packwerk/reference_checking/checkers/dependency_checker.rb

#message(reference) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/packwerk/reference_checking/checkers/dependency_checker.rb', line 36

def message(reference)
  const_name = reference.constant.name
  const_package = reference.constant.package
  ref_package = reference.package

  <<~EOS
    Dependency violation: #{const_name} belongs to '#{const_package}', but '#{ref_package}' does not specify a dependency on '#{const_package}'.
    Are the constant and its references in the right packages?

    #{standard_help_message(reference)}
  EOS
end