codeql-cli-binaries icon indicating copy to clipboard operation
codeql-cli-binaries copied to clipboard

Allow index-files to specify file target list?

Open Manouchehri opened this issue 3 years ago • 5 comments

Instead of manually specifying --include=src/file1.js, --include=src/file2.js, --include=src/file3.js, etc, hundred/thousands of times for large projects, it would be really handy if I could just provide the list of files I want indexed.

Usage would look like:

codeql database index-files --language=javascript --file-list=targets.txt my_database

And targets.txt would look like:

src/file1.js
src/file2.js
src/file3.js

(Obviously in a real world use-case, it would be a much longer list.)

Semi-related: #9.

Manouchehri avatar Jul 28 '21 17:07 Manouchehri

Are you interested in indexing a fixed list of files, rather than using a glob pattern (which --include already supports)?

adityasharad avatar Jul 28 '21 18:07 adityasharad

That's correct!

Manouchehri avatar Jul 28 '21 18:07 Manouchehri

Could you do something like:

codeql database index-files --language=javascript --include=src/file1.js --include=src/file2.js --include=src/file3.js my_database

This wouldn't work for 100s of files, but might work for a handful.

aeisenberg avatar Jul 28 '21 18:07 aeisenberg

That would work, but yeah, my use-case is in the >1,000 range of files. =)

Manouchehri avatar Jul 28 '21 18:07 Manouchehri

This might be something we want to support more directly, but I imagine you could achieve what you need with xargs in the meantime.

edoardopirovano avatar Jul 28 '21 19:07 edoardopirovano