Skip to content

Conversation

activus-d
Copy link
Collaborator

@activus-d activus-d commented Jul 15, 2025

This PR solves issue #76 by implementing an automatic spell checking for the documentation using pyspelling instead of sphinxcontrib.spelling.

Changes Introduced

  • Updated the docs/Makefile to include:
    • Automated installation of aspell and pyspelling across common operating systems.
    • make run now builds and serves docs, and runs the spelling check.
  • Created spellingcheck.yaml: Configures pyspelling to check built HTML files, excluding pages like glossary, index, and style guide.
  • Added docs/wordlist.txt, a custom dictionary of valid project-specific terms.
  • Updated pyproject.toml to include pyspelling as a documentation dependency.
  • Add config file for spelling check workflow in CI.
  • Added .gitignore rules to exclude docs/wordlist.dic.
  • Improved contributing/index.rst:
    • Linked to repo on the first mention
    • Reworded instructions for serving and watching docs.

Copy link

codecov bot commented Jul 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.0%. Comparing base (5b05c2f) to head (eb430f1).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #77   +/-   ##
=======================================
  Coverage   100.0%   100.0%           
=======================================
  Files          13       13           
  Lines         748      748           
  Branches       63       63           
=======================================
  Hits          748      748           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@activus-d activus-d requested a review from Stormheg July 15, 2025 07:32
Copy link
Member

@Stormheg Stormheg left a comment

Choose a reason for hiding this comment

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

Hey @activus-d sorry for leaving things open so long 🙏

It looks like this processes the compiled HTML documentation. Did you try to see if it is possible to run it on RST source files? That way the error messages might be more helpful, right now they reference the HTML files instead of the source.

Does the spell check run in GitHub actions (or in the ReadTheDocs build) so we can check we are not introducing new spelling mistakes?

Comment on lines +37 to +82
install-spelling-deps:
@echo "Installing spelling dependencies..."
@echo "Detecting operating system..."
@if command -v apt-get >/dev/null 2>&1; then \
echo "Detected Debian/Ubuntu system"; \
echo "Installing aspell and aspell-en..."; \
sudo apt-get update && sudo apt-get install -y aspell aspell-en; \
elif command -v yum >/dev/null 2>&1; then \
echo "Detected RHEL/CentOS system"; \
echo "Installing aspell and aspell-en..."; \
sudo yum install -y aspell aspell-en; \
elif command -v dnf >/dev/null 2>&1; then \
echo "Detected Fedora system"; \
echo "Installing aspell and aspell-en..."; \
sudo dnf install -y aspell aspell-en; \
elif command -v pacman >/dev/null 2>&1; then \
echo "Detected Arch Linux system"; \
echo "Installing aspell and aspell-en..."; \
sudo pacman -S --noconfirm aspell aspell-en; \
elif [ "$$(uname)" = "Darwin" ]; then \
echo "Detected macOS system"; \
if command -v brew >/dev/null 2>&1; then \
echo "Found Homebrew, installing aspell..."; \
brew install aspell; \
elif command -v port >/dev/null 2>&1; then \
echo "Found MacPorts, installing aspell..."; \
sudo port install aspell aspell-dict-en; \
else \
echo "Neither Homebrew nor MacPorts found."; \
echo "Please install aspell manually:"; \
echo " - Install Homebrew: https://brew.sh"; \
echo " - Then run: brew install aspell"; \
echo " - Or install MacPorts: https://www.macports.org"; \
echo " - Then run: sudo port install aspell aspell-dict-en"; \
exit 1; \
fi \
else \
echo "Could not detect package manager."; \
echo "Please manually install aspell and aspell-en for your system."; \
echo "Common package names: aspell, aspell-en"; \
exit 1; \
fi
@echo "Installing pyspelling via pip..."
@python3 -m pip install pyspelling
@echo "Spelling dependencies installed successfully!"
@echo "You can now run 'make run' to build docs and check spelling."
Copy link
Member

Choose a reason for hiding this comment

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

@activus-d where did you source this list from?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What list are you referring to here, Storm?

Copy link
Member

Choose a reason for hiding this comment

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

'list' -> the list of checks for operating system and package installation commands

Copy link
Collaborator Author

@activus-d activus-d Aug 24, 2025

Choose a reason for hiding this comment

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

Regarding the Pyspelling dependencies, it uses either Aspell or Hunspell. I used Aspell for this project. See the Pyspelling Setup & Overview page for more information.

Regarding the OS commands, I found the information online, but I can’t retrieve the sources because I cleared my browser history. Unfortunately, I’ve only been able to test them on my Mac M2 (Darwin) so far.

@activus-d
Copy link
Collaborator Author

It looks like this processes the compiled HTML documentation. Did you try to see if it is possible to run it on RST source files? That way the error messages might be more helpful, right now they reference the HTML files instead of the source.

Welcome back, Storm. Unfortunately, pyspelling doesn’t support .rst files directly, which is why I configured it to run on the built HTML files.

Does the spell check run in GitHub actions (or in the ReadTheDocs build) so we can check we are not introducing new spelling mistakes?

Yes, we can configure it to run in GitHub actions.

@Stormheg
Copy link
Member

@activus-d alright, we will have to live with those limitations then.

Remaining points from me:

  • Can you make sure the spelling is checked on pull requests?
  • Can we document the spell check command make spellcheck in the contributing instructions? With a way to ignore false positives.

@activus-d
Copy link
Collaborator Author

@activus-d alright, we will have to live with those limitations then.

Remaining points from me:

  • Can you make sure the spelling is checked on pull requests?
  • Can we document the spell check command make spellcheck in the contributing instructions? With a way to ignore false positives.

Of course, my plan has always been to document it after you review the setup and we agree on it.

@activus-d
Copy link
Collaborator Author

Can you make sure the spelling is checked on pull requests?

I might have to create a separate PR for this, since any GitHub Actions config has to be merged into the default branch before it will work.

@Stormheg
Copy link
Member

@activus-d you can commit to main in your own fork and see the actions run there

…name in build-docs.yml; update wordlist.txt dictionary
@activus-d
Copy link
Collaborator Author

@Stormheg I’ve made a new commit to check the spelling of built HTML files in CI.

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

Successfully merging this pull request may close these issues.

2 participants