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 22
22
#![ allow(
23
23
clippy:: module_name_repetitions,
24
24
clippy:: must_use_candidate,
25
- clippy:: missing_errors_doc
25
+ clippy:: missing_errors_doc,
26
+ clippy:: empty_docs
26
27
) ]
27
28
//TODO:
28
29
#![ allow(
Original file line number Diff line number Diff line change 15
15
#![ deny( clippy:: panic) ]
16
16
#![ deny( clippy:: match_like_matches_macro) ]
17
17
#![ 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
+ ) ]
21
24
22
25
mod error;
23
26
mod filetree;
Original file line number Diff line number Diff line change 1
1
use thiserror:: Error ;
2
2
3
- ///
3
+ /// crate specific error type
4
4
#[ derive( Error , Debug ) ]
5
5
pub enum HooksError {
6
- ///
7
6
#[ error( "git error:{0}" ) ]
8
7
Git ( #[ from] git2:: Error ) ,
9
8
10
- ///
11
9
#[ error( "io error:{0}" ) ]
12
10
Io ( #[ from] std:: io:: Error ) ,
13
11
14
- ///
15
12
#[ error( "path string conversion error" ) ]
16
13
PathToString ,
17
14
18
- ///
19
15
#[ error( "shellexpand error:{0}" ) ]
20
16
ShellExpand ( #[ from] shellexpand:: LookupError < std:: env:: VarError > ) ,
21
17
}
22
18
23
- ///
19
+ /// crate specific `Result` type
24
20
pub 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";
46
46
47
47
const HOOK_COMMIT_MSG_TEMP_FILE : & str = "COMMIT_EDITMSG" ;
48
48
49
- ///
50
49
#[ derive( Debug , PartialEq , Eq ) ]
51
50
pub enum HookResult {
52
51
/// No hook found
@@ -171,7 +170,6 @@ pub fn hooks_post_commit(
171
170
hook. run_hook ( & [ ] )
172
171
}
173
172
174
- ///
175
173
pub enum PrepareCommitMsgSource {
176
174
Message ,
177
175
Template ,
Original file line number Diff line number Diff line change 1
1
use git2:: Repository ;
2
2
use tempfile:: TempDir ;
3
3
4
- ///
4
+ /// initialize test repo in temp path
5
5
pub fn repo_init_empty ( ) -> ( TempDir , Repository ) {
6
6
init_log ( ) ;
7
7
@@ -18,7 +18,7 @@ pub fn repo_init_empty() -> (TempDir, Repository) {
18
18
( td, repo)
19
19
}
20
20
21
- ///
21
+ /// initialize test repo in temp path with an empty first commit
22
22
pub fn repo_init ( ) -> ( TempDir , Repository ) {
23
23
init_log ( ) ;
24
24
Original file line number Diff line number Diff line change 1
1
//! simple macro to insert a scope based runtime measure that logs the result
2
2
3
3
#![ forbid( unsafe_code) ]
4
- #![ forbid( missing_docs) ]
5
4
#![ deny( unused_imports) ]
6
5
#![ deny( clippy:: unwrap_used) ]
7
6
#![ deny( clippy:: perf) ]
8
7
9
8
use std:: time:: Instant ;
10
9
11
- ///
12
10
pub struct ScopeTimeLog < ' a > {
13
11
title : & ' a str ,
14
12
mod_path : & ' a str ,
@@ -17,9 +15,7 @@ pub struct ScopeTimeLog<'a> {
17
15
time : Instant ,
18
16
}
19
17
20
- ///
21
18
impl < ' a > ScopeTimeLog < ' a > {
22
- ///
23
19
pub fn new (
24
20
mod_path : & ' a str ,
25
21
title : & ' a str ,
@@ -49,7 +45,7 @@ impl<'a> Drop for ScopeTimeLog<'a> {
49
45
}
50
46
}
51
47
52
- ///
48
+ /// measures runtime of scope and prints it into log
53
49
#[ cfg( feature = "enabled" ) ]
54
50
#[ macro_export]
55
51
macro_rules! scope_time {
Original file line number Diff line number Diff line change 19
19
#![ allow(
20
20
clippy:: multiple_crate_versions,
21
21
clippy:: bool_to_int_with_if,
22
- clippy:: module_name_repetitions
22
+ clippy:: module_name_repetitions,
23
+ clippy:: empty_docs
23
24
) ]
24
25
25
26
//TODO:
You can’t perform that action at this time.
0 commit comments