Open vegerot opened 9 months ago
note: #1167 would be an alternative solution if quick-lint respected .gitignore
. However, since that proposal does not, this proposal is better.
I accept this task.
Why not use xargs
?
So something like
$ fd --extension=.js --extension=.jsx --extension=.ts --extension=.tsx | xargs -n999999999 quick-lint-js
? Because that makes too much sense.
think of the microseconds saved from quick-lint being able to do it all itself!
xargs
was the first thing I looked into when I played with this idea this week (after fd
's builtin exec). The problem I ran into was not being able to tell xargs
to wrap quotes around every argument
❯ echo "apps/us/e2e/full-regression/src/glass-orders/tc196-tiered -fast-refund -order.test.ts" | xargs -J{} quick-lint-js {}
error: unrecognized option: -fast-refund
That's when I tried the other solutions I mentioned in the OP and forgot I had tried this! My bad
@vegerot You should look at the -0
option of both fd
and xargs
. -0
on both will cause file names to be transferred without space splitting.
Typical command: find . -name '*.ts' -print0 | xargs -0 quick-lint-js --
Problem: I want to run quick-lint on a large project (120k files, 6m SLoC).
Approaches tried:
fd --extension=... | xargs -J{} quick-lint-js "{}"
doesn't work with filenames with spaces in themquick-lint-js $(fd ...)
zsh can't handle that many argumentsexec("/usr/local/bin/quick-lint-js", ...)
fails because it exceedsNCARGS
NCARGS
works but is inconvenient to usersRecommendation: quick-lint CLI option that accepts the path to a file containing the paths of many files to check. This file can contain many more files than
NCARGS
.Out of scope:
$ fd --extension=.js --extension=.mjs --extension=.jsx --extension=.ts --extension=.tsx | quick-lint-js --file-with-filenames=-