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

Ignore binary files #29

Closed
epage opened this issue Jul 13, 2019 · 3 comments · Fixed by #36
Closed

Ignore binary files #29

epage opened this issue Jul 13, 2019 · 3 comments · Fixed by #36
Labels
enhancement Improve the expected
Milestone

Comments

@epage
Copy link
Collaborator

epage commented Jul 13, 2019

Copy the flags from ripgrep: https://github.com/BurntSushi/ripgrep/blob/master/src/app.rs#L745

Exposed as https://github.com/BurntSushi/ripgrep/blob/master/src/args.rs#L902

@epage epage added the enhancement Improve the expected label Jul 13, 2019
@epage epage added this to the 0.1 milestone Jul 13, 2019
@epage
Copy link
Collaborator Author

epage commented Jul 14, 2019

Codespell ignores files with a null character in the first 1024 bytes
https://github.com/codespell-project/codespell/blob/master/codespell_lib/_codespell.py#L351

scspell-go first checks some know extensions
https://github.com/client9/misspell/blob/master/mime.go#L61
Otherwise, it checks for know magic numbers and falls back to mime detction
https://github.com/client9/misspell/blob/master/mime.go#L124

Both cases are unconditional.

@epage
Copy link
Collaborator Author

epage commented Jul 14, 2019

Looks like ripgrep uses null byte detection

@epage
Copy link
Collaborator Author

epage commented Jul 14, 2019

Probably going to implement this in a fast turn around way and then open an issue to speed it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improve the expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant