Repository navigation
SEO checks: one file per check, so PRs adding checks stop conflicting - #1222
Merged
Merged
Conversation
Each hard check in check_seo_html.py moves to scripts/seo_checks/<name>.py (docstring plus check(site)), with its tests in scripts/tests/test_seo_<name>.py. The runner loads every module in that folder in name order, so adding a check touches no shared file. Numbers are gone; the summary shows each check's module name and first docstring line. CLI, exit code and report-only output are unchanged. The newsletter third-party check ran twice (as 12 and 19); it now runs once. The runner test that faked a whole site to get exit 0 is replaced by stub checks, and the crumb-links test now runs the check, not the parser. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
👍 All image files/references (if any) are in webp format, in line with our policy. |
Contributor
📝 Spell Check ResultsFound 2 potential spelling issue(s) when checking 70 changed file(s): 📄
|
| Line | Issue |
|---|---|
| 1 | ORE ==> OR |
| 3 | ORE ==> OR |
ℹ️ How to address these issues:
- Fix the typo: If it's a genuine typo, please correct it.
- Add to whitelist: If it's a valid word (e.g., a name, technical term), add it to
.codespell-ignore.txt - False positive: If this is a false positive, please report it in the PR comments.
🤖 This check was performed by codespell
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 43 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
It looked for one hard-coded DOI on one page: a content check, not a template regression. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the checks rebrand-doors added to the old check_seo_html.py into their own modules in scripts/seo_checks/, with their tests, and restore the FLoRA citation check in its DOI-independent form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
👍 All content rules passed (WebP images/references and canonical |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PRs that add an SEO check kept conflicting with each other: each took the next free number and appended to the same four places in
check_seo_html.pyand its test file. #1093 and #1207 both claim check 14 onmain, and here onrebrand-doorsthe newsletter check ran twice, once as "12" (colliding with the resource-subsets check) and once as "19".Now each check is its own module,
scripts/seo_checks/<name>.py: a docstring (its first line is the summary title) and acheck(site)function. Its tests go inscripts/tests/test_seo_<name>.py. The runner loads every module in that folder in name order, so adding a check means adding two files and editing nothing shared. The numbers are gone, so the summary and FAIL headings now show module names in alphabetical order. The command line, exit code and report-only output are unchanged, sodeploy.yaml,rebrand-preview.yamlandrehearse_launch.pyneed no change.The runner refuses to start if the folder is empty or a module lacks a docstring or
check, and a runner test confirms every module file is loaded, so a check can't silently drop out.Audit of checks and tests
rebrand-doors: every check added there since this branch started (old 25–37) is its own module with tests, and the changedcitation_targetsrules (data-cite,data-reference, truncateddata-source) are included. There are now 37 checks.rebrand-doorsnow accepts any DOI next to the dataset citation, so that reason no longer applies.main()returned 0. Stub checks now cover it. The breadcrumb-links test now runs the check, not just the parser.class,hrefordata-cite, a breadcrumb name that is not text, and malformedmainEntitydata no longer abort the run. Results on valid input are the same.homepage_assetscatches the highlight.js stylesheet, whichconditional_assetsdoesn't look at.search_headingcatches the search overlay's<h1>(on every page viabaseof.html) on pages with no heading of their own, wheresingle_h1can't.homepage_share_imagerequires 1200×630 andsummary_large_image, whichshare_image_metadatadoesn't.Verification
python3 -m unittest discover -s scripts/testspasses with CI's dependencies (365 tests, 107 of them SEO tests; 90 before, minus the fake-site test, plus 18), and so does the disciplines parser test.script-tests.yamlruns both on every PR.If a PR adds a check in the old layout
Move its
check_*function intoscripts/seo_checks/<name>.pyascheck(site)with a docstring, and its tests toscripts/tests/test_seo_<name>.py.Created with Claude Opus 5.5 in Claude Code (T3 Code); options reviewed by GPT-6.2 Sol in Codex.