Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: codespell improvements #5955

Merged
merged 5 commits into from
Aug 14, 2023
Merged

Conversation

kmk3
Copy link
Collaborator

@kmk3 kmk3 commented Aug 12, 2023

Changes:

$ git log --reverse --pretty='* %s' master..
* build: fix codespell errors in more files
* build: codespell: remove dependency on "clean"
* ci: move codespell job into its own workflow
* ci: run ./configure in codespell
* build: run codespell on almost all files

Homepage: https://github.com/codespell-project/codespell

Added on commit d78fc96 ("codespell github action", 2023-03-05).

@kmk3 kmk3 force-pushed the build-codespell-improvements branch 5 times, most recently from 15965b2 to 16e6215 Compare August 12, 2023 23:42
@kmk3 kmk3 marked this pull request as draft August 13, 2023 22:29
Found by simply running `codespell .`.

Environment: codespell 2.2.5-2 on Artix Linux.
It works just fine without it (at least for the files in src/).

Note that by default codespell does not warn about binary files ("The
default mask is 34"):

    $ make -j "$(nproc)" >/dev/null
    $ make codespell
    codespell --ignore-regex "UE|creat|doas|ether|isplay|shotcut" src test
    $ codespell --version
    2.2.5
    $ codespell --help
    [...]
      -q QUIET_LEVEL, --quiet-level QUIET_LEVEL
                            bitmask that allows suppressing messages:
                            - 0: print all messages.
                            - 1: disable warnings about wrong encoding.
                            - 2: disable warnings about binary files.
                            - 4: omit warnings about automatic fixes that were
                              disabled in the dictionary.
                            - 8: don't print anything for non-automatic fixes.
                            - 16: don't print the list of fixed files.
                            - 32: don't print configuration files.
                            As usual with bitmasks, these levels can be combined;
                            e.g. use 3 for levels 1+2, 7 for 1+2+4, 23 for
                            1+2+4+16, etc. The default mask is 34.

Also, note that adding many ignore patterns (such as all of the ones in
.gitignore) makes it slower than letting codespell find and skip binary
files by itself.  So just add the most common ones, which do not
noticeably change how fast codespell runs either but they do reduce the
noise when running with `-q 0`.

Homepage: https://github.com/codespell-project/codespell

Added on commit d78fc96 ("codespell github action", 2023-03-05).
@kmk3 kmk3 force-pushed the build-codespell-improvements branch from 16e6215 to 10fdc48 Compare August 14, 2023 02:24
@kmk3 kmk3 marked this pull request as ready for review August 14, 2023 02:25
Split the spellchecking job from the build-related jobs to make
debugging easier.
Since it runs through make, the target may depend on variables that are
defined by ./configure (such as the ones in config.mk).
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
@kmk3 kmk3 force-pushed the build-codespell-improvements branch from 10fdc48 to b2821a3 Compare August 14, 2023 07:33
@kmk3 kmk3 merged commit fd05c9a into netblue30:master Aug 14, 2023
10 checks passed
@kmk3 kmk3 deleted the build-codespell-improvements branch August 14, 2023 21:37
kmk3 added a commit that referenced this pull request Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done (on RELNOTES)
Development

Successfully merging this pull request may close these issues.

1 participant