-
-
Notifications
You must be signed in to change notification settings - Fork 7
feat: add inspect for builders command #807
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
base: main
Are you sure you want to change the base?
Conversation
| fn add_tree_element(&self, context: &Context, tree: &mut TreeBuilder) { | ||
| self.contexts | ||
| .contexts | ||
| .iter() | ||
| .filter(|c| Some(context) == c.get_parent(&self.contexts)) | ||
| .for_each(|c| { | ||
| tree.begin_child(c.name.to_string()); | ||
| self.add_tree_element(c, tree); | ||
| tree.end_child(); | ||
| }) | ||
| } |
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.
This is a bit of a blunt recursive iteration over all contexts. I don't know whether it is sufficiently performant.
src/inspect.rs
Outdated
| self.contexts | ||
| .contexts | ||
| .iter() | ||
| .filter(|c| c.get_parent(&self.contexts).is_none()) |
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.
There must be a better way to get that single default context 😆
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.
There is contextbag.get_by_name("default")
|
| Branch | pr/feat/inspect |
| Testbed | github-actions |
Click to view all benchmark results
| Benchmark | perf:task-clock | Benchmark Result msec x 1e3 (Result Δ%) | Upper Boundary msec x 1e3 (Limit %) |
|---|---|---|---|
| laze -C RIOT build --global --generate-only | 📈 view plot 🚷 view threshold | 9.42 x 1e3(+0.39%)Baseline: 9.38 x 1e3 | 9.96 x 1e3 (94.62%) |
This adds the first steps for a
laze inspectsubcommand. This PR adds alaze inspect builderscommand to list a flat list of builders available, or with the--treeoption, a full hierarchy of contexts.Issues/PRs references
Depends on #806