RS.CLIPPY.DOC_MARKDOWN
Presence of `_`, `::` or camel-case outside backticks in documentation
What it does
Checks for the presence of _, :: or camel-case words
outside ticks in documentation.
Why is this bad?
Rustdoc supports markdown formatting, _, :: and
camel-case probably indicates some code which should be included between
ticks. _ can also be used for emphasis in markdown, this lint tries to
consider that.
Known problems
Lots of bad docs won't be fixed, what the lint checks for is limited, and there are still false positives. HTML elements and their content are not linted.
In addition, when writing documentation comments, including [] brackets
inside a link text would trip the parser. Therefore, documenting link with
[SmallVec<[T; INLINE_CAPACITY]>] and then [SmallVec<[T; INLINE_CAPACITY]>]: SmallVec
would fail.
Examples
/// Do something with the foo_bar parameter. See also
/// that::other::module::foo.
// ^ `foo_bar` and `that::other::module::foo` should be ticked.
fn doit(foo_bar: usize) {}
// Link text with `[]` brackets should be written as following:
/// Consume the array and return the inner
/// [`SmallVec<[T; INLINE_CAPACITY]>`][SmallVec].
/// [SmallVec]: SmallVec
fn main() {}
Configuration
doc-valid-idents: The list of words this lint should not consider as identifiers needing ticks. The value".."can be used as part of the list to indicate, that the configured values should be appended to the default configuration of Clippy. By default, any configuration will replace the default value. For example:
-
doc-valid-idents = ["ClipPy"]would replace the default list with["ClipPy"]. -
doc-valid-idents = ["ClipPy", ".."]would appendClipPyto the default list.(default:
["KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "MHz", "GHz", "THz", "AccessKit", "CoAP", "CoreFoundation", "CoreGraphics", "CoreText", "DevOps", "Direct2D", "Direct3D", "DirectWrite", "DirectX", "ECMAScript", "GPLv2", "GPLv3", "GitHub", "GitLab", "IPv4", "IPv6", "ClojureScript", "CoffeeScript", "JavaScript", "PostScript", "PureScript", "TypeScript", "WebAssembly", "NaN", "NaNs", "OAuth", "GraphQL", "OCaml", "OpenAL", "OpenDNS", "OpenGL", "OpenMP", "OpenSSH", "OpenSSL", "OpenStreetMap", "OpenTelemetry", "OpenType", "WebGL", "WebGL2", "WebGPU", "WebRTC", "WebSocket", "WebTransport", "WebP", "OpenExr", "YCbCr", "sRGB", "TensorFlow", "TrueType", "iOS", "macOS", "FreeBSD", "NetBSD", "OpenBSD", "TeX", "LaTeX", "BibTeX", "BibLaTeX", "MinGW", "CamelCase"])