-
Notifications
You must be signed in to change notification settings - Fork 254
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
Broken ignored doctest in subxt macro output. #826
Comments
These docs come straight from the node/pallet code on which the I wouldn't want to have to try and parse/alter the generated docs for such things as that is likely to be brittle/arduous, so I wonder if there is a global annotation to ignore doctests in a module; they basically shouldn't be ran at all, ever, from generated code. |
This thread has some thoughts: https://users.rust-lang.org/t/disabling-rustdoc-tests-for-module/50110/5 Looking at this I realise that the failing doc test is annotated with |
AFAIUI " |
Alas, we can't control the docs anyway, so ultimately I think we need to focus on managing how they are treated on our side. Doc comments aren't useful if you use the macro directly (at least in my IDE via rust analyser) but are perhaps useful in IDEs if you codegen (we actually added them in response to an older issue here: #503). Potentially we could provide an attribtue to allow you to decide whether to generate docs or not. Otherwise I wonder what |
Yep, I like that idea better than parsing the docs and replacing links and all their variations. We could temporarily disable the #[allow(rustdoc::broken_intra_doc_links)]
// mod expanded by subxt macro
pub mod polkadot {...
}
#[warn(rustdoc::broken_intra_doc_links)] Tho that would be a bit opinionated as it may override whatever the user decided for that file. |
I'm not sure how Offhand I didn't find any useful attrs myself so I'd guess that allowing people to opt-in (or opt-out but I'm guessing opt-in is a good default) to docs is a decent way to go! |
Per #843, we'll no longer generate docs in the subxt macro by default, and for codegen you'll be able to opt out of docs. |
I have this code
which expands into almost 7k lines of code, among which is this doctest which does not even compile
If this is supposed to be pseudocode, then it should not be marked as
rust
(but as "```pseudo code" or something instead (which will make rustdoc ignore it)), and if this is supposed to be rust code, then it should include enough code to pass compilation.The text was updated successfully, but these errors were encountered: