codespell-project / actions-codespell

MIT License
73 stars 19 forks source link

exclude_file vs. skip #33

Open DimitriPapadopoulos opened 3 years ago

DimitriPapadopoulos commented 3 years ago

I don't understand the documentation of exclude_file:

File with lines that should not be checked for spelling mistakes.

This parameter is optional; by default codespell will check all lines.

uses: codespell-project/actions-codespell@master
with:
  exclude_file: src/foo

Does it exclude lines or files? If it excludes specific lines, please give an example how to achieve that. If it excludes files, remove any reference to line and explain how skip and exclude_file are different.

DimitriPapadopoulos commented 3 years ago

OK, I get it. exclude_file is equivalent to the --exclude_file option. Documenting the format of the file would help understand what you mean (File with lines of other files that should not be checked instead of File with some of its own lines that should not be checked).

Note that text formatting is different in codespell --help (uppercase FILE) and does help understand a little bit:

  -x FILE, --exclude-file=FILE
                        FILE with lines that should not be changed
DimitriPapadopoulos commented 3 years ago

The fact that the --skip option doesn't seem to be working doesn't help. All of the following commands report spelling error in file tests/ci/checkpatch/spelling.txt:

codespell --skip=./tests/ci/checkpatch/spelling.txt
codespell --skip=tests/ci/checkpatch/spelling.txt
codespell --skip=./tests/ci/checkpatch
codespell --skip=tests/ci/checkpatch

This does work:

codespell --skip=spelling.txt
peternewman commented 2 years ago

See https://github.com/codespell-project/codespell/pull/2052 which we should port into here.

OK, I get it. exclude_file is equivalent to the --exclude_file option.

Nearly all these options are just mirroring their base codespell ones.

Documenting the format of the file would help understand what you mean (File with lines of other files that should not be checked instead of File with some of its own lines that should not be checked).

Can you feed that into https://github.com/codespell-project/codespell/pull/2052

Note that text formatting is different in codespell --help (uppercase FILE) and does help understand a little bit:

We should just take the improvements from that PR as they are when it's merged.

The fact that the --skip option doesn't seem to be working doesn't help. All of the following commands report spelling error in file tests/ci/checkpatch/spelling.txt:

See the upstream https://github.com/codespell-project/codespell/issues/2047 and https://github.com/codespell-project/codespell/pull/2058 amongst others.