boa
boa copied to clipboard
Add code examples for `boa_interner`
The boa_interner
crate has an allow(rustdoc::missing_doc_code_examples)
on its root. Ideally, this crate should have some usage snippets on every pub
function.
Can I pick this up?
Can I pick this up?
Assigned!
Hey, currently I'm looking at how the pub
functions are being used in the boa_interner/src/tests.rs
and then documenting code examples for the same, but I see more functions that aren't being used in the tests. Any tips on how to understand and document them?
Most of the public functions have usages inside boa_interner
itself, so you could start from that. I think the only unused functions are Interner::new
and Interner::with_capacity
, for which you can adapt the examples of Vec::new
and Vec::with_capacity
.
Sounds good 👍🏾 . I'll try that and get back to you
@Joymfl , any update on this ?
I don't think this issue should be closed, since the related PR added a couple of tests, but no examples in the documentation of the interner.
I don't think this issue should be closed, since the related PR added a couple of tests, but no examples in the documentation of the interner.
Can you give me an reference, where should I add the documentation ?
@jedel1043 @Razican
Hi, Can i get any assistance on the above comment, please?
Hi @postmeback, sorry for not writing here!
I was checking the code, and in fact, the mentioned lint is unstable (https://github.com/rust-lang/rust/issues/101730). You could in theory enable it by adding #![feature(rustdoc_missing_doc_code_examples)]
and #![warn(rustdoc::missing_doc_code_examples)]
in lib.rs
in boa_interner
, and then run cargo +nightly doc
to get the relevant warnings.
This can help you get the warnings on where some usage examples need to be added in the API. boa_interner
was selected for this since its public API is small enough.
For each warning, the idea is to add some code examples in the doc comments, that show how to use it.
I followed your steps, I did not get any warnings in the boa_interner
folder.
Requesting you to provide your feedback on this. :)
I followed your steps, I did not get any warnings in the
boa_interner
folder.
Saw that you ran cargo +nightly fmt
. You would need to run cargo +nightly doc
instead to see the warnings.