Skip to content

Commit 7196e13

Browse files
Add proposal count to validation report
1 parent cfc5b90 commit 7196e13

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Sources/EvolutionMetadataExtraction/Utilities/ModelExtensions.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,20 @@ extension EvolutionMetadata {
2929

3030
var validationReport: String {
3131
let dateString: String = creationDate.replacingOccurrences(of: "T", with: " ")
32+
func proposalString(_ count: Int) -> String { "\(count) Proposal\(count == 1 ? "" : "s")" }
33+
3234
var report = """
3335
Swift Evolution Validation Report
3436
\(dateString)
37+
\(proposalString(proposals.count)) Validated
3538
----------\n\n
3639
"""
3740
let errorProposals = proposals.filter { $0.hasIssues }
3841

3942
if errorProposals.isEmpty {
4043
report += "NO ISSUES FOUND\n\n"
4144
} else {
42-
report += "ISSUES FOUND\n\n"
45+
report += "ISSUES FOUND IN \(proposalString(errorProposals.count).uppercased())\n\n"
4346
report = errorProposals.reduce(into: report) { $0 += $1.validationReport + "\n" }
4447
}
4548

0 commit comments

Comments
 (0)