Skip to content

Commit

Permalink
Add lint config to Cargo.toml, obey lints in build.rs
Browse files Browse the repository at this point in the history
* New Rust 1.74 feature
  • Loading branch information
acuteenvy committed Nov 16, 2023
1 parent ca1bce7 commit 1ab089c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
13 changes: 10 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ license = "MIT"
edition = "2021"
rust-version = "1.70"

[[bin]]
name = "tldr"
path = "src/main.rs"

[dependencies]
clap = { version = "4.4.7", features = ["derive"] }
dirs = "5.0.1"
Expand All @@ -27,9 +31,12 @@ clap_complete = "4.4.4"
[dev-dependencies]
assert_cmd = "2.0.12"

[[bin]]
name = "tldr"
path = "src/main.rs"
[lints.clippy]
all = "warn"
pedantic = "warn"
style = "warn"
module_name_repetitions = { level = "allow", priority = 1 }
struct_excessive_bools = { level = "allow", priority = 1 }

[profile.release]
lto = true
Expand Down
4 changes: 2 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// This build script generates completions using clap_complete and a version string.
/// This build script generates completions using `clap_complete` and a version string.
#[allow(dead_code)]
#[path = "src/args.rs"]
mod args;
Expand Down Expand Up @@ -36,7 +36,7 @@ fn commit_hash() -> Option<String> {
})
}

/// Get CARGO_PKG_VERSION and the client spec version.
/// Get `CARGO_PKG_VERSION` and the client spec version.
fn pkgver_and_spec() -> String {
format!(
"v{} (implementing the tldr client specification v{CLIENT_SPEC})",
Expand Down

0 comments on commit 1ab089c

Please sign in to comment.