Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Graphviz support and ASCII rendering #4

Merged
merged 1 commit into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 1 addition & 29 deletions Sources/SelectiveTestingCore/DependencyGraph+DOT.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,7 @@ import Foundation
import Workspace
import PathKit

extension DependencyGraph {
func dot() -> String {
var dot = """
graph {
rankdir=TB
"""
let grouped = groupByPath()

grouped.keys.forEach { path in
let targets = grouped[path]!
dot = dot + "\n{rank=same; \(targets.map(\.description).joined(separator: ";"))}"
targets.forEach { target in

let dependencies = dependencies(for: target)

dependencies.forEach { dep in
dot = dot + "\n\(target.description) -> \(dep.description)"
}
}
}
dot = dot + "\n}"
return dot
}

extension DependencyGraph {
func mermaid(highlightTargets: Set<TargetIdentity>) -> String {
var result = "graph TD\n"
allTargets().forEach { target in
Expand Down Expand Up @@ -70,9 +47,4 @@ graph {

return result
}
#if os(macOS)
public func renderToASCII() async throws -> String {
return try await draw(dot: dot())
}
#endif
}
26 changes: 0 additions & 26 deletions Sources/SelectiveTestingCore/DotDraw.swift

This file was deleted.