class ArchSpec::Rules::AllowDependenciesRule
Backs ArchSpec::DSL::ComponentProxy#can_only_use. Flags references from the source to any component outside its allowlist.
Public Instance Methods
Source
# File lib/archspec/rules/dependency_rules.rb, line 43 def evaluate(graph) relevant_edges(graph).flat_map do |edge| graph.target_components_for(edge).filter_map do |target| next if target == source || targets.include?(target) Diagnostic.new( rule: id, message: "#{source} may not depend on #{target}", location: edge.location, evidence: "#{graph.edge_source_name(edge)} #{edge.verb} #{edge.to}" ) end end end