Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
790a265
fixed a mistake in dictionary_en-GB_to_en-US.txt
johann1764 Sep 17, 2025
bb961aa
more helpful error message when pytest-cov not installed
johann1764 Sep 17, 2025
1398ae9
gen dictionary_en_to_en-OX.txt from dictionary_en-GB_to_en-US.txt
johann1764 Sep 16, 2025
73bfa98
update _codespell for _en_to_en-OS management
johann1764 Sep 17, 2025
ca2f005
added a bit of vocabulary gen_OX, en-GB_to_en-US
johann1764 Sep 17, 2025
63c9b7f
more robust special case handling gen_OX
johann1764 Sep 17, 2025
e4b9d67
another exception in `gen_OX.sh`, `Makefile`
johann1764 Sep 17, 2025
f7bb8be
completed to isxxx->izxxx rule with able and er
johann1764 Sep 17, 2025
6b0c63e
make sure `dictionary_en_to_en-OX.txt` is generated and sorted before…
johann1764 Sep 17, 2025
0388747
marked `en-GB_to_en-US` as incompatible with `en_to_en-OX` in test_di…
johann1764 Sep 17, 2025
e128c87
two dictionaries offering the same substitution is not an error anymore
johann1764 Sep 17, 2025
5a8ab5f
check dicts before testing them tox.ini
johann1764 Sep 17, 2025
201b074
added `dictionary_en_to_en-OX.txt`
johann1764 Sep 17, 2025
4d6e0de
dictionary_en_to_en-OX.txt->dictionary_en_to_en-OX_AUTOGENERATED.txt
johann1764 Sep 17, 2025
afe4a4d
Better management of storey and practise
johann1764 Sep 18, 2025
b28529b
clearer gen_OX && updated exception lists
johann1764 Sep 19, 2025
e568868
more special cases
johann1764 Sep 19, 2025
9ddb649
fixed focuss*
johann1764 Sep 19, 2025
dedc915
gen_OX.sh now sorts its output correctly
johann1764 Sep 21, 2025
3f78d4b
MAINT: Add to autofix.ci and make sure it works
larsoner Sep 22, 2025
7593f21
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 22, 2025
823c5e0
FIX: Name
larsoner Sep 22, 2025
09b5957
PR3772 review - update autofix & revert Makefile err msg change & mv …
johann1764 Sep 22, 2025
694ab8d
Merge branch 'main' into en_to_OX-rebased
larsoner Sep 23, 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
19 changes: 19 additions & 0 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: autofix.ci

on: # yamllint disable-line rule:truthy
pull_request:
types: [opened, synchronize, labeled, unlabeled]

permissions:
contents: read

jobs:
autofix:
name: Regenerate autogenerated files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- run: make codespell_lib/data/dictionary_en_to_en-OX_AUTOGENERATED.txt
- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27
19 changes: 12 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
DICTIONARIES := codespell_lib/data/dictionary*.txt codespell_lib/tests/data/*.wordlist
DICTIONARIES = codespell_lib/data/dictionary*.txt codespell_lib/tests/data/*.wordlist

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

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

check: check-dictionaries check-dist pytest ruff
all: $(GENERATED) check-dictionaries codespell.1
Comment thread
johann1764 marked this conversation as resolved.

check: $(GENERATED) check-dictionaries check-dist pytest ruff

$(GENERATED): codespell_lib/data/dictionary_en-GB_to_en-US.txt ./tools/gen_OX.sh
./tools/gen_OX.sh codespell_lib/data/dictionary_en-GB_to_en-US.txt > codespell_lib/data/dictionary_en_to_en-OX_AUTOGENERATED.txt

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

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

sort-dictionaries:
sort-dictionaries: $(GENERATED)
pre-commit run --all-files file-contents-sorter

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

pytest:
pytest: sort-dictionaries
@if command -v pytest > /dev/null; then \
pytest codespell_lib; \
else \
Expand Down
9 changes: 9 additions & 0 deletions codespell_lib/_codespell.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@
("en_GB",),
("en_US",),
),
(
"en_to_en-OX",
"for corrections from en to en-OX",
"_en_to_en-OX_AUTOGENERATED",
None,
None,
None,
None,
),
)
_builtin_default = "clear,rare"

Expand Down
11 changes: 10 additions & 1 deletion codespell_lib/data/dictionary_en-GB_to_en-US.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ characterise->characterize
characterised->characterized
characterises->characterizes
characterising->characterizing
civilisation->civilization
cognisant->cognizant
colour->color
colouration->coloration
Expand Down Expand Up @@ -258,6 +259,7 @@ manoeuvres->maneuvers
manoeuvring->maneuvering
marshalled->marshaled
marshalling->marshaling
maths->math
maximisation->maximization
maximise->maximize
maximised->maximized
Expand Down Expand Up @@ -359,7 +361,7 @@ polarises->polarizes
polarising->polarizing
practise->practice
practised->practiced
practises->practiced
practises->practices
practising->practicing
pretence->pretense
pretences->pretenses
Expand All @@ -368,6 +370,7 @@ prioritise->prioritize
prioritised->prioritized
prioritises->prioritizes
prioritising->prioritizing
programme->program
publicise->publicize
publicised->publicized
publicises->publicizes
Expand Down Expand Up @@ -400,6 +403,8 @@ recognising->recognizing
refocussed->refocused
refocusses->refocuses
refocussing->refocusing
refuelled->refueled
refuelling->refueling
regularisation->regularization
regularise->regularize
regularised->regularized
Expand All @@ -420,6 +425,8 @@ reparameterised->reparameterized
reparameterises->reparameterizes
reparameterising->reparameterizing
rigour->rigor
routeing->routing
saleable->salable
sanitisation->sanitization
sanitise->sanitize
sanitised->sanitized
Expand Down Expand Up @@ -489,6 +496,8 @@ synthesiser->synthesizer
synthesisers->synthesizers
synthesises->synthesizes
synthesising->synthesizing
titbit->tidbit
titbits->tidbits
totalled->totaled
totalling->totaling
unauthorised->unauthorized
Expand Down
Loading
Loading