Skip to content

Commit

Permalink
made error message clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
Calinator444 committed Nov 4, 2024
1 parent 8f6948c commit e1eb03f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/frontmatter-validator/frontmatter-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit e1eb03f

Please sign in to comment.