Skip to content

Fix website spelling check for inline scripts#302

Merged
glenn-jocher merged 1 commit into
mainfrom
fix-website-codespell-html
Apr 27, 2026
Merged

Fix website spelling check for inline scripts#302
glenn-jocher merged 1 commit into
mainfrom
fix-website-codespell-html

Conversation

@glenn-jocher
Copy link
Copy Markdown
Member

@glenn-jocher glenn-jocher commented Apr 27, 2026

Summary

  • run website codespell against a sanitized HTML copy
  • strip script/style payloads from that copy so inline App Router Flight chunks do not create false spelling hits
  • keep downloaded site files unchanged for image and Lychee checks
  • fix shell quoting in the touched spelling block so actionlint passes

Validation

  • actionlint .github/workflows/links.yml
  • YAML parse with Python/PyYAML
  • live handbook smoke test: raw HTML reports hrough and releas; patched scan reports no spelling output
  • synthetic HTML smoke test: visible teh is still reported while script/style-only typos are ignored

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

🧹 This PR improves the docs link-check workflow by making HTML spellchecking smarter, cleaner, and less noisy in CI results.

📊 Key Changes

  • 🔍 Updated the links.yml workflow to run codespell on rendered HTML text only, instead of also checking embedded JavaScript and CSS content.
  • 📁 Added a temporary .codespell-html copy of the built site before spellchecking, so files can be safely preprocessed without touching the original output.
  • ✂️ Stripped <script> and <style> blocks from HTML files before running spelling checks, reducing false positives from code payloads.
  • 🧽 Adjusted output formatting so reported file paths no longer include the temporary .codespell-html directory.
  • 🛠️ Improved shell scripting robustness with safer quoting and a cleaner multi-line write to $GITHUB_ENV.
  • 💬 Kept GitHub summary and Slack notifications, while slightly refining how extra error counts are displayed.

🎯 Purpose & Impact

  • ✅ Reduces false spelling errors caused by inline JS/CSS, making CI feedback more accurate and useful.
  • 🚀 Helps maintainers focus on real documentation typos instead of noise from generated page assets.
  • 📣 Keeps reporting clear in both GitHub Actions summaries and Slack alerts, improving visibility when issues are found.
  • 🔒 Makes the workflow a bit more reliable and maintainable through safer shell handling.
  • 👥 For contributors, this means fewer confusing failures and a smoother docs validation experience.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Apr 27, 2026 10:10am

Request Review

@UltralyticsAssistant UltralyticsAssistant added bug Something isn't working devops GitHub Devops or MLops fixed Bug has been resolved labels Apr 27, 2026
@UltralyticsAssistant
Copy link
Copy Markdown
Member

👋 Hello @glenn-jocher, thank you for submitting a ultralytics/docs 🚀 PR! This is an automated message to help streamline review; an engineer will assist shortly. Please review the checklist below to help ensure a smooth integration. 😊

  • Define a Purpose: Clearly explain the purpose of your fix or feature in your PR description, and link to any relevant issues. Ensure your commit messages are clear, concise, and adhere to the project's conventions.
  • Synchronize with Source: Confirm your PR is synchronized with the ultralytics/docs main branch. If it's behind, update it by clicking the 'Update branch' button or by running git pull and git merge main locally.
  • Ensure CI Checks Pass: Verify all Ultralytics Continuous Integration (CI) checks are passing. If any checks fail, please address the issues.
  • Update Documentation: Update the relevant documentation for any new or modified features.
  • Add Tests: If applicable, include or update tests to cover your changes, and confirm that all tests are passing.
  • Sign the CLA: Please ensure you have signed our Contributor License Agreement if this is your first Ultralytics PR by writing "I have read the CLA Document and I sign the CLA" in a new message.
  • Minimize Changes: Limit your changes to the minimum necessary for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." — Bruce Lee

For more guidance, please refer to our Contributing Guide. Don't hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀

Copy link
Copy Markdown
Member

@UltralyticsAssistant UltralyticsAssistant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 PR Review

Made with ❤️ by Ultralytics Actions

The workflow change looks clean and targeted. Copying the rendered site into a temporary workspace before stripping inline <script>/<style> blocks is a reasonable way to reduce codespell noise, and the quoting/grouped env writes improve shell safety without changing behavior. I didn't find any clear bugs or maintainability issues in the diff.

@glenn-jocher glenn-jocher merged commit df70d02 into main Apr 27, 2026
7 checks passed
@glenn-jocher glenn-jocher deleted the fix-website-codespell-html branch April 27, 2026 12:04
@UltralyticsAssistant
Copy link
Copy Markdown
Member

Merged! 🎉 Thanks, @glenn-jocher, for sharpening the docs link-check workflow and making CI feedback cleaner, quieter, and more useful for everyone.

“Simplicity is the ultimate sophistication.” — Leonardo da Vinci

This update reflects that perfectly: by stripping out JS/CSS noise and focusing spellcheck on rendered HTML text, the workflow now highlights real documentation issues instead of distracting false positives. That means a smoother experience for contributors and more reliable signals for maintainers.

Really valuable improvement to the docs pipeline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working devops GitHub Devops or MLops fixed Bug has been resolved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants