Skip to content

Commit 84e9063

Browse files
projectgusdpgeorge
authored andcommitted
github/workflows: Move codespell to a GitHub workflow, version it.
Similar to ruff.yaml, it's simpler to run the codespell command directly from a workflow file. And developers can run codespell directly from the command line without the need for options, or just use pre-commit. This commit also applies a specific version to codespell, same as pre-commit (introduced in a166d80). This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <[email protected]>
1 parent b038d07 commit 84e9063

File tree

3 files changed

+12
-21
lines changed

3 files changed

+12
-21
lines changed

Diff for: .github/workflows/code_formatting.yml

-10
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,3 @@ jobs:
1818
run: source tools/ci.sh && ci_c_code_formatting_run
1919
- name: Check code formatting
2020
run: git diff --exit-code
21-
22-
code-spelling:
23-
runs-on: ubuntu-latest
24-
steps:
25-
- uses: actions/checkout@v4
26-
- uses: actions/setup-python@v5
27-
- name: Install packages
28-
run: source tools/ci.sh && ci_code_spell_setup
29-
- name: Run spell checker
30-
run: source tools/ci.sh && ci_code_spell_run

Diff for: .github/workflows/codespell.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Check spelling with codespell
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
codespell:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- run: pip install --user codespell==2.2.6 tomli
11+
- run: codespell
12+

Diff for: tools/ci.sh

-11
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,6 @@ function ci_c_code_formatting_run {
3030
tools/codeformat.py -v -c
3131
}
3232

33-
########################################################################################
34-
# code spelling
35-
36-
function ci_code_spell_setup {
37-
pip3 install codespell tomli
38-
}
39-
40-
function ci_code_spell_run {
41-
codespell
42-
}
43-
4433
########################################################################################
4534
# commit formatting
4635

0 commit comments

Comments
 (0)