From 742a2a248cfb247f080e005a10ac372ef6579c58 Mon Sep 17 00:00:00 2001 From: Animesh Kumar Date: Wed, 19 Jun 2024 16:29:40 +0530 Subject: [PATCH] chore: add error text coloring for better readability --- scripts/validation/embedded-examples-validation.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/validation/embedded-examples-validation.js b/scripts/validation/embedded-examples-validation.js index 76ba926b..5ea7ae7a 100644 --- a/scripts/validation/embedded-examples-validation.js +++ b/scripts/validation/embedded-examples-validation.js @@ -134,21 +134,20 @@ async function validateParser(document, name) { if (diagnostics.length > 0) { diagnostics.forEach(diagnostic => { if (diagnostic.level === 'error') { - console.error(`Error in ${name}: ${diagnostic.message}`); - // process.exit(1); + console.error(`\x1b[31mError in ${name}: ${diagnostic.message}\x1b[0m`); } else { - console.log(`Warning in ${name}: ${diagnostic.message}`); + console.log(`\x1b[31mWarning in ${name}: ${diagnostic.message}\x1b[0m`); } }); } else { console.log(`${name} is valid.`); } } catch (error) { - console.error(`Validation failed for ${name}: ${error.message}`); - // process.exit(1); + console.error(`\x1b[31mValidation failed for ${name}: ${error.message}\x1b[0m`); } } + // Iterate over the combinedData array, apply updates, and validate each document const baseDocPath = './base-doc.json'; const baseDocSecuritySchemePath = './base-doc-security-scheme-object.json';