Skip to content

Conversation

@bergzand
Copy link
Contributor

This adds the first steps for a laze inspect subcommand. This PR adds a laze inspect builders command to list a flat list of builders available, or with the --tree option, a full hierarchy of contexts.

Issues/PRs references

Depends on #806

Comment on lines +24 to +34
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();
})
}
Copy link
Contributor Author

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())
Copy link
Contributor Author

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 😆

Copy link
Owner

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")

@github-actions
Copy link
Contributor

github-actions bot commented Oct 22, 2025

🐰 Bencher Report

Branchpr/feat/inspect
Testbedgithub-actions
Click to view all benchmark results
Benchmarkperf:task-clockBenchmark 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%)
🐰 View full continuous benchmarking report in Bencher

@coveralls
Copy link

coveralls commented Oct 22, 2025

Coverage Status

coverage: 79.374% (-0.8%) from 80.163%
when pulling e41492b on bergzand:pr/feat/inspect
into 3d29773 on kaspar030:main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants