leogdion / PackageListValidator

A tool for validating the SwiftPM Library/Swift Package Index master package list.
MIT License
1 stars 0 forks source link

Better error reporting #14

Open daveverwer opened 4 years ago

daveverwer commented 4 years ago

When errors are found and reported the output is all on one line. For example:

Error: ReportError(errors: [https://github.com/mkj-is/Elementary.git: PackageListValidator.PackageError.badDump(Optional("/private/var/folders/dj/rw9k81013t3dymztbf5_f7s80000gn/T/F328B2CE-DD0B-4D79-9DB6-D2968008DD4D: error: package at \'/private/var/folders/dj/rw9k81013t3dymztbf5_f7s80000gn/T/F328B2CE-DD0B-4D79-9DB6-D2968008DD4D\' is using Swift tools version 3.1.0 which is no longer supported; consider using \'// swift-tools-version:5.2\' to specify the current tools version\n")), https://github.com/swiftgen/swiftgen.git: PackageListValidator.PackageError.badDump(Optional("/private/var/folders/dj/rw9k81013t3dymztbf5_f7s80000gn/T/5FBE72C1-A47B-4B7E-91CE-330EB742E3AD: error: package at \'/private/var/folders/dj/rw9k81013t3dymztbf5_f7s80000gn/T/5FBE72C1-A47B-4B7E-91CE-330EB742E3AD\' is using Swift tools version 3.1.0 which is no longer supported; consider using \'// swift-tools-version:5.2\' to specify the current tools version\n")), https://github.com/twostraws/markdown.git: PackageListValidator.PackageError.badDump(Optional("/private/var/folders/dj/rw9k81013t3dymztbf5_f7s80000gn/T/0290CF93-0457-4219-ACC5-C55C7EF6AE86: error: etc... etc... etc...

It would be great if this could be formatted like this:

https://github.com/mkj-is/Elementary.git: PackageListValidator.PackageError.badDump(Optional("/private/var/folders/dj/rw9k81013t3dymztbf5_f7s80000gn/T/F328B2CE-DD0B-4D79-9DB6-D2968008DD4D: error: package at \'/private/var/folders/dj/rw9k81013t3dymztbf5_f7s80000gn/T/F328B2CE-DD0B-4D79-9DB6-D2968008DD4D\' is using Swift tools version 3.1.0 which is no longer supported; consider using \'// swift-tools-version:5.2\' to specify the current tools version\n"))
https://github.com/swiftgen/swiftgen.git: PackageListValidator.PackageError.badDump(Optional("/private/var/folders/dj/rw9k81013t3dymztbf5_f7s80000gn/T/5FBE72C1-A47B-4B7E-91CE-330EB742E3AD: error: package at \'/private/var/folders/dj/rw9k81013t3dymztbf5_f7s80000gn/T/5FBE72C1-A47B-4B7E-91CE-330EB742E3AD\' is using Swift tools version 3.1.0 which is no longer supported; consider using \'// swift-tools-version:5.2\' to specify the current tools version\n"))
https://github.com/twostraws/markdown.git: PackageListValidator.PackageError.badDump(Optional("/private/var/folders/dj/rw9k81013t3dymztbf5_f7s80000gn/T/0290CF93-0457-4219-ACC5-C55C7EF6AE86: error: package at \'/private/var/folders/dj/rw9k81013t3dymztbf5_f7s80000gn/T/0290CF93-0457-4219-ACC5-C55C7EF6AE86\' is using Swift tools version 3.1.0 which is no longer supported; consider using \'// swift-tools-version:5.2\' to specify the current tools version\n"))
https://github.com/twostraws/swiftslug.git: PackageListValidator.PackageError.badDump(Optional("/private/var/folders/dj/rw9k81013t3dymztbf5_f7s80000gn/T/939EA573-7103-4505-8FD3-37FAB6EC4C5C: error: package at \'/private/var/folders/dj/rw9k81013t3dymztbf5_f7s80000gn/T/939EA573-7103-4505-8FD3-37FAB6EC4C5C\' is using Swift tools version 3.1.0 which is no longer supported; consider using \'// swift-tools-version:5.2\' to specify the current tools version\n"))
https://github.com/finestructure/Arena.git: PackageListValidator.PackageError.badDump(Optional("/private/var/folders/dj/rw9k81013t3dymztbf5_f7s80000gn/T/CA0D7862-C882-448A-9E0D-044D12195C48: error: package at \'/private/var/folders/dj/rw9k81013t3dymztbf5_f7s80000gn/T/CA0D7862-C882-448A-9E0D-044D12195C48\' is using Swift tools version 3.1.0 which is no longer supported; consider using \'// swift-tools-version:5.2\' to specify the current tools version\n"))

I've not changed the output of the errors at all, just put a newline between the elements of the array.