jscodeshift icon indicating copy to clipboard operation
jscodeshift copied to clipboard

My files are randomly skipped

Open simkessy opened this issue 3 years ago • 1 comments

Im trying to use jscodeshift but when I say directory to /src it doesn't recurse correctly. For example:

When trying ./src I get 4 files:

(.venv) ./client$ jscodeshift -t ./scripts/flow-stats/coverage-transform.js --dry --ignore-pattern="**/__generated__/**" --parser="flow" ./src
Processing 4 files... 
Spawning 4 workers...

All done. 
Results: 
0 errors
0 unmodified
0 skipped
4 ok
Time elapsed: 0.721seconds 

If I try ./src/* I get 9 files:

(.venv) ./client$ jscodeshift -t ./scripts/flow-stats/coverage-transform.js --dry --ignore-pattern="**/__generated__/**" --parser="flow" ./src/*
Processing 9 files... 
Spawning 9 workers...

All done. 
Results: 
0 errors
0 unmodified
0 skipped
9 ok
Time elapsed: 0.820seconds

When I am more specific ./src/components/**/* I get 64 files?

(.venv) ./client$ jscodeshift -t ./scripts/flow-stats/coverage-transform.js --dry --ignore-pattern="**/__generated__/**" --parser="flow" ./src/components/**/*
Processing 64 files... 
Spawning 35 workers...

All done. 
Results: 
0 errors
0 unmodified
0 skipped
64 ok
Time elapsed: 1.958seconds 

simkessy avatar Jan 22 '22 10:01 simkessy

Just commenting off the top of my head, I believe that

whatever/**/*

Is most utilities' glob syntax for "get absolutely everything under whatever". The reasons for the different patterns you supplied giving different results is that in thesions of the patterns you're moving from a more conservative to more liberal globbing definition about to whatever level to recurse to.

ElonVolo avatar Feb 22 '22 21:02 ElonVolo