Skip to content

Commit 2f3751e

Browse files
johann1764larsonerautofix-ci[bot]
authored
Support for Oxford English (rebased) (#3772)
Co-authored-by: Eric Larson <larson.eric.d@gmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 7042421 commit 2f3751e

8 files changed

Lines changed: 665 additions & 16 deletions

File tree

.github/workflows/autofix.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: autofix.ci
2+
3+
on: # yamllint disable-line rule:truthy
4+
pull_request:
5+
types: [opened, synchronize, labeled, unlabeled]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
autofix:
12+
name: Regenerate autogenerated files
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v5
16+
with:
17+
persist-credentials: false
18+
- run: make codespell_lib/data/dictionary_en_to_en-OX_AUTOGENERATED.txt
19+
- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27

Makefile

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1-
DICTIONARIES := codespell_lib/data/dictionary*.txt codespell_lib/tests/data/*.wordlist
1+
DICTIONARIES = codespell_lib/data/dictionary*.txt codespell_lib/tests/data/*.wordlist
22

33
PHONY := all check check-dictionaries sort-dictionaries trim-dictionaries check-dist pytest pypi ruff clean
44

5-
all: check-dictionaries codespell.1
5+
GENERATED := codespell_lib/data/dictionary_en_to_en-OX_AUTOGENERATED.txt
66

7-
check: check-dictionaries check-dist pytest ruff
7+
all: $(GENERATED) check-dictionaries codespell.1
8+
9+
check: $(GENERATED) check-dictionaries check-dist pytest ruff
10+
11+
$(GENERATED): codespell_lib/data/dictionary_en-GB_to_en-US.txt ./tools/gen_OX.sh
12+
./tools/gen_OX.sh codespell_lib/data/dictionary_en-GB_to_en-US.txt > codespell_lib/data/dictionary_en_to_en-OX_AUTOGENERATED.txt
813

914
codespell.1: codespell.1.include Makefile
1015
PYTHONPATH=. help2man codespell --include codespell.1.include --no-info --output codespell.1
1116
sed -i '/\.SS \"Usage/,+2d' codespell.1
1217

13-
check-dictionaries:
18+
check-dictionaries: sort-dictionaries
1419
@for dictionary in ${DICTIONARIES}; do \
1520
if grep -E -n "^\s*$$|\s$$|^\s" $$dictionary; then \
1621
echo "Dictionary $$dictionary contains leading/trailing whitespace and/or blank lines. Trim with 'make trim-dictionaries'"; \
@@ -24,10 +29,10 @@ check-dictionaries:
2429
exit 1; \
2530
fi
2631

27-
sort-dictionaries:
32+
sort-dictionaries: $(GENERATED)
2833
pre-commit run --all-files file-contents-sorter
2934

30-
trim-dictionaries:
35+
trim-dictionaries: $(GENERATED)
3136
@for dictionary in ${DICTIONARIES}; do \
3237
sed -E -i.bak -e 's/^[[:space:]]+//; s/[[:space:]]+$$//; /^$$/d' $$dictionary && rm $$dictionary.bak; \
3338
done
@@ -41,7 +46,7 @@ check-dist:
4146
ruff:
4247
pre-commit run --all-files ruff-check
4348

44-
pytest:
49+
pytest: sort-dictionaries
4550
@if command -v pytest > /dev/null; then \
4651
pytest codespell_lib; \
4752
else \

codespell_lib/_codespell.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,15 @@
123123
("en_GB",),
124124
("en_US",),
125125
),
126+
(
127+
"en_to_en-OX",
128+
"for corrections from en to en-OX",
129+
"_en_to_en-OX_AUTOGENERATED",
130+
None,
131+
None,
132+
None,
133+
None,
134+
),
126135
)
127136
_builtin_default = "clear,rare"
128137

codespell_lib/data/dictionary_en-GB_to_en-US.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ characterise->characterize
6969
characterised->characterized
7070
characterises->characterizes
7171
characterising->characterizing
72+
civilisation->civilization
7273
cognisant->cognizant
7374
colour->color
7475
colouration->coloration
@@ -258,6 +259,7 @@ manoeuvres->maneuvers
258259
manoeuvring->maneuvering
259260
marshalled->marshaled
260261
marshalling->marshaling
262+
maths->math
261263
maximisation->maximization
262264
maximise->maximize
263265
maximised->maximized
@@ -359,7 +361,7 @@ polarises->polarizes
359361
polarising->polarizing
360362
practise->practice
361363
practised->practiced
362-
practises->practiced
364+
practises->practices
363365
practising->practicing
364366
pretence->pretense
365367
pretences->pretenses
@@ -368,6 +370,7 @@ prioritise->prioritize
368370
prioritised->prioritized
369371
prioritises->prioritizes
370372
prioritising->prioritizing
373+
programme->program
371374
publicise->publicize
372375
publicised->publicized
373376
publicises->publicizes
@@ -400,6 +403,8 @@ recognising->recognizing
400403
refocussed->refocused
401404
refocusses->refocuses
402405
refocussing->refocusing
406+
refuelled->refueled
407+
refuelling->refueling
403408
regularisation->regularization
404409
regularise->regularize
405410
regularised->regularized
@@ -420,6 +425,8 @@ reparameterised->reparameterized
420425
reparameterises->reparameterizes
421426
reparameterising->reparameterizing
422427
rigour->rigor
428+
routeing->routing
429+
saleable->salable
423430
sanitisation->sanitization
424431
sanitise->sanitize
425432
sanitised->sanitized
@@ -489,6 +496,8 @@ synthesiser->synthesizer
489496
synthesisers->synthesizers
490497
synthesises->synthesizes
491498
synthesising->synthesizing
499+
titbit->tidbit
500+
titbits->tidbits
492501
totalled->totaled
493502
totalling->totaling
494503
unauthorised->unauthorized

0 commit comments

Comments
 (0)