enable codespell via github workflow.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
This commit is contained in:
Tomoya Fujita 2025-09-30 11:25:58 +09:00
parent 3031526017
commit 280ca10290
5 changed files with 56 additions and 1 deletions

21
.github/workflows/codespell.yml vendored Normal file
View file

@ -0,0 +1,21 @@
name: codespell
on: pull_request
jobs:
spellcheck:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies with pip
run: pip install --no-warn-script-location --user codespell
- name: Spellcheck
run: make spellcheck

View file

@ -484,3 +484,19 @@ else
conformance_e2e:
tests/scripts/conformance_e2e.sh ${KIND_IMAGE} ${CONFORMANCE_TYPE}
endif
define SPELLCHECK_HELP_INFO
# run spellcheck check.
#
# Example:
# make spellcheck
# make spellcheck HELP=y
endef
.PHONY: spellcheck
ifeq ($(HELP),y)
spellcheck:
@echo "$$CODESPELL_HELP_INFO"
else
spellcheck:
codespell --config codespell.cfg
endif

18
codespell.cfg Normal file
View file

@ -0,0 +1,18 @@
[codespell]
# Enable built-in dictionaries/rules.
# See more details for https://github.com/codespell-project/codespell/tree/main/codespell_lib/data.
builtin = clear,rare,informal,code
# Ignore words listed in this file.
ignore-words = codespell_whitelist.txt
# Add custom dictionary file.
dictionary = codespell_dictionary.txt,-
# Skip checking files or directories.
# This folder is ignored for a couple of reasons.
# e.g) CHANGELOG files are generated by commit history that could include some misspellings,
# but we should keep the original commit messages here.
# Besides, it includes names of authors and contributors, which compile up the false alarms.
skip = ./vendor/*,./go.sum,./build/*,./LICENSES/*,./CHANGELOG/*,*.svg

0
codespell_dictionary.txt Normal file
View file

0
codespell_whitelist.txt Normal file
View file