-
Notifications
You must be signed in to change notification settings - Fork 22
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
internal: refactor package filter #343
Conversation
crates/moonutil/src/scan.rs
Outdated
if moonbuild_opt.run_mode == crate::common::RunMode::Test { | ||
if let Some(crate::common::TestOpt { | ||
filter_package: Some(ref filter_package), | ||
.. | ||
}) = moonbuild_opt.test_opt | ||
{ | ||
let pkgs = packages | ||
.iter() | ||
.filter(|(k, _)| filter_package.contains(Path::new(k))) | ||
.map(|(_, v)| v); | ||
let package_filter = moonbuild_opt.get_package_filter(); | ||
if let Some(filter) = package_filter { | ||
let pkgs = packages.iter().filter(|(_, p)| filter(p)).map(|(_, v)| v); | ||
let mut pkg_and_its_deps = HashSet::new(); | ||
for pkg in pkgs { | ||
pkg_and_its_deps.extend(get_pkg_and_its_deps(pkg, &packages)); |
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.
maybe we could remove the filter here? to get the real all packages
Based on the provided
Overall, these changes indicate a move towards a more encapsulated and controlled access pattern to the |
Type of Pull Request