File tree Expand file tree Collapse file tree 7 files changed +15
-20
lines changed
Expand file tree Collapse file tree 7 files changed +15
-20
lines changed Original file line number Diff line number Diff line change 2222#![ allow(
2323 clippy:: module_name_repetitions,
2424 clippy:: must_use_candidate,
25- clippy:: missing_errors_doc
25+ clippy:: missing_errors_doc,
26+ clippy:: empty_docs
2627) ]
2728//TODO:
2829#![ allow(
Original file line number Diff line number Diff line change 1515#![ deny( clippy:: panic) ]
1616#![ deny( clippy:: match_like_matches_macro) ]
1717#![ deny( clippy:: needless_update) ]
18- #![ allow( clippy:: module_name_repetitions) ]
19- #![ allow( clippy:: must_use_candidate) ]
20- #![ allow( clippy:: missing_errors_doc) ]
18+ #![ allow(
19+ clippy:: module_name_repetitions,
20+ clippy:: must_use_candidate,
21+ clippy:: missing_errors_doc,
22+ clippy:: empty_docs
23+ ) ]
2124
2225mod error;
2326mod filetree;
Original file line number Diff line number Diff line change 11use thiserror:: Error ;
22
3- ///
3+ /// crate specific error type
44#[ derive( Error , Debug ) ]
55pub enum HooksError {
6- ///
76 #[ error( "git error:{0}" ) ]
87 Git ( #[ from] git2:: Error ) ,
98
10- ///
119 #[ error( "io error:{0}" ) ]
1210 Io ( #[ from] std:: io:: Error ) ,
1311
14- ///
1512 #[ error( "path string conversion error" ) ]
1613 PathToString ,
1714
18- ///
1915 #[ error( "shellexpand error:{0}" ) ]
2016 ShellExpand ( #[ from] shellexpand:: LookupError < std:: env:: VarError > ) ,
2117}
2218
23- ///
19+ /// crate specific `Result` type
2420pub type Result < T > = std:: result:: Result < T , HooksError > ;
Original file line number Diff line number Diff line change @@ -46,7 +46,6 @@ pub const HOOK_PREPARE_COMMIT_MSG: &str = "prepare-commit-msg";
4646
4747const HOOK_COMMIT_MSG_TEMP_FILE : & str = "COMMIT_EDITMSG" ;
4848
49- ///
5049#[ derive( Debug , PartialEq , Eq ) ]
5150pub enum HookResult {
5251 /// No hook found
@@ -171,7 +170,6 @@ pub fn hooks_post_commit(
171170 hook. run_hook ( & [ ] )
172171}
173172
174- ///
175173pub enum PrepareCommitMsgSource {
176174 Message ,
177175 Template ,
Original file line number Diff line number Diff line change 11use git2:: Repository ;
22use tempfile:: TempDir ;
33
4- ///
4+ /// initialize test repo in temp path
55pub fn repo_init_empty ( ) -> ( TempDir , Repository ) {
66 init_log ( ) ;
77
@@ -18,7 +18,7 @@ pub fn repo_init_empty() -> (TempDir, Repository) {
1818 ( td, repo)
1919}
2020
21- ///
21+ /// initialize test repo in temp path with an empty first commit
2222pub fn repo_init ( ) -> ( TempDir , Repository ) {
2323 init_log ( ) ;
2424
Original file line number Diff line number Diff line change 11//! simple macro to insert a scope based runtime measure that logs the result
22
33#![ forbid( unsafe_code) ]
4- #![ forbid( missing_docs) ]
54#![ deny( unused_imports) ]
65#![ deny( clippy:: unwrap_used) ]
76#![ deny( clippy:: perf) ]
87
98use std:: time:: Instant ;
109
11- ///
1210pub struct ScopeTimeLog < ' a > {
1311 title : & ' a str ,
1412 mod_path : & ' a str ,
@@ -17,9 +15,7 @@ pub struct ScopeTimeLog<'a> {
1715 time : Instant ,
1816}
1917
20- ///
2118impl < ' a > ScopeTimeLog < ' a > {
22- ///
2319 pub fn new (
2420 mod_path : & ' a str ,
2521 title : & ' a str ,
@@ -49,7 +45,7 @@ impl<'a> Drop for ScopeTimeLog<'a> {
4945 }
5046}
5147
52- ///
48+ /// measures runtime of scope and prints it into log
5349#[ cfg( feature = "enabled" ) ]
5450#[ macro_export]
5551macro_rules! scope_time {
Original file line number Diff line number Diff line change 1919#![ allow(
2020 clippy:: multiple_crate_versions,
2121 clippy:: bool_to_int_with_if,
22- clippy:: module_name_repetitions
22+ clippy:: module_name_repetitions,
23+ clippy:: empty_docs
2324) ]
2425
2526//TODO:
You can’t perform that action at this time.
0 commit comments