@@ -30,11 +30,25 @@ fn init_git_repo(path: &Path) {
3030 . current_dir ( path)
3131 . output ( )
3232 . expect ( "failed to run git init" ) ;
33- assert ! ( status. status. success( ) , "git init failed: {}" , String :: from_utf8_lossy( & status. stderr) ) ;
33+ assert ! (
34+ status. status. success( ) ,
35+ "git init failed: {}" ,
36+ String :: from_utf8_lossy( & status. stderr)
37+ ) ;
3438
3539 // Configure a dummy identity to appease git if commits ever happen; not strictly needed for staging
36- let _ =
Command :: new ( "git" ) . arg ( "config" ) . arg ( "user.email" ) . arg ( "[email protected] " ) . current_dir ( path
) . output ( ) ; 37- let _ = Command :: new ( "git" ) . arg ( "config" ) . arg ( "user.name" ) . arg ( "Test User" ) . current_dir ( path) . output ( ) ;
40+ let _ = Command :: new ( "git" )
41+ . arg ( "config" )
42+ . arg ( "user.email" )
43+ 44+ . current_dir ( path)
45+ . output ( ) ;
46+ let _ = Command :: new ( "git" )
47+ . arg ( "config" )
48+ . arg ( "user.name" )
49+ . arg ( "Test User" )
50+ . current_dir ( path)
51+ . output ( ) ;
3852}
3953
4054fn is_file_staged ( repo_root : & Path , rel_path : & str ) -> bool {
@@ -46,7 +60,11 @@ fn is_file_staged(repo_root: &Path, rel_path: &str) -> bool {
4660 . current_dir ( repo_root)
4761 . output ( )
4862 . expect ( "failed to run git diff --cached" ) ;
49- assert ! ( output. status. success( ) , "git diff failed: {}" , String :: from_utf8_lossy( & output. stderr) ) ;
63+ assert ! (
64+ output. status. success( ) ,
65+ "git diff failed: {}" ,
66+ String :: from_utf8_lossy( & output. stderr)
67+ ) ;
5068 let stdout = String :: from_utf8_lossy ( & output. stdout ) ;
5169 stdout. lines ( ) . any ( |line| line. trim ( ) == rel_path)
5270}
@@ -77,7 +95,11 @@ fn test_generate_stages_codeowners() {
7795 let run_config = build_run_config ( & temp_root, ".github/CODEOWNERS" ) ;
7896 let result = runner:: generate ( & run_config, true ) ;
7997 assert ! ( result. io_errors. is_empty( ) , "io_errors: {:?}" , result. io_errors) ;
80- assert ! ( result. validation_errors. is_empty( ) , "validation_errors: {:?}" , result. validation_errors) ;
98+ assert ! (
99+ result. validation_errors. is_empty( ) ,
100+ "validation_errors: {:?}" ,
101+ result. validation_errors
102+ ) ;
81103
82104 // Assert CODEOWNERS file exists and is staged
83105 let rel_path = ".github/CODEOWNERS" ;
@@ -99,12 +121,14 @@ fn test_generate_and_validate_stages_codeowners() {
99121 let run_config = build_run_config ( & temp_root, ".github/CODEOWNERS" ) ;
100122 let result = runner:: generate_and_validate ( & run_config, vec ! [ ] , true ) ;
101123 assert ! ( result. io_errors. is_empty( ) , "io_errors: {:?}" , result. io_errors) ;
102- assert ! ( result. validation_errors. is_empty( ) , "validation_errors: {:?}" , result. validation_errors) ;
124+ assert ! (
125+ result. validation_errors. is_empty( ) ,
126+ "validation_errors: {:?}" ,
127+ result. validation_errors
128+ ) ;
103129
104130 // Assert CODEOWNERS file exists and is staged
105131 let rel_path = ".github/CODEOWNERS" ;
106132 assert ! ( run_config. codeowners_file_path. exists( ) , "CODEOWNERS file was not created" ) ;
107133 assert ! ( is_file_staged( & run_config. project_root, rel_path) , "CODEOWNERS file was not staged" ) ;
108134}
109-
110-
0 commit comments