Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,27 @@ extension EvolutionMetadata {
var hasErrors: Bool { proposals.contains { $0.hasErrors } }

var validationReport: String {
let dateString: String = creationDate.replacingOccurrences(of: "T", with: " ")
var report = """
Swift Evolution Validation Report
Generated: \(creationDate)
Tool Version: \(toolVersion)\n\n
\(dateString)
----------\n\n
"""
let errorProposals = proposals.filter { $0.hasIssues }

if errorProposals.isEmpty {
report += "NO ISSUES FOUND\n"
report += "NO ISSUES FOUND\n\n"
} else {
report += "ISSUES FOUND\n\n"
report = errorProposals.reduce(into: report) { $0 += $1.validationReport + "\n" }
}

report += """
----------
Validation performed by swift-evolution-metadata-extractor
https://github.com/swiftlang/swift-evolution-metadata-extractor
(v\(toolVersion))\n
"""
return report
}
}
Expand Down Expand Up @@ -80,6 +88,9 @@ extension Proposal {
var report = "\t\(heading)\n"
for issue in issues {
report += "\t\(issue.message)\n"
if !issue.suggestion.isEmpty {
report += "\n\t\(issue.suggestion.replacingOccurrences(of: "\n", with: "\n\t"))\n"
}
}
return report
}
Expand Down
Loading