Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ripgrep doesn't respect .ignore file #1321

Closed
tesuji opened this issue Jul 11, 2019 · 2 comments
Closed

ripgrep doesn't respect .ignore file #1321

tesuji opened this issue Jul 11, 2019 · 2 comments
Labels
duplicate An issue that is duplicative of another.

Comments

@tesuji
Copy link

tesuji commented Jul 11, 2019

What version of ripgrep are you using?

ripgrep 11.0.1 (rev 8ebc113)
-SIMD -AVX (compiled)
+SIMD -AVX (runtime)

How did you install ripgrep?

Build from source

What operating system are you using ripgrep on?

Debian GNU/Linux 9.9 (stretch) 4.9.0-9-amd64 #1 SMP Debian 4.9.168-1+deb9u2 (2019-05-13) x86_64 GNU/Linux

Describe your question, feature request, or bug.

Ripgrep doesn't respect .ignore file. My .ignore file:

src/test
src/rust-installer
src/doc/nomicon
src/tools/cargo
src/doc/reference
src/doc/book
src/tools/rls
src/tools/clippy
src/tools/rustfmt
src/tools/miri
src/doc/rust-by-example
src/llvm-emscripten
src/stdsimd
src/doc/rustc-guide
src/doc/edition-guide
src/llvm-project
src/doc/embedded-book

Project I grepped: https://github.com/rust-lang/rust
In the project root, I used rg -trust '^\s*extern\s+crate\s+[a-z][_a-zA-Z0-9]*;' src.
But ripgrep also included search result from src/test:

...
src/tools/rls/rls-analysis/src/test/mod.rs
17:extern crate env_logger;

src/test/run-make-fulldeps/issue-26006/in/time/lib.rs
2:extern crate libc;

src/test/ui/issues/issue-38875/issue-38875.rs
4:extern crate issue_38875_b;

src/test/run-make/thumb-none-qemu/example/src/main.rs
5:extern crate cortex_m;
9:extern crate panic_halt;
...

If this is a bug, what are the steps to reproduce the behavior?

See above.

If this is a bug, what is the actual behavior?

The output is really large, upto 18MiB with only stderr. I don't know if it is
appropriate to put it in gist.

If you actually need it, I will upload it somewhere later.

If this is a bug, what is the expected behavior?

I think ripgrep should ignore src/test path.

@tesuji
Copy link
Author

tesuji commented Jul 11, 2019

On a second thoughts, I upload ripgrep output with --debug option here. Note that this
file only includes stderr from ripgrep.

rgoutput-stderr-only.zip

@BurntSushi
Copy link
Owner

Dupe of #829.

@BurntSushi BurntSushi added the duplicate An issue that is duplicative of another. label Jul 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate An issue that is duplicative of another.
Projects
None yet
Development

No branches or pull requests

2 participants