Skip to content

Generate alternative typos with a translation table #5292

Generate alternative typos with a translation table

Generate alternative typos with a translation table #5292

# GitHub Action to check our dictionary, this should only be used by the codespell project itself
# For general usage in your repo, see the example in codespell.yml
# https://github.com/codespell-project/codespell
# Concurrency cancels an action on a given PR once a new commit is pushed
name: Pytest
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
on: [push, pull_request]
permissions: {}
jobs:
test:
env:
REQUIRE_ASPELL: true
RUFF_FORMAT: github
# Make sure we're using the latest aspell dictionary
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
python-version:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
no-toml:
- ''
include:
- python-version: '3.10'
no-toml: 'no-toml'
name: ${{ matrix.python-version }} ${{ matrix.no-toml }}
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: sudo apt-get install libaspell-dev aspell-en
- name: Install dependencies
run: |
python --version # just to check
pip install --upgrade pip wheel # upgrade to latest pip find 3.5 wheels; wheel to avoid errors
pip install --upgrade "setuptools!=47.2.0" docutils setuptools_scm[toml] twine
pip install aspell-python-py3
pip install -e ".[dev]" # install the codespell dev packages
- run: codespell --help
- run: codespell --version
- run: make check
- uses: codecov/codecov-action@v3
# tomli should not be required for the next two steps (and make sure it's not)
- run: pip uninstall -yq tomli
if: ${{ matrix.no-toml == 'no-toml' }}
- run: codespell --check-filenames --skip="./.git/*,*.pyc,./codespell_lib/tests/test_basic.py,./codespell_lib/data/*,./example/code.c,./build/lib/codespell_lib/tests/test_basic.py,./build/lib/codespell_lib/data/*,README.rst,*.egg-info/*,pyproject-codespell.precommit-toml,./.mypy_cache"
# this file has an error
- run: "! codespell codespell_lib/tests/test_basic.py"
make-check-dictionaries:
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Install general dependencies
run: pip install --upgrade pip wheel # upgrade to latest pip find 3.5 wheels; wheel to avoid errors
- name: Install codespell dependencies
run: pip install -e ".[dev]"
- uses: codespell-project/sort-problem-matcher@v1
- run: make check-dictionaries
ruff-annotation:
env:
RUFF_FORMAT: github
runs-on: ubuntu-latest
steps:
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Install codespell dependencies
run: pip install -e ".[dev]"
- name: Ruff with annotations
run: ruff --select=ANN --ignore=ANN101,ANN401 .