[K9VULN-11396] do not panic when reading gitignore#808
[K9VULN-11396] do not panic when reading gitignore#808gh-worker-dd-mergequeue-cf854d[bot] merged 4 commits intomainfrom
Conversation
|
🎯 Code Coverage 🔗 Commit SHA: 0ab949c | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
jasonforal
left a comment
There was a problem hiding this comment.
In addition to the suggested change, you should bring back the analyzer/git hook changes you made that removed .expect, e.g.
In favor of anyhow's context conversion like
.context("error when reading gitignore file")?; | let lines = reader | ||
| .lines() | ||
| .map(String::from) | ||
| .map_while(Result::ok) |
There was a problem hiding this comment.
Should be flatten() (or filter_map(Result::ok) if you prefer that style) so we just discard the offending lines. map_while will halt iteration at that point, leading to a half-parsed file
There was a problem hiding this comment.
.flatten() is rejected by rust-clippy, I used the map_while because of the recommendation.
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
What problem are you trying to solve?
Do not panic when there are non-utf8 characters in the
.gitignorefileWhat is your solution?
Print an error message