Move the lints to the Cargo workspace level and fix any issues.
This commit is contained in:
parent
6512eaac5a
commit
3da03abe16
|
@ -4,3 +4,10 @@ members = [
|
||||||
"hooked-config"
|
"hooked-config"
|
||||||
]
|
]
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
|
||||||
|
[workspace.lints.clippy]
|
||||||
|
missing_docs_in_private_items = "warn"
|
||||||
|
|
||||||
|
[workspace.lints.rust]
|
||||||
|
missing_docs = "warn"
|
||||||
|
unsafe_code = "forbid"
|
||||||
|
|
|
@ -31,7 +31,7 @@ pub fn hooked_cli_reference(
|
||||||
for command_name in commands_to_document {
|
for command_name in commands_to_document {
|
||||||
let output = Command::new("cargo")
|
let output = Command::new("cargo")
|
||||||
.env("NO_COLOR", "1")
|
.env("NO_COLOR", "1")
|
||||||
.args(&["run", "-q", "--", command_name, "--help"])
|
.args(["run", "-q", "--", command_name, "--help"])
|
||||||
.output()
|
.output()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let usage = str::from_utf8(&output.stdout).unwrap().trim().to_string();
|
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();
|
let mut context = Context::new();
|
||||||
context.insert("commands", &commands);
|
context.insert("commands", &commands);
|
||||||
write(
|
write(
|
||||||
&out_path,
|
out_path,
|
||||||
Tera::one_off(REFERENCE_TEMPLATE, &context, false)?,
|
Tera::one_off(REFERENCE_TEMPLATE, &context, false)?,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,6 @@
|
||||||
//!
|
//!
|
||||||
//! > **Git hooks manager.**
|
//! > **Git hooks manager.**
|
||||||
|
|
||||||
#![forbid(unsafe_code)]
|
|
||||||
#![warn(missing_docs, clippy::missing_docs_in_private_items)]
|
|
||||||
|
|
||||||
use {
|
use {
|
||||||
clap::Parser,
|
clap::Parser,
|
||||||
color_eyre::{install, Result},
|
color_eyre::{install, Result},
|
||||||
|
|
|
@ -20,7 +20,7 @@ pub fn plural(count: usize, singular: &str, plural: Option<&str>) -> String {
|
||||||
pub fn globset_from_strings(input: &[String]) -> Result<GlobSet> {
|
pub fn globset_from_strings(input: &[String]) -> Result<GlobSet> {
|
||||||
let mut builder = GlobSetBuilder::new();
|
let mut builder = GlobSetBuilder::new();
|
||||||
for glob in input {
|
for glob in input {
|
||||||
builder.add(Glob::new(&glob)?);
|
builder.add(Glob::new(glob)?);
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.build().map_err(Into::into)
|
builder.build().map_err(Into::into)
|
||||||
|
|
Loading…
Reference in New Issue