-
Notifications
You must be signed in to change notification settings - Fork 508
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
🐛 Fix .lib false positives in binary artifacts #1879
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1879 +/- ##
==========================================
+ Coverage 51.42% 54.47% +3.05%
==========================================
Files 79 79
Lines 6693 6709 +16
==========================================
+ Hits 3442 3655 +213
+ Misses 3024 2820 -204
- Partials 227 234 +7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
47dc22d
to
c95a257
Compare
98dbc29
to
ef246fc
Compare
Integration tests success for |
Integration tests success for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do the sanity test iff exists1 == false
. I would trust the magic number inference more than the character search logic we have here and we can fallback to it if the magic number inference fails.
if exists1 {
// Binary file
}
if !isText(content) && exists2 {
// Binary file
}
As a follow up, we could consider using common parsers (like Makefile, YAML, JSON etc.) to check whether the file has text content. Basically, if any parsers are able to successfully parse the file we can safely infer that the file is text only.
done. |
Integration tests success for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Fix .lib false positives in binary artifacts
no breaking changes
closes #1868