From c0da8acb72529fdfc156b006e9ee5d2f18f1a730 Mon Sep 17 00:00:00 2001 From: Tyler Weaver <maybe@tylerjw.dev> Date: Sat, 14 Jan 2023 11:10:40 -0700 Subject: [PATCH] Comment that lint_configuration.md is machine generated --- book/src/lint_configuration.md | 5 +++++ .../src/utils/internal_lints/metadata_collector.rs | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/book/src/lint_configuration.md b/book/src/lint_configuration.md index cfaaefe3ea1..f79dbb50ff4 100644 --- a/book/src/lint_configuration.md +++ b/book/src/lint_configuration.md @@ -1,3 +1,8 @@ +<!-- +This file is generated by `cargo collect-metadata`. +Please use that command to update the file and do not edit it by hand. +--> + ## Lint Configuration Options | <div style="width:290px">Option</div> | Default Value | |--|--| diff --git a/clippy_lints/src/utils/internal_lints/metadata_collector.rs b/clippy_lints/src/utils/internal_lints/metadata_collector.rs index 47604f6933b..1995c373835 100644 --- a/clippy_lints/src/utils/internal_lints/metadata_collector.rs +++ b/clippy_lints/src/utils/internal_lints/metadata_collector.rs @@ -239,7 +239,17 @@ impl Drop for MetadataCollector { .create(true) .open(MARKDOWN_OUTPUT_FILE) .unwrap(); - writeln!(file, "{}", self.get_markdown_docs(),).unwrap(); + writeln!( + file, + "<!-- +This file is generated by `cargo collect-metadata`. +Please use that command to update the file and do not edit it by hand. +--> + +{}", + self.get_markdown_docs(), + ) + .unwrap(); } }