-
Notifications
You must be signed in to change notification settings - Fork 56
40 lines (35 loc) · 1.25 KB
/
codespell.yml
File metadata and controls
40 lines (35 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Codespell
on:
pull_request:
branches:
- main
- "release-*"
jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Backup and remove problematic files
run: |
# Backup files that cause false positives
mkdir -p /tmp/skip_backup
find . -name "pyproject.toml" -exec cp --parents {} /tmp/skip_backup/ \;
find . -name "package-lock.json" -exec cp --parents {} /tmp/skip_backup/ \;
find . -name "package.json" -exec cp --parents {} /tmp/skip_backup/ \;
# Remove problematic files temporarily
find . -name "pyproject.toml" -delete
find . -name "package-lock.json" -delete
find . -name "package.json" -delete
- name: Run codespell
run: |
pip install codespell
codespell \
--check-filenames \
--skip .git,go.sum,*.png,*.jpg,*.svg,*.gif,*.sum,bin,vendor,node_modules \
--ignore-words-list fo,nam,te,notin,NotIn \
.
- name: Restore backed up files
run: |
# Restore backed up files
cd /tmp/skip_backup && find . -type f -exec cp --parents {} $GITHUB_WORKSPACE/ \;