()
| 43 | } |
| 44 | |
| 45 | formatErrors() { |
| 46 | let separator = "\n\n"; |
| 47 | if (process.stdout.isTTY) { |
| 48 | // Add a horizontal separator line between errors in case a terminal is used |
| 49 | separator += chalk.grey.dim("\u2500".repeat(process.stdout.columns || 80)); |
| 50 | } |
| 51 | separator += "\n\n"; |
| 52 | let message; |
| 53 | |
| 54 | if (this.project) { // ui5-workspace.yaml is project independent, so in that case, no project is available |
| 55 | message = chalk.red(`Invalid ui5.yaml configuration for project ${this.project.id}`) + "\n\n"; |
| 56 | } else { |
| 57 | message = chalk.red(`Invalid workspace configuration.`) + "\n\n"; |
| 58 | } |
| 59 | |
| 60 | message += this.errors.map((error) => { |
| 61 | return this.formatError(error); |
| 62 | }).join(separator); |
| 63 | return message; |
| 64 | } |
| 65 | |
| 66 | formatError(error) { |
| 67 | let errorMessage = ValidationError.formatMessage(error); |
no test coverage detected