ci(frontend/scripts): print expected quote length (#4499) gforien

This commit is contained in:
Gabriel Forien 2023-08-02 15:47:34 +02:00 committed by GitHub
parent 193a708572
commit 8bebb8c54a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -406,17 +406,16 @@ function validateQuotes() {
}
const incorrectQuoteLength = quoteData.quotes
.filter((quote) => quote.text.length !== quote.length)
.map((quote) => quote.id);
if (incorrectQuoteLength.length !== 0) {
console.log(
`Quote ${quotefilename} ID(s) ${incorrectQuoteLength.join(
","
)} length fields are \u001b[31mincorrect\u001b[0m`
);
console.log("Some length fields are \u001b[31mincorrect\u001b[0m");
incorrectQuoteLength
.map((quote) => { console.log(
`Quote ${quotefilename} ID ${quote.id}: expected length ${quote.text.length}`
)});
quoteFilesAllGood = false;
incorrectQuoteLength.map((id) => {
incorrectQuoteLength.map((quote) => {
quoteLengthErrors.push(
`${quotefilename} ${id} length field is incorrect`
`${quotefilename} ${quote.id} length field is incorrect`
);
});
}