drahnr / cargo-spellcheck

Checks all your documentation for spelling and grammar mistakes with hunspell and a nlprule based checker for grammar
Apache License 2.0
326 stars 33 forks source link

Spurious "Unexpected item made it into the items" warnings #271

Closed ravenexp closed 2 years ago

ravenexp commented 2 years ago

Describe the bug

Running cargo-spellcheck -v produces a lot of spurious warnings when run inside a project directory which is a git repo.

To Reproduce

Steps to reproduce the behaviour:

  1. cd into a project directory which is a git repo.
  2. Run cargo spellcheck -v
  3. Get lots of warnings like:
[2022-08-17T10:55:38Z WARN  cargo_spellcheck::traverse] Unexpected item made it into the items /home/user/project/.git/objects/59/576875cf478ce9bcda9b9c996096da3c035123

Expected behavior

Files from .git/ and directories listed in .gitignore are silently ignored.

Please complete the following information:

drahnr commented 2 years ago

Could you try with the latest git version and also provide the relevant config and a run with -vvv as well as a listing ls -al of the root dir from where you launch cargo-spellcheck

drahnr commented 2 years ago

I cannot reproduce with latest master, could you provide a minimal test case?

ravenexp commented 2 years ago

I've built cargo-spellcheck from master and the same thing happens.

Complete steps:

  1. mkdir foo; cd foo
  2. mdbook init
  3. git init
  4. mdbook build
  5. cargo-spellcheck -v

Outputs lots of WARN cargo_spellcheck::traverse] Unexpected item made it into the items warnings.

ls -al
total 8
drwxr-xr-x 1 x y   60 Aug 17 16:12 ./
drwx------ 1 x y 2168 Aug 17 16:31 ../
drwxr-xr-x 1 x y  490 Aug 17 16:13 book/
-rw-r--r-- 1 x y  107 Aug 17 16:11 book.toml
drwxr-xr-x 1 x y  144 Aug 17 16:12 .git/
-rw-r--r-- 1 x y    5 Aug 17 16:11 .gitignore
drwxr-xr-x 1 x y   44 Aug 17 16:11 src/
drahnr commented 2 years ago

Could you retry the latest master - the warnings were a bit too focused on the use case around the use case in a cargo manifest dir - it's a cargo plugin after all. I reduced the warning level and .gitignore is honoured now.