Move the lints to the Cargo workspace level and fix any issues.

This commit is contained in:
Bauke 2024-01-17 18:10:25 +01:00
parent 6512eaac5a
commit 3da03abe16
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
4 changed files with 10 additions and 6 deletions

View File

@ -4,3 +4,10 @@ members = [
"hooked-config"
]
resolver = "2"
[workspace.lints.clippy]
missing_docs_in_private_items = "warn"
[workspace.lints.rust]
missing_docs = "warn"
unsafe_code = "forbid"

View File

@ -31,7 +31,7 @@ pub fn hooked_cli_reference(
for command_name in commands_to_document {
let output = Command::new("cargo")
.env("NO_COLOR", "1")
.args(&["run", "-q", "--", command_name, "--help"])
.args(["run", "-q", "--", command_name, "--help"])
.output()
.unwrap();
let usage = str::from_utf8(&output.stdout).unwrap().trim().to_string();
@ -44,7 +44,7 @@ pub fn hooked_cli_reference(
let mut context = Context::new();
context.insert("commands", &commands);
write(
&out_path,
out_path,
Tera::one_off(REFERENCE_TEMPLATE, &context, false)?,
)?;

View File

@ -2,9 +2,6 @@
//!
//! > **Git hooks manager.**
#![forbid(unsafe_code)]
#![warn(missing_docs, clippy::missing_docs_in_private_items)]
use {
clap::Parser,
color_eyre::{install, Result},

View File

@ -20,7 +20,7 @@ pub fn plural(count: usize, singular: &str, plural: Option<&str>) -> String {
pub fn globset_from_strings(input: &[String]) -> Result<GlobSet> {
let mut builder = GlobSetBuilder::new();
for glob in input {
builder.add(Glob::new(&glob)?);
builder.add(Glob::new(glob)?);
}
builder.build().map_err(Into::into)