cspell icon indicating copy to clipboard operation
cspell copied to clipboard

Patterns in Git ignore do not improve the scanning performance unlike direct ignorePaths

Open aminya opened this issue 3 years ago • 0 comments

Info

Kind of Issue

  • [x] runtime - command-line tools

Which Tool or library

  • [x] cspell -- the command-line spelling tool

Which Version

Version: 6.1.2

version: 11

OS version if applicable.

Bug Description

Describe the bug

The patterns in gitignore do not improve the scanning performance unlike the patterns in ignorePaths. I used to use gitignore for storing all my ignored paths, but I realized that is only applied in the last step. I think the issue is with the globbing functionality. All the ignore patterns should be concatenated before starting the scan.

cspell.config.yaml

files:
  - "**"
useGitignore: true
# ignorePaths:
#    - "**/node_modules/"   # if you enable this, the performance is increased significantly 

and this in gitignore:

node_modules/

I also noticed that **/* is slower than **

To Reproduce

Steps to reproduce the behavior:

cspell lint --no-progress --show-suggestions --cache --cache-location ./.cache/cspell/.cspellcache

Expected behavior

gitignore patterns should work like ignorePaths

Screenshots

Additional context

cspell.json

See the above

Example Repository (Optional)

aminya avatar Jun 13 '22 09:06 aminya