Skip to content

Commit

Permalink
build: run codespell on almost all files
Browse files Browse the repository at this point in the history
Ignore only third-party/vendored files (such as license files and files
in m4/).

And ignore more words to fix the following errors:

    $ make codespell
    Running codespell...
    ./README:484: als ==> also
    ./README:646: Shotcut ==> Shortcut
    ./RELNOTES:516: als ==> also
    ./etc/inc/disable-common.inc:506: chage ==> change, charge
    ./etc/apparmor/firejail-default:35: readby ==> read, read by
    ./etc/apparmor/firejail-default:36: readby ==> read, read by
    ./etc/profile-a-l/als.profile:1: als ==> also
    ./etc/profile-a-l/als.profile:5: als ==> also
    make: *** [Makefile:374: codespell] Error 65
    $ codespell --version
    2.2.5
  • Loading branch information
kmk3 committed Aug 14, 2023
1 parent 894b145 commit b2821a3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: Codespell

on:
push:
paths:
- 'src/**'
- 'test/**'
paths-ignore:
- 'm4/**'
- COPYING
pull_request:
paths:
- 'src/**'
- 'test/**'
paths-ignore:
- 'm4/**'
- COPYING

permissions: # added using https://github.com/step-security/secure-workflows
contents: read
Expand Down
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,16 @@ cppcheck: clean
scan-build: clean
scan-build $(MAKE)

# TODO: Old codespell versions (such as v2.1.0 in CI) have issues with
# contrib/syscalls.sh
.PHONY: codespell
codespell:
@printf 'Running %s...\n' $@
@codespell --ignore-regex "UE|creat|doas|ether|isplay|shotcut" \
@codespell --ignore-regex 'UE|als|chage|creat|doas|ether|isplay|readby|[Ss]hotcut' \
-S *.gz,*.o,*.so \
src test
-S COPYING,m4 \
-S ./contrib/syscalls.sh \
.

.PHONY: print-env
print-env:
Expand Down

0 comments on commit b2821a3

Please sign in to comment.