-
Notifications
You must be signed in to change notification settings - Fork 187
British-english spell checking of markdown and notebooks #2837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
8dcbf9a
106e7cd
82edccb
1a36a9a
01ae993
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -332,6 +332,29 @@ jobs: | |||||
| with: | ||||||
| name: Mypy report | ||||||
| path: mypy-report | ||||||
| spell-check-tutorial-prose: | ||||||
| name: "Documentation: pixi run docs-spelling" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| runs-on: ubuntu-latest | ||||||
| needs: [cache-pixi-lock] | ||||||
| permissions: | ||||||
| contents: read | ||||||
| steps: | ||||||
| - name: Checkout | ||||||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||||||
| with: | ||||||
| persist-credentials: false | ||||||
| - name: Restore cached pixi lockfile | ||||||
| uses: Parcels-code/pixi-lock/restore@38495788b79a5ff26009aecc15daa9a8310b8832 # v0.1.0 | ||||||
| with: | ||||||
| cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }} | ||||||
| - uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.6 | ||||||
| with: | ||||||
| pixi-version: ${{ needs.cache-pixi-lock.outputs.pixi-version }} | ||||||
| locked: false # TODO: Remove once v7 of the lock file is removed, or once we stop having external source dependencies https://github.com/Parcels-code/parcels/pull/2550#issuecomment-4088660238 | ||||||
| cache: true | ||||||
| cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} | ||||||
| - name: Check tutorial prose | ||||||
| run: pixi run docs-spelling | ||||||
| build-and-upload-nightly-parcels: # for alpha testing | ||||||
| needs: [cache-pixi-lock] | ||||||
| permissions: | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,3 +59,9 @@ repos: | |
| "--option", | ||
| "align_comments=false", | ||
| ] | ||
| - repo: https://github.com/vale-cli/vale | ||
| rev: v3.17.1 | ||
| hooks: | ||
| - id: vale | ||
| name: Vale British-English tutorial prose | ||
| files: ^docs/user_guide/(examples|getting_started)/tutorial.*\.md$ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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). |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| StylesPath = .vale/styles | ||
| MinAlertLevel = error | ||
|
|
||
| [*] | ||
| BasedOnStyles = Parcels |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| extends: substitution | ||
| message: "Use British English: '%s' -> '%s'." | ||
| level: error | ||
| scope: text | ||
| ignorecase: true | ||
| swap: | ||
| analyze: analyse | ||
| analyzed: analysed | ||
| analyzing: analysing | ||
| behavior: behaviour | ||
| behaviors: behaviours | ||
| behavioral: behavioural | ||
| center: centre | ||
| centers: centres | ||
| centered: centred | ||
| centering: centring | ||
| color: colour | ||
| colors: colours | ||
| colored: coloured | ||
| coloring: colouring | ||
| customize: customise | ||
| customized: customised | ||
| customizing: customising | ||
| customization: customisation | ||
| labeled: labelled | ||
| labeling: labelling | ||
| modeler: modeller | ||
| modelers: modellers | ||
| modeling: modelling | ||
| normalize: normalise | ||
| normalized: normalised | ||
| normalizing: normalising | ||
| normalization: normalisation | ||
| optimize: optimise | ||
| optimized: optimised | ||
| optimizing: optimising | ||
| optimization: optimisation | ||
| organization: organisation | ||
| organizations: organisations |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -41,4 +41,6 @@ a table showing the latest notebook execution: | |||||
| 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 | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Remove "in tutorial prose"? (from what we discussed this was intended to be a codebase-wide policy) |
||||||
| notebooks; preserve the spelling required by code, APIs, and quoted external text. | ||||||
| - We recommend hard wrapping prose in markdown so that reading it becomes easier in any editor. | ||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -130,6 +130,7 @@ sphinx-autobuild = "*" | |||||||
| sphinxcontrib-mermaid = "*" | ||||||||
| sphinx-design = "*" | ||||||||
| sphinx-autoapi = "*" | ||||||||
| vale = "*" | ||||||||
|
|
||||||||
| [feature.docs.tasks] | ||||||||
| docs-only-clean = { cmd = "make clean", cwd = "docs", description = "Cleans the documentation folder of build artifacts." } | ||||||||
|
|
@@ -142,6 +143,7 @@ docs-watch = { cmd = "make livehtml", cwd = "docs", description = "Build and aut | |||||||
| "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." } | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
|
||||||||
| [feature.pre-commit.dependencies] | ||||||||
| pre_commit = "*" | ||||||||
|
|
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.