1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2025-06-14 22:15:13 +02:00
Commit Graph

882 Commits

Author SHA1 Message Date
a5855a5d73 couple of trivial fixes to make clippy a bit more happy (#704)
clippy: fix a few lints

The fixes are:

  * Use single quotes for single-character
  * Use ticks in documentation when necessary.
  * Just bow to clippy's wisdom.
2017-12-30 16:06:16 -05:00
03b0d832ed Update app.rs (#707)
docs: clarify --ignore-file

Fixes #684
2017-12-30 16:04:21 -05:00
636bbc7c8f Speeding CI builds 2017-12-19 08:16:31 -05:00
162e085b98 Add note about --smart-case smartness 2017-12-18 17:58:26 -05:00
86c890bcec Improve detection of upper-case characters by smart-case feature
Fixes #717 (partially)

The previous implementation of the smart-case feature was actually *too* smart,
in that it inspected the final character ranges in the AST to determine if the
pattern contained upper-case characters. This meant that patterns like `foo\w`
would not be handled case-insensitively, since `\w` includes the range of
upper-case characters A–Z.

As a medium-term solution to this problem, we now inspect the input pattern
itself for upper-case characters, ignoring any that immediately follow a `\`.
This neatly handles all of the most basic cases like `\w`, `\S`, and `É`, though
it still has problems with more complex features like `\p{Ll}`. Handling those
correctly will require improvements to the AST.
2017-12-18 17:58:26 -05:00
d775259ed9 Add armhf build to Travis CI
Fixes #676
2017-12-18 16:26:27 -05:00
d73a75d6cd Omit context separators when using a contextless option like -c or -l
Fixes #693
2017-11-29 12:55:42 -05:00
7ae1f373c2 clippy: fix warnings about useless format call and remove references that would be immediately dereferenced by the compiler. 2017-11-22 10:50:28 -05:00
4d34132365 clippy: main.rs: call Clone() on trait instead of ref-counted pointers and pass Arc<Args> by ref more often. 2017-11-22 10:50:28 -05:00
5173bfb11b clippy: docs: put more relevant things into backticks. 2017-11-22 10:50:28 -05:00
8141da9d39 clippy: string constants have static lifetime by default. 2017-11-22 10:50:28 -05:00
373e0595e6 bump bytecount to 0.2
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-11-22 09:52:47 -05:00
1374f15bdf full package name for Gentoo sys-apps/ripgrep 2017-11-22 06:58:43 -05:00
263e8f92b9 Update to memmap 0.6
`memmap` 0.6.0 introduces major API changes in anticipation of a 1.0
release. See https://github.com/danburkert/memmap-rs/releases/tag/0.6.0
for more information. CC danburkert/memmap-rs#33.
2017-11-22 06:57:15 -05:00
231698f802 switch nb to jupyter 2017-11-22 06:56:30 -05:00
3e8b44619d add notebook file extensions to types 2017-11-22 06:56:30 -05:00
679198e71a Support both [^...] and [!...] for globset class negation
Adds support for [^...] class negation in globs for parity with git, &al.

Fixes #663
2017-11-22 06:56:03 -05:00
2c84825ccb Bump Cargo.toml version in ReadMe from 0.2 to 0.3 2017-11-17 17:57:57 -05:00
948821753c Add Google Closure Templates type (.soy) 2017-11-16 07:07:56 -05:00
d2a3b61220 bump crossbeam to 0.3 2017-11-10 13:08:34 -05:00
acb57eb4ad Add Protocol Buffer file type. 2017-11-08 08:17:42 -05:00
256aeb5546 Added example for --colors to README 2017-11-03 06:46:29 -04:00
a9377da624 Support ripgrep-bin installation with linuxbrew 2017-11-01 07:11:52 -04:00
c794ef2f04 fix some typos 2017-11-01 07:10:54 -04:00
8b9eba2147 Properly match the rules "**/" and "!**/"
When processing a rule that ends in a slash, we strip it off and set the
`is_only_dir` flag.  We then apply the rule that paths that aren't
absolute should be given an implicit `**/` prefix, while avoiding
adding that prefix if it already exists.

However, this means that we miss the case in which we had already
stripped off the trailing slash and set `is_only_dir`.  Correct this
by also explicitly checking for that case.

Fixes #649
2017-11-01 07:10:33 -04:00
c4732ca012 Correct spelling mistakes in readme file. 2017-11-01 07:09:34 -04:00
1aec4b1123 update brew tap 2017-10-22 11:15:11 -04:00
c4e1945384 cargo: bump to 0.7.1 0.7.1 2017-10-22 10:33:09 -04:00
04d17040e7 changelog 0.7.1 2017-10-22 10:31:42 -04:00
8c8c83a1f8 deps: bump ignore to 0.3.1 2017-10-22 10:31:42 -04:00
5714dbde09 ignore: partially revert symlink loop check optimization
This optimization wasn't tested too carefully, and it seems to result
in a massive amount of file handles open simultaneously. This is likely
a result of the parallel iterator, where many directories are being
traversed simultaneously.

Fixes #648
2017-10-22 10:31:34 -04:00
311ccb1f6b update brew tap 2017-10-22 08:08:49 -04:00
efa4de8126 cargo: bump to 0.7.0 ignore-0.3.0 grep-0.1.7 globset-0.2.1 0.7.0 2017-10-21 22:40:10 -04:00
ad5fa56490 changelog 0.7.0 2017-10-21 22:40:10 -04:00
1bf9d29259 ignore: be fastidious with file handles
This commit fixes the symlink loop checker in the parallel directory
traverser to open fewer handles at the expense of keeping handles held
open longer.

This roughly matches the corresponding change in walkdir:
5bcc5b87ee

Fixes #633
2017-10-21 22:40:10 -04:00
2a14bf2249 printer: fix colors on empty matches
This fixes a bug where a "match" color escape was erroneously emitted
after the new line character. This is because `^` is actually allowed to
match after the end of a trailing new line, which means `^$` matches both
before and after the trailing new line when multiline mode is enabled.
The trailing match was causing the phantom escape sequence to appear,
which we don't want.

Incidentally, this is the root cause of #441 as well, although this commit
doesn't fix that issue, since the line itself is printed before we detect
the phantom match.

Fixes #599
2017-10-21 22:40:10 -04:00
f0028a66ec style 2017-10-21 22:40:10 -04:00
08060a2105 deps: update everything 2017-10-21 22:40:09 -04:00
cd575d99f8 ignore: upgrade to walkdir 2
The uninteresting bits of this commit involve mechanical changes for
updates to walkdir 2. The more interesting bits of this commit are the
breaking changes, although none of them should require any significant
change on users of this library. The breaking changes are as follows:

* `DirEntry::path_is_symbolic_link` has been renamed to
  `DirEntry::path_is_symlink`. This matches the conventions in the
  standard library, and also the corresponding name change in walkdir.
* Removed the `From<walkdir::Error> for ignore::Error` impl. This was
  intended to only be used internally, but was the only thing that
  made `walkdir` a public dependency of `ignore`. Therefore, we remove
  it since it seems unnecessary.
* Renamed `WalkBuilder::sort_by` to `WalkBuilder::sort_by_file_name`,
  and changed the type of the comparator from

    Fn(&OsString, &OsString) -> cmp::Ordering + 'static

  to

    Fn(&OsStr, &OsStr) -> cmp::Ordering + Send + Sync + 'static

  The corresponding change in `walkdir` retains the `sort_by` name, but
  gives the comparator a pair of `&DirEntry` values instead of a pair
  of `&OsStr` values. Ideally, `ignore` would hand off its own pair of
  `&ignore::DirEntry` values, but this requires more design work. So for
  now, we retain previous functionality, but leave room to make a proper
  `sort_by` method.

[breaking-change]
2017-10-21 22:40:09 -04:00
1267f01c24 deps: upgrade to memchr 2 2017-10-21 22:40:09 -04:00
322d5515e5 style: 80 cols 2017-10-21 22:40:09 -04:00
f4770c2094 Fix typos 2017-10-21 22:38:01 -04:00
f887bc1f86 printer: --only-matching works with --replace
When -o/--only-matching is used with -r/--replace, the replacement works
as expected. This is not a breaking change because the flags were
previously set to conflict.
2017-10-20 20:58:27 -04:00
363a4fa9b7 Fix path passed to try_create_bytes() 2017-10-20 20:51:12 -04:00
712311fdc6 Don't create command until we know we can test it
For regression 210 we may not actually need to test anything if the file
system doesn't support creating files with invalid UTF-8 bytes. Don't
create the command until we know there will be an assertion.
2017-10-20 20:51:12 -04:00
0d2354aca6 Wrap comments to 79 columns 2017-10-20 20:51:12 -04:00
8dc513b5d2 Skip regression 210 test on APFS
APFS does not support creating filenames with invalid UTF-8 byte codes,
thus this test doesn't make sense. Skip it on file systems where this
shouldn't be possible.

Fixes #559
2017-10-20 20:51:12 -04:00
a98156e71c Fix minor typos
Update name Mac OS X to macOS
2017-10-14 07:02:03 -04:00
cf94072429 State the default case sensitivity 2017-10-12 20:02:33 -04:00
db14046de4 Add purescript to built-in types
Purescript is a functional language that compiles to javascript (https://github.com/purescript/purescript)
2017-10-12 20:02:25 -04:00