-
Notifications
You must be signed in to change notification settings - Fork 25
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 empty filename case #204
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #204 +/- ##
==========================================
- Coverage 62.37% 62.36% -0.02%
==========================================
Files 32 32
Lines 5292 5301 +9
==========================================
+ Hits 3301 3306 +5
- Misses 1991 1995 +4 ☔ View full report in Codecov by Sentry. |
let filename = if let Some(cl_filename) = cluster.file_name() { | ||
cl_filename.to_str().unwrap() | ||
} else { | ||
cluster.to_str().unwrap() |
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.
why should we use full path here?
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.
If the filename is empty it means that it ends with '.' or is '/' and we couldn't canonicalize it. Then we have no other options besides using this path as is.
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.
If the filename is empty it means that it ends with '.' or is '/' and we couldn't canonicalize it. Then we have no other options besides using this path as is.
Could you provide some use cases, when and why this situation happens?
It seems to me, that this code filter directories.
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.
The case is when casr-cli is called with an argument of directory name, and that directory contains raw casreps. For example, if casreps are located in root directory (a poked-out case, but still), or in cwd '.' and we couldn't canonicalize it for some reason. The bug was detected when calling casr-cli on cwd with raw reports.
This code adds directory to clusters if it contains raw reports.
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.
Can we add a comment in code stating this?
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.
Done
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.
Just needs some comments and ready to merge
No description provided.