Repository navigation
chore: every comment is two lines at most, checked against its code, and CI holds the rule (#288) - #292
Conversation
…and CI holds the rule (#288) 1,091 comments ran past two lines, 5,400 lines in all. Each was read against the code beside it, made true where it was not, and cut to the reason. No code changes: every changed source file differs from before only in whole-line comments, and the JSDoc tags and their types are the same. scripts/comments.mjs (pnpm comments) lists any comment past the limit, CI's checks job runs it, and design/build.md has the rule. Three generators write shorter comments into the files they make, and the runtime's NOTICE.md takes over the list of where the content check departs from H5P's, which its source comment held.
…egexp' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
There was a problem hiding this comment.
All reported issues were addressed
Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
View guided diff | Turn on auto-fix | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 273 files
Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
Requires human review: Auto-approval blocked because this review re-detected 22 unresolved issues already reported by Cubic.
View guided diff | Turn on auto-fix | Re-trigger cubic
…ped, a few comments made true, the checker's gaps)
There was a problem hiding this comment.
All reported issues were addressed across 79 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…t the first 100, a /* after // in the checker)
There was a problem hiding this comment.
All reported issues were addressed across 23 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Closes #288.
Every comment in the code is now two lines at most, and each long one was read against the code beside it first. 273 files, 5,762 lines out and 2,432 in. No code changes.
The rule
A comment is two lines at most and says why (
design/build.md, Comments).@ts-expect-error,v8 ignore)..d.tsfiles.scripts/comments.mjs(pnpm comments) lists any comment past the limit, and CI'schecksjob runs it.How it was checked
main, comments removed: 262 of 262 differ only in whole-line comments, and their JSDoc tags (tag, type, name) are the same in the same order.pnpm buildandpnpm typecheckpass.pnpm test:unitpasses: player 400, author 297, runtime 180, cmi5 50, normalize 35.sync:assets, the libraries'parts.mjs) write the same files as the ones committed.Comments that were false, now true
app.js,player-page.js,build-libraries.mjs).package-reader.ts: the reader does walk dependencies; text entries are inline before size is looked at.jobs-worker.ts: extraction uses the native codec, not zip.js.constants.ts: text entries are inline at any size, not only under 16 MB.source.ts:Last-Modifiedreads cross-origin withoutAccess-Control-Expose-Headers; onlyETagneeds it.h5p-offline-player.ts:runtimechecks three files, not four.content-types.yml: the sweep fails on a type that does not reachready, not on a missingfinished.client.ts: the learner preferences are read and passed on.scorm-browser.mjs: it builds 1.2 or 2004, not only 1.2.scorm-core.mjs: the runtime file list does hold the fonts' licence files.Things to know
design/.packages/runtime/NOTICE.mdnow holds the list of where the content check departs from H5P's validator. The source comment held it, and the notice pointed there.sync-h5p-assets.mjs, the libraries'parts.mjs, the runtime'sbuild.mjs). The templates and the files they write changed together.scorm.jsandresizer.js, are shorter. They are comments in files that ship; nothing that runs changed.docs/api.mdhas the full text.Summary by cubic
All comments are now at most two lines, each read against the code beside it first and corrected where it was false. 1,091 comments changed across 273 files; JSDoc tags and types stay identical, and the only code change is a CodeQL fix to the HTML filtering regexp.
The rule
design/build.md; licence notices and tool-read lines stay whole and types keep their tags, since the plain-JS packages take their types from them.scripts/comments.mjs(pnpm comments) lists any comment past the limit, and CI'schecksjob runs it.packages/runtime/NOTICE.mdnow holds the list of where the content check departs from H5P's validator, which the source comment used to.Comments corrected
/*after//among them; the last pass states what makes the faststart plan throw.Written for commit 8f32713. Summary will update on new commits.