]> git.lizzy.rs Git - rust.git/blobdiff - xtask/src/codegen/gen_assists_docs.rs
check style for assist docs
[rust.git] / xtask / src / codegen / gen_assists_docs.rs
index 2ca7cda63dbe421337c15b70aa703afbff9b5068..8dca2ed06e34d7d43bbca2fd6a758755d7439944 100644 (file)
@@ -52,6 +52,12 @@ fn collect_file(acc: &mut Vec<Assist>, path: &Path) -> Result<()> {
             );
 
             let doc = take_until(lines.by_ref(), "```").trim().to_string();
+            assert!(
+                doc.chars().next().unwrap().is_ascii_uppercase() && doc.ends_with("."),
+                "\n\n{}: assist docs should be proper sentences, with capitalization and a full stop at the end.\n\n{}\n\n",
+                id, doc,
+            );
+
             let before = take_until(lines.by_ref(), "```");
 
             assert_eq!(lines.next().unwrap().as_str(), "->");