Is it possible to run clippy on code in rustdoc examples

It is possible (and useful) to run clippy with --tests, --examples and --all-targets but from testing none of those lint the code in rustdoc examples.

Is it possible to run clippy on code in rustdoc examples?

No, AFAIK this is impossible, see this issue:

I agree that it would be great if clippy and rustfmt would apply to doctests as well.

Thanks for that link. There is a script at the end of that thread that does what I need with cargo +nightly: cargo-rustdoc-clippy.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.