Skip to content

British-english spell checking of markdown and notebooks - #2837

Open
erikvansebille wants to merge 5 commits into
Parcels-code:mainfrom
erikvansebille:british-english-documentation
Open

British-english spell checking of markdown and notebooks#2837
erikvansebille wants to merge 5 commits into
Parcels-code:mainfrom
erikvansebille:british-english-documentation

Conversation

@erikvansebille

Copy link
Copy Markdown
Member

Description

This PR uses vale.sh to implement British-English spelling rules for only the markdown files and markdown notebooks cells - and checks these in pre-commit using the new pixi run docs-spelling.

So far, it seems 'light; in the sense that it only targets markdown and not code. Is this what we want, @VeckoTheGecko?

Checklist

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.
    • Describe how you used it (e.g., by pasting your prompt): I asked CoPilot: "How do I best enforce that all tutorials in docs/user_guide use british english spelling?"

@VeckoTheGecko VeckoTheGecko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One of the difficulties with this is that it only checks part of the codebase (i.e., prose).

Not code variable/parameter names, not docstrings, and not comments.

To what degree we want spellchecking is worth considering. Perhaps CSpell would be a better option.

Happy to merge if you think its helpful (the tooling is orthogonal anyway). Merging the corrections themselves is already good.

Comment thread .github/workflows/ci.yml
with:
name: Mypy report
path: mypy-report
spell-check-tutorial-prose:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
spell-check-tutorial-prose:
qaqc:

Comment thread .github/workflows/ci.yml
name: Mypy report
path: mypy-report
spell-check-tutorial-prose:
name: "Documentation: pixi run docs-spelling"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
name: "Documentation: pixi run docs-spelling"
name: "Additional QAQC (separate to pre-commit - pixi run more-qaqc)"

Comment thread pixi.toml
"docs-only-clean",
] }
docs-linkcheck = { cmd = "make linkcheck", cwd = "docs", description = "Verify all links in documentation don't 404." }
docs-spelling = { cmd = "python tools/lint_british_english.py docs/user_guide/examples/tutorial*.ipynb docs/user_guide/examples/tutorial*.md docs/user_guide/getting_started/tutorial*.ipynb docs/user_guide/getting_started/tutorial*.md", description = "Check tutorial prose uses British English." }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
docs-spelling = { cmd = "python tools/lint_british_english.py docs/user_guide/examples/tutorial*.ipynb docs/user_guide/examples/tutorial*.md docs/user_guide/getting_started/tutorial*.ipynb docs/user_guide/getting_started/tutorial*.md", description = "Check tutorial prose uses British English." }
docs-spelling = { cmd = "python tools/lint_british_english.py docs/user_guide/examples/tutorial*.ipynb docs/user_guide/examples/tutorial*.md docs/user_guide/getting_started/tutorial*.ipynb docs/user_guide/getting_started/tutorial*.md", description = "Check tutorial prose uses British English." }
more-qaqc = { depends-on = ["docs-spelling"], description = "Additional QAQC tooling separate to pre-commit hooks" }

Comment thread .pre-commit-config.yaml
hooks:
- id: vale
name: Vale British-English tutorial prose
files: ^docs/user_guide/(examples|getting_started)/tutorial.*\.md$

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I suggest we remove this in favour of using the GitHub action (avoiding doubling up on the file selection).

by any developer or user, so the documentation teaches all of us how to do something with Parcels. Sometimes it can be
more natural to take on the tone of a teacher, writing to a student/learner, in which case it is okay to use "you".
Please refrain from using impersonal subjects such as "the user".
- **Use British English in tutorial prose.** The Vale check covers Markdown files and Markdown cells in tutorial

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
- **Use British English in tutorial prose.** The Vale check covers Markdown files and Markdown cells in tutorial
- Use British English. This is validated by a spellchecker that is run in CI.

Remove "in tutorial prose"? (from what we discussed this was intended to be a codebase-wide policy)

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

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Decide on English spelling rules (and add to docsguide)?

2 participants