Move common lint controls to Cargo.toml

This moves lint overrides to Cargo.toml so that they can more easily be
shared across crates.
This commit is contained in:
Eric Huss 2025-07-21 10:14:25 -07:00
parent 702c676107
commit 5264074c1b
7 changed files with 17 additions and 6 deletions

View file

@ -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"

View file

@ -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(

View file

@ -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.

View file

@ -47,8 +47,6 @@
//! # run().unwrap()
//! ```
#![deny(missing_docs)]
use log::{debug, trace, warn};
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use std::collections::HashMap;

View file

@ -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;

View file

@ -1,3 +1,5 @@
//! The mdbook CLI.
#[macro_use]
extern crate clap;
#[macro_use]

View file

@ -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;