Open DimitriPapadopoulos opened 2 years ago
I think this is related to https://github.com/codespell-project/codespell/issues/1915
Creating a test environment.
mkdir -p test/.git
mkdir -p test/.svn
mkdir -p test/log
mkdir -p test/inc
mkdir -p test/src
mkdir -p test/res
cd test/
echo abotu >> .git/test.txt
echo abotu >> .svn/test.txt
echo abotu >> src/my-test.c
echo abotu >> inc/my-test.h
echo abotu >> res/test.jpg
echo abotu >> res/test.png
echo abotu >> log/test.log
Here is my test results without --skip
codespell
./log/test.log:1: abotu ==> about
./src/my-test.c:1: abotu ==> about
./res/test.png:1: abotu ==> about
./res/test.jpg:1: abotu ==> about
./inc/my-test.h:1: abotu ==> about
My test results after adding --skip
codespell --skip=.git,log,*.png,*.jpg,inc
./src/my-test.c:1: abotu ==> about
codespell --skip .git,log,*.png,*.jpg,inc
./src/my-test.c:1: abotu ==> about
codespell -S .git,log,*.png,*.jpg,inc
./src/my-test.c:1: abotu ==> about
It seem to me that it is unable to handle sub-directory slash in --skip well.
mkdir -p src/3rd-party
mkdir -p inc/3rd-party
echo abotu >> src/3rd-party/test.c
echo abotu >> inc/3rd-party/test.h
codespell -S .git,src/3rd-party,log,*.png,*.jpg,inc
./src/my-test.c:1: abotu ==> about
./src/3rd-party/test.c:1: abotu ==> about
Indeed, --skip .git
does work after all. Probably an issue with /
as you write.
@DimitriPapadopoulos To skip sub-directory, you will need to start with ./
This one won't work.
codespell -S .git,src/3rd-party,log,*.png,*.jpg,inc
./src/my-test.c:1: abotu ==> about
./src/3rd-party/test.c:1: abotu ==> about
This one is working when you start with ./
for sub-directory.
codespell -S .git,./src/3rd-party,log,*.png,*.jpg,inc
./src/my-test.c:1: abotu ==> about
Yes, I've just noticed that. Do you agree it's a nuisance? I plan on fixing it.
I might be doing something stupid, but I cannot find a way to skip these files or folders:
I have tried the three variants
-S
,--skip
,--skip=
and all these forms:The only thing that seems to be working for
tests/ci/checkpatch/spelling.txt
is: