-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Update directory walking to be multithreaded #33
base: main
Are you sure you want to change the base?
Conversation
let entries = jwalk::WalkDir::new(root.clone()).process_read_dir(|_, _, _, children| { | ||
children.iter_mut().for_each(|dir_entry_result| { | ||
if let Ok(dir_entry) = dir_entry_result { | ||
if dir_entry.path().starts_with(".") || dir_entry.file_name.eq_ignore_ascii_case("node_modules") { |
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.
we shouldn't ignore node_modules, while usually it does not contain PHP code, it could.
people using node alongside PHP should manually add this to their exclude directory.
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.
What do you mean it could?
for entry in entries { | ||
if let Err(_) = entry { | ||
continue; | ||
} |
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.
we should return the error here instead of ignoring it, if the directory is not readable for example, it should be excluded.
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.
What do you suggest? I wouldn't stop the loop, I would just log the error to the user
Co-authored-by: Saif Eddin Gmati <[email protected]>
Hello,
I try to test most cases and it seems that the behaviour is the same or even improved. For example in the excludes now both
**/vendor/composer/*
andvendor/composer/*
works.Regarding the dir walking:
.
and node_modules folders. This folder it's something new but I can't really think of a reason why we shouldn't ignore it, it's pretty common, has a huge amount of dirs and files, and it's not PHP.I am fairly new rust so hopefully this looks good enough