format

fun format(errors: List<ConfigError>, configName: String = "config"): String

Formats the given list of errors into a multi-line diagnostic report.

If errors is empty, returns an empty string immediately. Otherwise, the report begins with a count header, followed by errors grouped by type, and ends with a fallback summary when applicable.

Return

A formatted, potentially ANSI-colored string suitable for terminal output.

Parameters

errors

The list of ConfigError instances to render.

configName

A label for the configuration source, included in the header line. Defaults to "config".