ripgrep 11.0.2
-SIMD -AVX (compiled)
+SIMD +AVX (runtime)
Homebrew.
macOS 10.14.6 (18G95).
The .ripgreprc configuration file appears to be ignored.
mkdir test
cd test
echo test > .hidden
rg test .
rg test . --hidden
./.hidden
1:test
cat $HOME/.ripgreprc
--binary
--hidden
The configuration file is ignored.
DEBUG|grep_regex::literal|grep-regex/src/literal.rs:59: literal prefixes detected: Literals { lits: [Complete(test)], limit_size: 250, limit_class: 10 }
DEBUG|globset|globset/src/lib.rs:430: glob converted to regex: Glob { glob: "**/*~", re: "(?-u)^(?:/?|.*/)[^/]*\\~$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true }, tokens: Tokens([RecursivePrefix, ZeroOrMore, Literal('~')]) }
DEBUG|globset|globset/src/lib.rs:435: built glob set; 0 literals, 1 basenames, 0 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 1 regexes
DEBUG|globset|globset/src/lib.rs:435: built glob set; 0 literals, 0 basenames, 11 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 0 regexes
DEBUG|globset|globset/src/lib.rs:435: built glob set; 0 literals, 0 basenames, 11 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 0 regexes
DEBUG|globset|globset/src/lib.rs:435: built glob set; 0 literals, 0 basenames, 11 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 0 regexes
DEBUG|ignore::walk|ignore/src/walk.rs:1639: ignoring ./.hidden: Ignore(IgnoreMatch(Hidden))
DEBUG|globset|globset/src/lib.rs:435: built glob set; 0 literals, 0 basenames, 11 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 0 regexes
DEBUG|globset|globset/src/lib.rs:435: built glob set; 0 literals, 0 basenames, 11 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 0 regexes
The file should've matched without needing the --hidden switch.
You haven't made it clear whether you've set the RIPGREP_CONFIG_PATH environment variable or not. Please consult the guide for more info. Could you please confirm that it is set?
Setting the RIPGREP_CONFIG_PATH to the full path resolved the issue. Is there any reason why the current directory is checked but not the home directory? The documented example uses the home directory.
Not sure what you're talking about. The rule is simple: if RIPGREP_CONFIG_PATH is set, then ripgrep reads the file at that location for configuration. If it isn't set, then ripgrep doesn't look anywhere for configuration.
I have the same problem, it is a homebrew's missing duty to notice user like:
adding such to your .zshrc or .bashrc:
export RIPGREP_CONFIG_PATH=$HOME/.ripgreprc
I'm confused as to why the home directory is not checked by default, my .gitconfig, .ruby-version, .jsbeautifyrc and .eslintrc.json, .tool-versions, etc. files are...
I think it's because, at the time, there was no off-the-shelf library for looking up config files in the right place ($HOME vs $XDG_CONFIG_HOME vs whatever Windows does vs ...), and @BurntSushi didn't want to implement it himself
See https://github.com/BurntSushi/ripgrep/issues/196#issuecomment-362850321
Because if I did that, the angry denizens of the Internet will unite and whine about how there is yet another config file polluting their home directory. So if I instead support the XDG spec, then some subset of mac users will complain about how macOS doesn't use XDG. And even if I fix that, there is still Windows to consider, which is an entirely different beast.
Compare that to just setting an env var, and it is comparatively quite simple. Moreover, this is pretty carefully documented in the guide. This is the only issue I've seen that has complained about it.
Feel free to search the issue tracker. The feature request for config files documents the full progression. Until someone develops a Rust crate that implements config file discovert correctly and otherwise meets my standards, this is how ripgrep will behave.
Most helpful comment
Because if I did that, the angry denizens of the Internet will unite and whine about how there is yet another config file polluting their home directory. So if I instead support the XDG spec, then some subset of mac users will complain about how macOS doesn't use XDG. And even if I fix that, there is still Windows to consider, which is an entirely different beast.
Compare that to just setting an env var, and it is comparatively quite simple. Moreover, this is pretty carefully documented in the guide. This is the only issue I've seen that has complained about it.
Feel free to search the issue tracker. The feature request for config files documents the full progression. Until someone develops a Rust crate that implements config file discovert correctly and otherwise meets my standards, this is how ripgrep will behave.