22+ results for 'ripgrep lang:rust' (286 ms)
3// 4// CLI used is adapted from ripgrep 48a8a3a691220f9e5b2b08f4051abe8655ea7e8a 5regression.rs https://github.com/chromium/chromium.git | Rust | 219 lines
130 131// See: https://github.com/BurntSushi/ripgrep/issues/1203 132ismatch!(reverse_suffix1, r"[0-4][0-4][0-4]000", "153.230000", true); 194 195// See: https://github.com/BurntSushi/ripgrep/issues/1247 196#[test]misc.rs git://github.com/fosskers/aura.git | Rust | 36 lines
10 11/// Expected location of the `ripgrep` executable. 12const RIPGREP: &str = "/bin/rg"; 29pub(crate) fn searcher() -> (&'static str, &'static [&'static str]) { 30 let rg = Path::new(RIPGREP); 31 if rg.exists() { 31 if rg.exists() { 32 (RIPGREP, &["-N"]) 33 } else {main.rs https://bitbucket.org/sailfish009/rust.git | Rust | 139 lines
22 Test { 23 name: "ripgrep", 24 repo: "https://github.com/BurntSushi/ripgrep",tests.rs https://github.com/BurntSushi/ripgrep.git | Rust | 22 lines
9 10// Tests for ripgrep's handling of binary files. 11mod binary; 11mod binary; 12// Tests related to most features in ripgrep. If you're adding something new 13// to ripgrep, tests should probably go in here. 14mod feature; 15// Tests for ripgrep's JSON format. 16mod json; 18mod misc; 19// Tests for ripgrep's multiline search support. 20mod multiline;lib.rs https://github.com/BurntSushi/ripgrep.git | Rust | 23 lines
1/*! 2ripgrep, as a library. 3 4This library is intended to provide a high level facade to the crates that 5make up ripgrep's core searching routines. However, there is no high level 6documentation available yet guiding users on how to fit all of the piecesconfig.rs https://github.com/BurntSushi/ripgrep.git | Rust | 169 lines
1// This module provides routines for reading ripgrep config "rc" files. The 2// primary output of these routines is a sequence of arguments, where each 16 17/// Return a sequence of arguments derived from ripgrep rc configuration files. 18pub fn args() -> Vec<OsString> { 18pub fn args() -> Vec<OsString> { 19 let config_path = match env::var_os("RIPGREP_CONFIG_PATH") { 20 None => return vec![], 47 48/// Parse a single ripgrep rc file from the given path. 49/// 50/// On success, this returns a set of shell arguments, in order, that should 51/// be pre-pended to the arguments given to ripgrep at the command line. 52/// 65 66/// Parse a single ripgrep rc file from the given reader. 67///messages.rs https://github.com/BurntSushi/ripgrep.git | Rust | 74 lines
16 17/// Like message, but sets ripgrep's "errored" flag, which controls the exit 18/// status. 65 66/// Returns true if and only if ripgrep came across a non-fatal error. 67pub fn errored() -> bool { 70 71/// Indicate that ripgrep has come across a non-fatal error. 72pub fn set_errored() {bench.rs https://github.com/BurntSushi/ripgrep.git | Rust | 116 lines
1/*! 2This module benchmarks the glob implementation. For benchmarks on the ripgrep 3tool itself, see the benchsuite directory.subject.rs https://github.com/BurntSushi/ripgrep.git | Rust | 160 lines
63 // At this point, we only want to search something if it's explicitly a 64 // file. This omits symlinks. (If ripgrep was configured to follow 65 // symlinks, then they have already been followed by the directory 127 /// 128 /// However, note that ripgrep does not see through shell globbing. e.g., 129 /// in `rg foo ./some-dir/*`, `./some-dir/some-other-file` will be treatedbinary.rs https://github.com/BurntSushi/ripgrep.git | Rust | 306 lines
2 3// This file contains a smattering of tests specifically for checking ripgrep's 4// handling of binary files. There's quite a bit of discussion on this in this 4// handling of binary files. There's quite a bit of discussion on this in this 5// bug report: https://github.com/BurntSushi/ripgrep/issues/306 6 12// first 8192 bytes, which corresponds to the initial capacity of the buffer 13// that ripgrep uses to read files. (grep for DEFAULT_BUFFER_CAPACITY.) The 14// position of the NUL byte ensures that we can execute some search on the 27 28// This tests that ripgrep prints a warning message if it finds and prints a 29// match in a binary file before detecting that it is a binary file. The point 72// Like after_match1_implicit, but provides the --binary flag, which 73// disables binary filtering. Thus, this matches the behavior of ripgrep as 74// if the file were given explicitly.color.rs https://github.com/BurntSushi/ripgrep.git | Rust | 393 lines
193 194/// The set of configurable portions of ripgrep's output. 195#[derive(Clone, Debug, Eq, PartialEq)]main.rs https://github.com/BurntSushi/ripgrep.git | Rust | 325 lines
22 23// Since Rust no longer uses jemalloc by default, ripgrep will, by default, 24// use the system allocator. On Linux, this would normally be glibc's 24// use the system allocator. On Linux, this would normally be glibc's 25// allocator, which is pretty good. In particular, ripgrep does not have a 26// particularly allocation heavy workload, so there really isn't much 26// particularly allocation heavy workload, so there really isn't much 27// difference (for ripgrep's purposes) between glibc's allocator and jemalloc. 28// 28// 29// However, when ripgrep is built with musl, this means ripgrep will use musl's 30// allocator, which appears to be substantially worse. (musl's goal is not to 31// have the fastest version of everything. Its goal is to be small and amenable 32// to static compilation.) Even though ripgrep isn't particularly allocation 33// heavy, musl's allocator appears to slow down ripgrep quite a bit. Therefore,build.rs https://github.com/BurntSushi/ripgrep.git | Rust | 239 lines
23 Please file a bug: \ 24 https://github.com/BurntSushi/ripgrep/issues/new" 25 ); 30 31 let stamp_path = Path::new(&outdir).join("ripgrep-stamp"); 32 if let Err(err) = File::create(&stamp_path) { 48 if let Some(rev) = git_revision_hash() { 49 println!("cargo:rustc-env=RIPGREP_BUILD_GIT_HASH={}", rev); 50 } 161 } 162 // ripgrep only has two positional arguments, and probably will only 163 // ever have two positional arguments, so we just hardcode them intodefault_types.rs https://github.com/BurntSushi/ripgrep.git | Rust | 248 lines
1/// This list represents the default file types that ripgrep ships with. In 2/// general, any file format is fair game, although it should generally be 3/// limited to reasonably popular open formats. For other cases, you can add 4/// types to each invocation of ripgrep with the '--type-add' flag. 5/// 6/// If you would like to add or improve this list, please file a PR: 7/// https://github.com/BurntSushi/ripgrep 8///opts.rs https://github.com/kbknapp/clap-rs.git | Rust | 512 lines
26USAGE: 27 ripgrep-616 --files-without-match 28help.rs https://github.com/kbknapp/clap-rs.git | Rust | 2161 lines
184 185static RIPGREP_USAGE: &str = "ripgrep 0.5 186util.rs https://github.com/BurntSushi/ripgrep.git | Rust | 482 lines
11 12static TEST_DIR: &'static str = "ripgrep-tests"; 13static NEXT_ID: AtomicUsize = AtomicUsize::new(0); 14 15/// Setup an empty work directory and return a command pointing to the ripgrep 16/// executable whose CWD is set to the work directory. 34/// Break the given string into lines, sort them and then join them back 35/// together. This is useful for testing output from ripgrep that may not 36/// always be in the same order. 152 153 /// Creates a new command that is set to use the ripgrep executable in 154 /// this working directory. 157 /// 158 /// * Unsets the `RIPGREP_CONFIG_PATH` environment variable. 159 /// * Sets the `--path-separator` to `/` so that paths have the same outputregression.rs https://github.com/BurntSushi/ripgrep.git | Rust | 866 lines
3 4// See: https://github.com/BurntSushi/ripgrep/issues/16 5rgtest!(r16, |dir: Dir, mut cmd: TestCommand| { 15 16// See: https://github.com/BurntSushi/ripgrep/issues/25 17rgtest!(r25, |dir: Dir, mut cmd: TestCommand| { 29 30// See: https://github.com/BurntSushi/ripgrep/issues/30 31rgtest!(r30, |dir: Dir, mut cmd: TestCommand| { 38 39// See: https://github.com/BurntSushi/ripgrep/issues/49 40rgtest!(r49, |dir: Dir, mut cmd: TestCommand| { 47 48// See: https://github.com/BurntSushi/ripgrep/issues/50 49rgtest!(r50, |dir: Dir, mut cmd: TestCommand| {feature.rs https://github.com/BurntSushi/ripgrep.git | Rust | 843 lines
33 34// See: https://github.com/BurntSushi/ripgrep/issues/1 35rgtest!(f1_eucjp, |dir: Dir, mut cmd: TestCommand| { 77 78// See: https://github.com/BurntSushi/ripgrep/issues/20 79rgtest!(f20_no_filename, |dir: Dir, mut cmd: TestCommand| { 246 247// See: https://github.com/BurntSushi/ripgrep/issues/89 248rgtest!(f89_match, |dir: Dir, mut cmd: TestCommand| { 259 260// See: https://github.com/BurntSushi/ripgrep/issues/109 261rgtest!(f109_max_depth, |dir: Dir, mut cmd: TestCommand| { 331 dir.create(".ripgreprc", "--ignore-case"); 332 cmd.cmd().env("RIPGREP_CONFIG_PATH", ".ripgreprc"); 333args.rs https://github.com/BurntSushi/ripgrep.git | Rust | 1854 lines
48 49/// The command that ripgrep should execute based on the command line 50/// configuration. 57 /// The command line parameters suggest that a search should occur, but 58 /// ripgrep knows that a match can never be found (e.g., no given patterns 59 /// or --max-count=0). 87 88/// The primary configuration object used throughout ripgrep. It provides a 89/// high-level convenient interface to the provided command line arguments. 122 /// or error message. Similarly, if the user requested the version of 123 /// ripgrep, then print the version and exit. 124 /// 215 216/// High level public routines for building data structures used by ripgrep 217/// from command line arguments.app.rs https://github.com/BurntSushi/ripgrep.git | Rust | 3029 lines
1// This module defines the set of command line arguments that ripgrep supports, 2// including some light validation. 4// This module is purposely written in a bare-bones way, since it is included 5// in ripgrep's build.rs file as a way to generate a man page and completion 6// files for common shells. 7// 8// The only other place that ripgrep deals with clap is in src/args.rs, which 9// is where we read clap's configuration from the end user's arguments and turn 9// is where we read clap's configuration from the end user's arguments and turn 10// it into a ripgrep-specific configuration type that is not coupled with clap. 11 15const ABOUT: &str = " 16ripgrep (rg) recursively searches your current directory for a regex pattern. 17By default, ripgrep will respect your .gitignore and automatically skip hidden 21 22Project home page: https://github.com/BurntSushi/ripgrep 23";