From e1eb03f05601b13e9652b71f840a67da8fbcc5db Mon Sep 17 00:00:00 2001 From: Calinator444 Date: Mon, 4 Nov 2024 16:46:35 +1100 Subject: [PATCH] made error message clearer --- scripts/frontmatter-validator/frontmatter-validator.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/frontmatter-validator/frontmatter-validator.js b/scripts/frontmatter-validator/frontmatter-validator.js index 3184e37476..0dd0fea10d 100644 --- a/scripts/frontmatter-validator/frontmatter-validator.js +++ b/scripts/frontmatter-validator/frontmatter-validator.js @@ -63,7 +63,9 @@ function getMissingSpaceErrors(frontmatterContents, schema) { const regex = new RegExp(`[\\s^](${field}:)\\S`); const match = frontmatterContents.match(regex); if (frontmatterContents.match(regex)) { - errors.push(`space missing for field: '${match[1]}'`); + errors.push( + `A space is missing after the ':' in the field '${field}'. Please add a space between the ':' and the ${field} value` + ); } } return errors; @@ -168,7 +170,7 @@ function main() { console.log( `## Rule: [${filePath}](https://github.com/SSWConsulting/SSW.Rules.Content/tree/main/${filePath})\n` ); - console.log('Issues:'); + console.log('Issues Detected:'); fileErrors.forEach((issue) => console.log(`- **${issue}**`)); console.log('\n'); console.log('\n');