Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't truncate file before detecting language (#740)
Currently, we truncate a file's contents to 2048 bytes before passing it to `go-enry`. I ran into a few cases where this is causing us to misclassify files. This PR removes the truncation. It should still be fine in terms of performance, since `go-enry` is quite fast in general: ~1ms in my local testing, even for large files. And we only run language detection if we plan to index the file, which means we skip binary files and large files.
- Loading branch information