-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): Ignore (do not abort on) non-utf8 files when walking recurs…
…ively Previously a hard error, but safest bet seems to ignore. Ripgrep handles binary data with NUL byte detection, which does not seem necessary here Closes #166
- Loading branch information
Showing
14 changed files
with
182 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# DO NOT save this file in an editor: it will overwrite the invalid file marker with a | ||
# literal �, which is valid utf-8 | ||
invalid utf8 � |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# DO NOT save this file in an editor: it will overwrite the invalid file marker with a | ||
# literal �, which is valid utf-8 | ||
invalid utf8 � |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
valid utf8 | ||
unique string for precise searching: 0a1a09c8-2995-4ac5-9d60-01a0f02920e8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# DO NOT save this file in an editor: it will overwrite the invalid file marker with a | ||
# literal �, which is valid utf-8 | ||
invalid utf8 � |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# DO NOT save this file in an editor: it will overwrite the invalid file marker with a | ||
# literal �, which is valid utf-8 | ||
invalid utf8 � |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
valid utf8 | ||
unique string for precise searching: gone |
19 changes: 19 additions & 0 deletions
19
tests/snapshots/cli__tests__binary-data-sorted-dry-run-linux.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
source: tests/cli.rs | ||
expression: "CommandSnap\n{\n args, stdin: None, stdout:\n stdout.split_inclusive('\\n').map(ToOwned::to_owned).collect_vec(),\n exit_code,\n}" | ||
info: | ||
stderr: [] | ||
--- | ||
args: | ||
- "--sorted" | ||
- "--glob" | ||
- "**/*" | ||
- 0a1a09c8-2995-4ac5-9d60-01a0f02920e8 | ||
- gone | ||
stdin: ~ | ||
stdout: | ||
- "subdir/valid-utf8\n" | ||
- "2:unique string for precise searching: 0a1a09c8-2995-4ac5-9d60-01a0f02920e8\n" | ||
- "2:unique string for precise searching: gone\n" | ||
- "\n" | ||
exit_code: 0 |
19 changes: 19 additions & 0 deletions
19
tests/snapshots/cli__tests__binary-data-sorted-dry-run-macos.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
source: tests/cli.rs | ||
expression: "CommandSnap\n{\n args, stdin: None, stdout:\n stdout.split_inclusive('\\n').map(ToOwned::to_owned).collect_vec(),\n exit_code,\n}" | ||
info: | ||
stderr: [] | ||
--- | ||
args: | ||
- "--sorted" | ||
- "--glob" | ||
- "**/*" | ||
- 0a1a09c8-2995-4ac5-9d60-01a0f02920e8 | ||
- gone | ||
stdin: ~ | ||
stdout: | ||
- "subdir/valid-utf8\n" | ||
- "2:unique string for precise searching: 0a1a09c8-2995-4ac5-9d60-01a0f02920e8\n" | ||
- "2:unique string for precise searching: gone\n" | ||
- "\n" | ||
exit_code: 0 |
19 changes: 19 additions & 0 deletions
19
tests/snapshots/cli__tests__binary-data-sorted-dry-run-windows.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
source: tests/cli.rs | ||
expression: "CommandSnap\n{\n args, stdin: None, stdout:\n stdout.split_inclusive('\\n').map(ToOwned::to_owned).collect_vec(),\n exit_code,\n}" | ||
info: | ||
stderr: [] | ||
--- | ||
args: | ||
- "--sorted" | ||
- "--glob" | ||
- "**/*" | ||
- 0a1a09c8-2995-4ac5-9d60-01a0f02920e8 | ||
- gone | ||
stdin: ~ | ||
stdout: | ||
- "subdir\\valid-utf8\n" | ||
- "2:unique string for precise searching: 0a1a09c8-2995-4ac5-9d60-01a0f02920e8\n" | ||
- "2:unique string for precise searching: gone\n" | ||
- "\n" | ||
exit_code: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
source: tests/cli.rs | ||
expression: "CommandSnap\n{\n args, stdin: None, stdout:\n stdout.split_inclusive('\\n').map(ToOwned::to_owned).collect_vec(),\n exit_code,\n}" | ||
info: | ||
stderr: [] | ||
--- | ||
args: | ||
- "--sorted" | ||
- "--glob" | ||
- "**/*" | ||
- 0a1a09c8-2995-4ac5-9d60-01a0f02920e8 | ||
- gone | ||
stdin: ~ | ||
stdout: | ||
- "subdir/valid-utf8\n" | ||
exit_code: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
source: tests/cli.rs | ||
expression: "CommandSnap\n{\n args, stdin: None, stdout:\n stdout.split_inclusive('\\n').map(ToOwned::to_owned).collect_vec(),\n exit_code,\n}" | ||
info: | ||
stderr: [] | ||
--- | ||
args: | ||
- "--sorted" | ||
- "--glob" | ||
- "**/*" | ||
- 0a1a09c8-2995-4ac5-9d60-01a0f02920e8 | ||
- gone | ||
stdin: ~ | ||
stdout: | ||
- "subdir/valid-utf8\n" | ||
exit_code: 0 |
16 changes: 16 additions & 0 deletions
16
tests/snapshots/cli__tests__binary-data-sorted-windows.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
source: tests/cli.rs | ||
expression: "CommandSnap\n{\n args, stdin: None, stdout:\n stdout.split_inclusive('\\n').map(ToOwned::to_owned).collect_vec(),\n exit_code,\n}" | ||
info: | ||
stderr: [] | ||
--- | ||
args: | ||
- "--sorted" | ||
- "--glob" | ||
- "**/*" | ||
- 0a1a09c8-2995-4ac5-9d60-01a0f02920e8 | ||
- gone | ||
stdin: ~ | ||
stdout: | ||
- "subdir\\valid-utf8\n" | ||
exit_code: 0 |