Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve logging for checkPagesRender #1285

Merged
merged 1 commit into from
May 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions scripts/commands/checkPagesRender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ zxMain(async () => {
const files = await determineFilePaths(args);

let failures: string[] = [];
let numFilesChecked = 1;
let numFilesChecked = 0;
for (const fp of files) {
numFilesChecked++;
const rendered = await canRender(fp);
if (!rendered) {
console.error(`❌ Failed to render: ${fp}`);
Expand All @@ -93,14 +94,13 @@ zxMain(async () => {
if (numFilesChecked % 10 == 0) {
console.log(`Checked ${numFilesChecked} / ${files.length} pages`);
}
numFilesChecked++;
}

if (failures.length === 0) {
console.info("✅ All pages render without crashing");
console.info(`✅ All ${files.length} pages render without crashing`);
} else {
console.error(
"💔 Some pages crash when rendering. This is usually due to invalid syntax, such as forgetting " +
`💔 ${failures.length} pages crash when rendering. This is usually due to invalid syntax, such as forgetting ` +
"the closing component tag, like `</Admonition>`. You can sometimes get a helpful error message " +
"by previewing the docs locally or in CI. See the README for instructions.\n\n" +
failures.join("\n"),
Expand Down
Loading