Skip to content

Commit 5264074

Browse files
committed
Move common lint controls to Cargo.toml
This moves lint overrides to Cargo.toml so that they can more easily be shared across crates.
1 parent 702c676 commit 5264074

File tree

7 files changed

+17
-6
lines changed

7 files changed

+17
-6
lines changed

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ all = { level = "allow", priority = -2 }
66
correctness = { level = "warn", priority = -1 }
77
complexity = { level = "warn", priority = -1 }
88

9+
[workspace.lints.rust]
10+
missing_docs = "warn"
11+
rust_2018_idioms = "warn"
12+
913
[package]
1014
name = "mdbook"
1115
version = "0.4.52"

examples/nop-preprocessor.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! A basic example of a preprocessor that does nothing.
2+
13
use crate::nop_lib::Nop;
24
use clap::{Arg, ArgMatches, Command};
35
use mdbook::book::Book;
@@ -7,7 +9,7 @@ use semver::{Version, VersionReq};
79
use std::io;
810
use std::process;
911

10-
pub fn make_app() -> Command {
12+
fn make_app() -> Command {
1113
Command::new("nop-preprocessor")
1214
.about("A mdbook preprocessor which does precisely nothing")
1315
.subcommand(

examples/remove-emphasis/test.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! A test to ensure that the remove-emphasis example works.
2+
13
#[test]
24
fn remove_emphasis_works() {
35
// Tests that the remove-emphasis example works as expected.

src/config.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@
4747
//! # run().unwrap()
4848
//! ```
4949
50-
#![deny(missing_docs)]
51-
5250
use log::{debug, trace, warn};
5351
use serde::{Deserialize, Deserializer, Serialize, Serializer};
5452
use std::collections::HashMap;

src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@
8080
//! [relevant chapter]: https://rust-lang.github.io/mdBook/for_developers/backends.html
8181
//! [`Config`]: config::Config
8282
83-
#![deny(missing_docs)]
84-
#![deny(rust_2018_idioms)]
85-
8683
pub mod book;
8784
pub mod config;
8885
pub mod preprocess;

src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! The mdbook CLI.
2+
13
#[macro_use]
24
extern crate clap;
35
#[macro_use]

tests/gui/runner.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
//! The GUI test runner.
2+
//!
3+
//! This uses the browser-ui-test npm package to use a headless Chrome to
4+
//! exercise the behavior of rendered books. See `CONTRIBUTING.md` for more
5+
//! information.
6+
17
use serde_json::Value;
28
use std::collections::HashSet;
39
use std::env::current_dir;

0 commit comments

Comments
 (0)