diff --git a/Cargo.toml b/Cargo.toml index b15eed77..3b7aa63f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,10 @@ all = { level = "allow", priority = -2 } correctness = { level = "warn", priority = -1 } complexity = { level = "warn", priority = -1 } +[workspace.lints.rust] +missing_docs = "warn" +rust_2018_idioms = "warn" + [package] name = "mdbook" version = "0.4.52" diff --git a/examples/nop-preprocessor.rs b/examples/nop-preprocessor.rs index a384dfda..ae593afc 100644 --- a/examples/nop-preprocessor.rs +++ b/examples/nop-preprocessor.rs @@ -1,3 +1,5 @@ +//! A basic example of a preprocessor that does nothing. + use crate::nop_lib::Nop; use clap::{Arg, ArgMatches, Command}; use mdbook::book::Book; @@ -7,7 +9,7 @@ use semver::{Version, VersionReq}; use std::io; use std::process; -pub fn make_app() -> Command { +fn make_app() -> Command { Command::new("nop-preprocessor") .about("A mdbook preprocessor which does precisely nothing") .subcommand( diff --git a/examples/remove-emphasis/test.rs b/examples/remove-emphasis/test.rs index 1741712b..e29d7d0f 100644 --- a/examples/remove-emphasis/test.rs +++ b/examples/remove-emphasis/test.rs @@ -1,3 +1,5 @@ +//! A test to ensure that the remove-emphasis example works. + #[test] fn remove_emphasis_works() { // Tests that the remove-emphasis example works as expected. diff --git a/src/config.rs b/src/config.rs index 7ef8bcef..3fe16929 100644 --- a/src/config.rs +++ b/src/config.rs @@ -47,8 +47,6 @@ //! # run().unwrap() //! ``` -#![deny(missing_docs)] - use log::{debug, trace, warn}; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use std::collections::HashMap; diff --git a/src/lib.rs b/src/lib.rs index 8a8cb3c9..5f521761 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -80,9 +80,6 @@ //! [relevant chapter]: https://rust-lang.github.io/mdBook/for_developers/backends.html //! [`Config`]: config::Config -#![deny(missing_docs)] -#![deny(rust_2018_idioms)] - pub mod book; pub mod config; pub mod preprocess; diff --git a/src/main.rs b/src/main.rs index 3e576c5b..975b5a21 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,5 @@ +//! The mdbook CLI. + #[macro_use] extern crate clap; #[macro_use] diff --git a/tests/gui/runner.rs b/tests/gui/runner.rs index 3177ff4f..b8d4bacc 100644 --- a/tests/gui/runner.rs +++ b/tests/gui/runner.rs @@ -1,3 +1,9 @@ +//! The GUI test runner. +//! +//! This uses the browser-ui-test npm package to use a headless Chrome to +//! exercise the behavior of rendered books. See `CONTRIBUTING.md` for more +//! information. + use serde_json::Value; use std::collections::HashSet; use std::env::current_dir;