fix clippy and nightly build

This commit is contained in:
extrawurst 2024-05-16 10:56:00 +02:00 committed by extrawurst
parent c57543b4f8
commit 6e12c1e974
7 changed files with 15 additions and 20 deletions

View File

@ -22,7 +22,8 @@
#![allow( #![allow(
clippy::module_name_repetitions, clippy::module_name_repetitions,
clippy::must_use_candidate, clippy::must_use_candidate,
clippy::missing_errors_doc clippy::missing_errors_doc,
clippy::empty_docs
)] )]
//TODO: //TODO:
#![allow( #![allow(

View File

@ -15,9 +15,12 @@
#![deny(clippy::panic)] #![deny(clippy::panic)]
#![deny(clippy::match_like_matches_macro)] #![deny(clippy::match_like_matches_macro)]
#![deny(clippy::needless_update)] #![deny(clippy::needless_update)]
#![allow(clippy::module_name_repetitions)] #![allow(
#![allow(clippy::must_use_candidate)] clippy::module_name_repetitions,
#![allow(clippy::missing_errors_doc)] clippy::must_use_candidate,
clippy::missing_errors_doc,
clippy::empty_docs
)]
mod error; mod error;
mod filetree; mod filetree;

View File

@ -1,24 +1,20 @@
use thiserror::Error; use thiserror::Error;
/// /// crate specific error type
#[derive(Error, Debug)] #[derive(Error, Debug)]
pub enum HooksError { pub enum HooksError {
///
#[error("git error:{0}")] #[error("git error:{0}")]
Git(#[from] git2::Error), Git(#[from] git2::Error),
///
#[error("io error:{0}")] #[error("io error:{0}")]
Io(#[from] std::io::Error), Io(#[from] std::io::Error),
///
#[error("path string conversion error")] #[error("path string conversion error")]
PathToString, PathToString,
///
#[error("shellexpand error:{0}")] #[error("shellexpand error:{0}")]
ShellExpand(#[from] shellexpand::LookupError<std::env::VarError>), ShellExpand(#[from] shellexpand::LookupError<std::env::VarError>),
} }
/// /// crate specific `Result` type
pub type Result<T> = std::result::Result<T, HooksError>; pub type Result<T> = std::result::Result<T, HooksError>;

View File

@ -46,7 +46,6 @@ pub const HOOK_PREPARE_COMMIT_MSG: &str = "prepare-commit-msg";
const HOOK_COMMIT_MSG_TEMP_FILE: &str = "COMMIT_EDITMSG"; const HOOK_COMMIT_MSG_TEMP_FILE: &str = "COMMIT_EDITMSG";
///
#[derive(Debug, PartialEq, Eq)] #[derive(Debug, PartialEq, Eq)]
pub enum HookResult { pub enum HookResult {
/// No hook found /// No hook found
@ -171,7 +170,6 @@ pub fn hooks_post_commit(
hook.run_hook(&[]) hook.run_hook(&[])
} }
///
pub enum PrepareCommitMsgSource { pub enum PrepareCommitMsgSource {
Message, Message,
Template, Template,

View File

@ -1,7 +1,7 @@
use git2::Repository; use git2::Repository;
use tempfile::TempDir; use tempfile::TempDir;
/// /// initialize test repo in temp path
pub fn repo_init_empty() -> (TempDir, Repository) { pub fn repo_init_empty() -> (TempDir, Repository) {
init_log(); init_log();
@ -18,7 +18,7 @@ pub fn repo_init_empty() -> (TempDir, Repository) {
(td, repo) (td, repo)
} }
/// /// initialize test repo in temp path with an empty first commit
pub fn repo_init() -> (TempDir, Repository) { pub fn repo_init() -> (TempDir, Repository) {
init_log(); init_log();

View File

@ -1,14 +1,12 @@
//! simple macro to insert a scope based runtime measure that logs the result //! simple macro to insert a scope based runtime measure that logs the result
#![forbid(unsafe_code)] #![forbid(unsafe_code)]
#![forbid(missing_docs)]
#![deny(unused_imports)] #![deny(unused_imports)]
#![deny(clippy::unwrap_used)] #![deny(clippy::unwrap_used)]
#![deny(clippy::perf)] #![deny(clippy::perf)]
use std::time::Instant; use std::time::Instant;
///
pub struct ScopeTimeLog<'a> { pub struct ScopeTimeLog<'a> {
title: &'a str, title: &'a str,
mod_path: &'a str, mod_path: &'a str,
@ -17,9 +15,7 @@ pub struct ScopeTimeLog<'a> {
time: Instant, time: Instant,
} }
///
impl<'a> ScopeTimeLog<'a> { impl<'a> ScopeTimeLog<'a> {
///
pub fn new( pub fn new(
mod_path: &'a str, mod_path: &'a str,
title: &'a str, title: &'a str,
@ -49,7 +45,7 @@ impl<'a> Drop for ScopeTimeLog<'a> {
} }
} }
/// /// measures runtime of scope and prints it into log
#[cfg(feature = "enabled")] #[cfg(feature = "enabled")]
#[macro_export] #[macro_export]
macro_rules! scope_time { macro_rules! scope_time {

View File

@ -19,7 +19,8 @@
#![allow( #![allow(
clippy::multiple_crate_versions, clippy::multiple_crate_versions,
clippy::bool_to_int_with_if, clippy::bool_to_int_with_if,
clippy::module_name_repetitions clippy::module_name_repetitions,
clippy::empty_docs
)] )]
//TODO: //TODO: