Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
887e0e0
Add Vale for content linting to the repo
paddyroddy Jun 2, 2025
2a2348c
Move comment to bottom
paddyroddy Jun 2, 2025
b091a30
Update .github/styles/custom/endash.yml
paddyroddy Jun 2, 2025
a0e8d26
Update .vale.ini
paddyroddy Jun 2, 2025
ca5a045
Update .vale.ini
paddyroddy Jun 2, 2025
e32d217
Update .vale.ini
paddyroddy Jun 3, 2025
5293621
Change rules
paddyroddy Jun 3, 2025
77fd9a0
Update british-spellings.yml
paddyroddy Jun 3, 2025
915a6e8
Add gitignore
paddyroddy Jun 3, 2025
d83fe9b
Fix Vale sync issue
paddyroddy Jun 3, 2025
703f01e
Delete .github/styles/custom/british-spellings.yml
paddyroddy Jun 3, 2025
e1d5b39
Remove custom files
paddyroddy Jun 5, 2025
31dd235
Update gitignore
paddyroddy Jun 5, 2025
6fead66
Expand vale.ini
paddyroddy Jun 5, 2025
815e295
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 5, 2025
2076cd7
Revert changes
paddyroddy Jun 5, 2025
fa2ec11
Disable licence files
paddyroddy Jun 5, 2025
36ddf8c
Merge branch 'main' into vale
paddyroddy Jun 5, 2025
8539fe0
Remove RedHat
paddyroddy Jun 5, 2025
db62870
Remove RedHat properly
paddyroddy Jun 5, 2025
1f0983c
Try REVIEWDOG_GITHUB_API_TOKEN var
paddyroddy Jun 5, 2025
3d1617e
Revert "Try REVIEWDOG_GITHUB_API_TOKEN var"
paddyroddy Jun 5, 2025
a2af066
Change to `github-check`
paddyroddy Jun 5, 2025
f5201d8
Turn off error
paddyroddy Jun 5, 2025
7b25e03
Try github-pr-review again
paddyroddy Jun 5, 2025
808b1e7
Revert "Try github-pr-review again"
paddyroddy Jun 5, 2025
bf1841f
Remove quarto references
paddyroddy Jun 6, 2025
f8aad48
Genuine bug: "the the"
samcunliffe Jun 6, 2025
a20c799
Turn off rules for `> NOTE`
paddyroddy Jun 6, 2025
73fd5c1
Exclude all GitHub magic callouts
paddyroddy Jun 6, 2025
3adfd7b
Improve comment
paddyroddy Jun 6, 2025
f53e939
Exclude CODE_OF_CONDUCT
paddyroddy Jun 6, 2025
3748887
Use @matt-graham's regex
paddyroddy Jun 6, 2025
245674e
Revert markdown change
paddyroddy Jun 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ body:
attributes:
label: Is Your Feature Request Related to a Problem? Please Describe
description: A clear and concise description of what the problem is.
placeholder: I'm always frustrated when [...]
placeholder: I'm always frustrated when []
Comment thread
paddyroddy marked this conversation as resolved.
Outdated
validations:
required: true
- id: solution
Expand Down
4 changes: 4 additions & 0 deletions .github/styles/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# only track the custom Vale rules
/*
!.gitignore
!custom/
151 changes: 151 additions & 0 deletions .github/styles/custom/british-spellings.yml
Comment thread
paddyroddy marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
---
extends: substitution
message: Use the British spelling '%s' instead of the US '%s'.
level: error
ignorecase: true
swap:
# -our vs. -or
ardor: ardour
candor: candour
color: colour
demeanor: demeanour
endeavor: endeavour
favour: favour
fervor: fervour
flavor: flavour
harbor: harbour
honor: honour
humor: humour
labor: labour
neighbor: neighbour
odor: odour
pavor: pavour
rancor: rancour
rigor: rigour
rumor: rumour
savor: savour
splendor: splendour
succor: succour
valour: valour
vapor: vapour
vigor: vigour
# and their derivatives
colored: coloured
coloring: colouring
colors: colours
endeavored: endeavoured
endeavoring: endeavouring
flavored: flavoured
flavoring: flavouring
honored: honoured
honoring: honouring
honors: honours
humors: humours
labored: laboured
laboring: labouring
labors: labours
neighbors: neighbours
rumors: rumours
splendors: splendours
# -re vs. -er
caliber: calibre
center: centre
fiber: fibre
luster: lustre
meager: meagre
meter: metre
saber: sabre
saltpeter: saltpetre
sepulcher: sepulchre
theater: theatre
# and their derivatives
calibers: calibres
centers: centres
fibers: fibres
lusters: lustres
meters: metres
theaters: theatres
# -ise vs. -ize
'(\w+)ization\b': "$1isation"
'(\w+)ize\b': "$1ise"
'(\w+)ized\b': "$1ised"
'(\w+)izing\b': "$1ising"
Comment thread
paddyroddy marked this conversation as resolved.
Outdated
# add other common forms:
'(\w+)izable\b': "$1isable"
Comment thread
paddyroddy marked this conversation as resolved.
Outdated
# -yse vs. -yze
'(\w+)yze\b': "$1yse"
'(\w+)yzed\b': "$1ysed"
'(\w+)yzing\b': "$1ysing"
# double L vs. Single L
distill: distil
enroll: enrol
enrollment: enrolment
enthrall: enthral
fulfill: fulfil
initialed: initialled
initialing: initialling
instill: instil
labeled: labelled
labeling: labelling
libelous: libellous
modeling: modelling
signaling: signalling
traveler: traveller
traveling: travelling
traveled: travelled
# -ogue vs. -og
analog: analogue
catalog: catalogue
demagog: demagogue
dialog: dialogue
monolog: monologue
pedagog: pedagogue
prolog: prologue
# ae/oe vs. e
airplane: aeroplane
anemia: anaemia
anesthesia: anaesthesia
encyclopedia: encyclopaedia
eon: aeon
fetus: foetus
pediatric: paediatric
# -ce vs. -se
defense: defence
license: licence
offense: offence
pretense: pretence
# miscellaneous specific words
aging: ageing
aluminum: aluminium
authorizer: authoriser
buses: busses
cipher: cypher
cozy: cosy
dependent: dependant
draft: draught
furor: furore
gray: grey
inquiry: enquiry
jail: gaol
jewelry: jewellery
likable: likeable
livable: liveable
maneuver: manoeuvre
marvelous: marvellous
matte: matt
mustache: moustache
pajamas: pyjamas
plow: plough
programme: program
ratable: rateable
reconnoiter: reconnoitre
sizable: sizeable
skillful: skilful
smolder: smoulder
somber: sombre
specialty: speciality
specter: spectre
sulfur: sulphur
unshakable: unshakeable
willful: wilful
yogurt: yoghurt
11 changes: 11 additions & 0 deletions .github/styles/custom/dashes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
extends: existence
message: Don't put a space before or after a dash.
nonword: true
level: warning
action:
name: edit
params:
- remove
- " "
tokens:
- '\s[—–]\s'
14 changes: 14 additions & 0 deletions .github/styles/custom/endash.yml
Comment thread
paddyroddy marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
extends: existence
message: >-
Avoid en dashes ('–'). For hyphenated words, use a hyphen ('-').\nFor
parenthesis, use an em dash ('—').
nonword: true
level: error
action:
name: edit
params:
- replace
- "-"
- "—"
tokens:
- "–"
41 changes: 41 additions & 0 deletions .github/styles/custom/no-contractions.yml
Comment thread
paddyroddy marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
extends: substitution
message: Use '%s' instead of '%s.'
level: error
ignorecase: true
swap:
aren't: are not,
can't: cannot,
couldn't: could not,
didn't: did not,
doesn't: does not,
don't: do not,
hasn't: has not,
haven't: have not,
how'll: how will,
how's: how is,
isn't: is not,
it'll: it will,
it's: it is,
shouldn't: should not
that'll: that will,
that's: that is,
they'll: they will,
they're: they are,
wasn't: was not,
we'll: we will,
we're: we are,
we've: we have,
weren't: were not,
what'll: what will,
what's: what is,
when'll: when will,
when's: when is,
where'll: where will,
where's: where is,
who'll: who will,
who's: who is,
why'll: why will,
why's: why is,
won't: will not,
you're: you are
6 changes: 6 additions & 0 deletions .github/styles/custom/oxford-comma.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
extends: existence
message: Use the Oxford comma in '%s'.
scope: sentence
level: suggestion
tokens:
- '(?:[^,]+,){1,}\s\w+\s(?:and|or)'
10 changes: 10 additions & 0 deletions .github/styles/custom/quotes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
extends: existence
message: Use straight quotes instead of smart quotes.
level: error
nonword: true
action:
tokens:
- “
- ”
- ‘
- ’
6 changes: 6 additions & 0 deletions .github/styles/custom/spaces.yml
Comment thread
paddyroddy marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
extends: existence
message: Use only one space between words and sentences (not two).
level: error
nonword: true
tokens:
- '[\w.?!,\(\)\-":] {2,}[\w.?!,\(\)\-":]'
16 changes: 16 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,19 @@ jobs:
git add .
pre-commit run --all-files --color always --verbose
working-directory: cookie-template/python-template

lint-prose:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- name: Run Vale
uses: errata-ai/vale-action@d89dee975228ae261d22c15adcd03578634d429c # v2
Comment thread
paddyroddy marked this conversation as resolved.
Comment thread
paddyroddy marked this conversation as resolved.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
fail_on_error: true
filter_mode: nofilter
reporter: github-check
vale_flags: --glob='!.github/styles/*'
11 changes: 11 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
StylesPath = .github/styles

# https://github.com/errata-ai/packages
Packages = proselint

[*.md]
BasedOnStyles = proselint,\
Vale

# Disable
Vale.Spelling = NO
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License

Copyright (c) 2023-2025 UCL Centre for Advanced Research Computing
Copyright © 2023-2025 UCL Centre for Advanced Research Computing
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh. It's from vale. Probs not this one, right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

What is the practice involving licences? Once made can never change? Why do we use the (c) here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Well the GPL specifically says "thou shalt not change this file".

MIT doesn't have any such clause. But to avoid potential problems, I would not reword license files.

(c)© is probably innocent enough. I would leave as is, but ¯\_(ツ)_/¯

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh wait I realise you mean why the (c) at all: because it's not in the MIT template. That's a good point. Did it come from GitHub?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't know where it came from, it is a bit weird though.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't know enough about licences, but it does seem weird that I can't reword my own licence. Guess it makes sense for GPL. Like what if you made a typo?


Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ repo, and we welcome questions there or in the `#helpme` channel on the
🍪 Our template is a [cookiecutter] template which automatically creates new
Python packages with our recommended tooling set up and ready to go.

<!-- vale proselint.Annotations = NO -->
Comment thread
paddyroddy marked this conversation as resolved.
Outdated

> [!NOTE]
> If you're making a package within a community that has an existing
> package template (e.g., [`scikit-hep`](https://github.com/scikit-hep/cookie)),
> we recommend using their template instead of this one.

<!-- vale proselint.Annotations = YES -->

## Tutorial

Some quick instructions for using our template are below.
Expand Down
2 changes: 1 addition & 1 deletion docs/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022-2025 just-the-docs
Copyright © 2022-2025 just-the-docs
Comment thread
paddyroddy marked this conversation as resolved.
Outdated

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ during tests.
| Name | Short description | 🚦 |
| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-----------------------------------------: |
| [Codecov](https://docs.codecov.com/docs) | Hosted service to report code coverage metrics. Occasionally slow to update after a report is updated, can be configured to add extra CI checks. This service is probably more widely used and is [free for both open-source and private projects](https://about.codecov.io/pricing/). | <span class="label label-green">Best</span> |
| [Coveralls](https://docs.coveralls.io/) | Hosted service to report code coverage metrics. Very similar to codecov and we don't strongly recommend one over the other. This service is only [free for open-source projects](https://coveralls.io/pricing). | <span class="label label-green">Best</span> |
| [Coveralls](https://docs.coveralls.io/) | Hosted service to report code coverage metrics. Similar to codecov and we don't strongly recommend one over the other. This service is only [free for open-source projects](https://coveralls.io/pricing). | <span class="label label-green">Best</span> |
Comment thread
paddyroddy marked this conversation as resolved.
Outdated

<details><summary> <span class="label label-green">Best</span> explanation</summary> <!-- markdownlint-disable-line MD033 -->
Both services are similar, so both <span class="label label-green">Best</span>.
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ layout: default

## Documentation

With Python, as with many other languages, it's very common to automatically
With Python, as with many other languages, it's common to automatically
Comment thread
paddyroddy marked this conversation as resolved.
Outdated
create a web page with documentation. This can include reference for the API
taken from your package's [docstrings], tutorials, examples, and more in depth
explanation about how the package works. For an in-depth discussion of the
Expand All @@ -28,7 +28,7 @@ If you're using GitHub, one option is to host your docs on [GitHub pages].
| Name | Short description | 🚦 |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------: |
| [MkDocs] | Generates documentation from Markdown files, with a plugin to generate API documentation. A good plugin ecosystem and balance of usability and customisability. | <span class="label label-green">Best</span> |
| [Sphinx] | Generates documentation from reStructuredText or Markdown files, long been the de-facto standard and very widely used. Mature plugin ecosystem. | <span class="label label-yellow">Good</span> |
| [Sphinx] | Generates documentation from reStructuredText or Markdown files, long been the de-facto standard and widely used. Mature plugin ecosystem. | <span class="label label-yellow">Good</span> |
| [gitbook] | General documentation builder; integrates with GitHub. | <span class="label label-yellow">Good</span> |
| [pdoc] | Auto-generates API documentation from docstrings, beginner friendly but with less of a plugin ecosystem than others. | <span class="label label-yellow">Good</span> |

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/libraries/parallel-async.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ simply due to pre-existing code using a library like [pandas].
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------: |
| [multiprocess] | A fork of [multiprocessing] which uses `dill` instead of `pickle` to allow serializing wider range of object types including nested / anonymous functions. We've found this easier to use than `multiprocessing`. | <span class="label label-green">Best</span> |
| [concurrent.futures] | [See the table below](#asynchronous-processing). | <span class="label label-yellow">Good</span> |
| [dask] | Aims to make scaling existing code in familiar libraries (`numpy`, [pandas], `scikit-learn`, ...) easy. | <span class="label label-yellow">Good</span> |
| [dask] | Aims to make scaling existing code in familiar libraries (`numpy`, [pandas], `scikit-learn`, ) easy. | <span class="label label-yellow">Good</span> |
| [multiprocessing] | The standard library module for distributing tasks across multiple processes. | <span class="label label-yellow">Good</span> |
| [mpi4py] | Support for MPI based parallelism. | <span class="label label-yellow">Good</span> |
| [threading] | The standard library module for multi-threading. Due to the _global interpreter lock_ [currently][PEP703] only one thread can execute Python code at a time. | <span class="label label-red">Avoid</span> |
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/virtual.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ layout: default
| [pixi] | A fast drop-in replacement for `conda`. | <span class="label label-yellow">Good</span> |
| [pyenv] | Lets you easily switch between multiple versions of Python. | <span class="label label-yellow">Good</span> |
| [virtualenv] | Creates isolated Python environments, and offers more features than venv. | <span class="label label-yellow">Good</span> |
| [venv] | Creates isolated Python environments. Fewer features than other tools, but very widely used and comes built into Python. | <span class="label label-yellow">Good</span> |
| [venv] | Creates isolated Python environments. Fewer features than other tools, but widely used and comes built into Python. | <span class="label label-yellow">Good</span> |
| [anaconda] | Due to recent [licensing ambiguity][anaconda-problems], we recommend avoiding anaconda and many of the default channels. We recommend installing miniforge and sticking to the `conda-forge` channel. | <span class="label label-red">Avoid</span> |

<!-- links here for a more readable table -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ body:
value: |-
import cookiecutter_test

...
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'd say we want to disable the ellipsis replacement because of places like this - this is Python code in a YAML file and I suspect we'll have other cases like this where we have for example Python code in a Markdown file that we don't want it touch. While it doesn't really matter here as this is meant more to indicate user to fill in rest of reproducing code, while ... is valid Python syntax raises a syntax error ('Invalid character').

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That is a fair enough reason. @K-Meech raised the point of screen readers for prose though.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This file shouldn't have changed as not a Markdown file. This is me copy-and-pasting

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.

@paddyroddy - I'm not sure what you mean by 'screen readers for prose' here? As far as I'm aware screen readers will handle both ellipsis styles similarly

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sorry, I thought that was something said the other day. I have no idea what they do with ellipsis.

render: Python
validations:
required: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ body:
attributes:
label: Is Your Feature Request Related to a Problem? Please Describe
description: A clear and concise description of what the problem is.
placeholder: I'm always frustrated when [...]
placeholder: I'm always frustrated when []
validations:
required: true
- id: solution
Expand Down
2 changes: 1 addition & 1 deletion tests/data/test_package_generation/LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- markdownlint-disable MD041 --># MIT License

Copyright (c) 2025 Eva Lu Ator
Copyright © 2025 Eva Lu Ator

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
Loading