class Steep::Expectations

def to_yaml

def to_yaml
  array = [] #: Array[{ "file" => String, "diagnostics" => Array[untyped] }]
  diagnostics.each_key.sort.each do |key|
    ds = diagnostics[key]
    array << {
      "file" => key.to_s,
      'diagnostics' => ds.sort_by(&:sort_key).map(&:to_hash)
    }
  end
  YAML.dump(array)
end