Skip to main content

Source examples/update_lint_metadata.rs

1//! Generate the bundled category table from a local official HTML snapshot.2//! Usage: cargo run --example update_lint_metadata -- INPUT SELECTOR DATE OUTPUT warning: clippy::doc_markdown3#[path = "../src/diagnostic/mod.rs"]4#[allow(dead_code)]5mod diagnostic;6#[path = "../src/lint/mod.rs"]7#[allow(dead_code)]8mod lint;910fn main() -> Result<(), Box<dyn std::error::Error>> {11    let args: Vec<_> = std::env::args().skip(1).collect();12    if args.len() != 4 {13        return Err("expected INPUT SELECTOR DATE OUTPUT".into());14    }15    let bytes = std::fs::read(&args[0])?;16    let bundle = lint::metadata::Bundle {17        schema_version: 1,18        selector: args[1].clone(),19        url: format!("https://clippy.rust-lang.org/{}/index.html", args[1]),20        retrieved: args[2].clone(),21        source_hash: format!("blake3:{}", blake3::hash(&bytes).to_hex()),22        entries: lint::metadata::parse_html(&bytes)?,23    };24    std::fs::write(25        &args[3],26        format!("{}\n", serde_json::to_string_pretty(&bundle)?),27    )?;28    Ok(())29}30

Findings in this file§

warning clippy::doc_markdown §

item in documentation is missing backticks

examples/update_lint_metadata.rs:2:32

Clippy · Category: pedantic · cargo-clippy-html

Official Clippy documentation

Targets (1)
  • update_lint_metadata (example)

Primary: examples/update_lint_metadata.rs:2:32

//! Usage: cargo run --example update_lint_metadata -- INPUT SELECTOR DATE OUTPUT

help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.100.0/index.html#doc_markdown

note: `-W clippy::doc-markdown` implied by `-W clippy::pedantic`

help: to override `-W clippy::pedantic` add `#[allow(clippy::doc_markdown)]`

help: try

Suggestion: try

MachineApplicable

--- "a/examples/update_lint_metadata.rs"
+++ "b/examples/update_lint_metadata.rs"
@@ -1,5 +1,5 @@
 //! Generate the bundled category table from a local official HTML snapshot.
-//! Usage: cargo run --example update_lint_metadata -- INPUT SELECTOR DATE OUTPUT
+//! Usage: cargo run --example `update_lint_metadata` -- INPUT SELECTOR DATE OUTPUT
 #[path = "../src/diagnostic/mod.rs"]
 #[allow(dead_code)]
 mod diagnostic;
Rendered diagnostic (text)
warning: item in documentation is missing backticks
 --> examples/update_lint_metadata.rs:2:32
  |
2 | //! Usage: cargo run --example update_lint_metadata -- INPUT SELECTOR DATE OUTPUT
  |                                ^^^^^^^^^^^^^^^^^^^^
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.100.0/index.html#doc_markdown
  = note: `-W clippy::doc-markdown` implied by `-W clippy::pedantic`
  = help: to override `-W clippy::pedantic` add `#[allow(clippy::doc_markdown)]`
help: try
  |
2 - //! Usage: cargo run --example update_lint_metadata -- INPUT SELECTOR DATE OUTPUT
2 + //! Usage: cargo run --example `update_lint_metadata` -- INPUT SELECTOR DATE OUTPUT
  |