phiresky/ripgrep-all

Can't disable adapters

runxel opened this issue · 12 comments

runxel commented

Describe the bug
Trying to disable adapters with --rga-adapters=-zip,sqlite does not work.
Next search will still have .zip's being searched...
(not helpful at all, it will just spit a lot of errors like:)

adapter: zip
Error: Unsupported Zip archive: The file length is not available in the local header

Operating System and Version
MacOS 13.5.2

Output of rga --version
ripgrep-all 0.9.6

It seems to work for me on 1.0.0-alpha. Please try there

runxel commented

Nope, doesn't work.
Gives me now preprocessor command failed errors for zips tho.

Also the whole output is now cluttered with

<somepath>/.DS_Store adapter: postprocprefix

Huh??? Other file types as well. With Alpha 5 it seems rga just looks into everything.

I can't reproduce this. If I run rga --rga-adapters=-zip,sqlite fell in the exampledir in the repo, the result is as expected. Please send a minimal reproducible example.

runxel commented

Please send a minimal reproducible example.

How can I do that?
Also, is this config saved somewhere so I can look into that?

Please send a minimal reproducible example.

How can I do that?

@runxel In this case, a minimum working example would mostly consist of you sharing a file that results in the buggy behavior when running rga against it. If your original file is large or contains sensitive information, you might need to construct a new file for testing. If you're willing to do a little extra work, you could even raise a PR adding that new file to exampledir/ with corresponding tests that fail.

Also, is this config saved somewhere so I can look into that?

Yes. rga uses directories-next, so the location of the config file varies by OS:

  • macOS: ~/Library/Application Support/ripgrep-all/config.jsonc
  • Linux: $XDG_CONFIG_HOME/ripgrep-all/config.jsonc or ~/.confic/ripgrep-all/config.json if $XDG_CONFIG_HOME isn't set
  • Windows: %AppData%/ripgrep-all/config.json
runxel commented

Thank you for that @lafrenierejm. So it seems the issue is with rga not updating its config.json at all. Mine is empty except for the default comment in it.
How would the entry need to look like? I could then see if rga at least can read its own config file.
Because this does not work:

{
	"adapters": "-zip"
}

Both --rga-adapters=-zip and "adapters": ["-zip"] in the config file work (for me) in the newly released 0.10.3.