@@ -372,9 +372,7 @@ fn main() -> Result<()> {
372372 merge_base,
373373 } => {
374374 let base_ref = match ( & base, & merge_base) {
375- ( Some ( _) , _) | ( _, Some ( _) ) => {
376- Some ( resolve_base ( & root, base, merge_base) ?)
377- }
375+ ( Some ( _) , _) | ( _, Some ( _) ) => Some ( resolve_base ( & root, base, merge_base) ?) ,
378376 _ => None ,
379377 } ;
380378 cmd_graph ( & root, dot, base_ref. as_deref ( ) )
@@ -388,19 +386,19 @@ fn main() -> Result<()> {
388386 format,
389387 } => {
390388 let base_ref = resolve_base ( & root, base, merge_base) ?;
391- cmd_ci (
392- & root,
393- & base_ref,
394- filter. as_deref ( ) ,
395- skip. as_deref ( ) ,
396- format,
397- )
389+ cmd_ci ( & root, & base_ref, filter. as_deref ( ) , skip. as_deref ( ) , format)
398390 }
399391 Commands :: Init { non_interactive } => cmd_init ( & root, non_interactive) ,
400392 Commands :: Watch {
401393 subcommand,
402394 debounce,
403- } => cmd_watch ( & root, subcommand, debounce, cli. config . as_deref ( ) , cli. quiet ) ,
395+ } => cmd_watch (
396+ & root,
397+ subcommand,
398+ debounce,
399+ cli. config . as_deref ( ) ,
400+ cli. quiet ,
401+ ) ,
404402 Commands :: Run {
405403 command,
406404 base,
@@ -738,8 +736,7 @@ fn cmd_graph(root: &std::path::Path, dot: bool, base: Option<&str>) -> Result<()
738736
739737 // Get affected packages if base is specified
740738 let affected_set: std:: collections:: HashSet < String > = if let Some ( base_ref) = base {
741- let result =
742- affected_core:: find_affected_with_options ( root, base_ref, false , None , None ) ?;
739+ let result = affected_core:: find_affected_with_options ( root, base_ref, false , None , None ) ?;
743740 result. affected . into_iter ( ) . collect ( )
744741 } else {
745742 std:: collections:: HashSet :: new ( )
@@ -799,7 +796,14 @@ fn cmd_graph(root: &std::path::Path, dot: bool, base: Option<&str>) -> Result<()
799796
800797 for ( i, root_pkg) in roots. iter ( ) . enumerate ( ) {
801798 let is_last_root = i == roots. len ( ) - 1 ;
802- render_tree_node ( root_pkg, "" , is_last_root, & children, & affected_set, & mut std:: collections:: HashSet :: new ( ) ) ;
799+ render_tree_node (
800+ root_pkg,
801+ "" ,
802+ is_last_root,
803+ & children,
804+ & affected_set,
805+ & mut std:: collections:: HashSet :: new ( ) ,
806+ ) ;
803807 }
804808
805809 // Show isolated packages (no edges at all)
@@ -817,7 +821,12 @@ fn cmd_graph(root: &std::path::Path, dot: bool, base: Option<&str>) -> Result<()
817821 } else {
818822 String :: new ( )
819823 } ;
820- println ! ( " {}{} {}" , name. cyan( ) , marker, "(no dependencies)" . dimmed( ) ) ;
824+ println ! (
825+ " {}{} {}" ,
826+ name. cyan( ) ,
827+ marker,
828+ "(no dependencies)" . dimmed( )
829+ ) ;
821830 }
822831 }
823832
@@ -864,7 +873,14 @@ fn render_tree_node(
864873 if let Some ( deps) = children. get ( name) {
865874 for ( j, dep) in deps. iter ( ) . enumerate ( ) {
866875 let is_last_child = j == deps. len ( ) - 1 ;
867- render_tree_node ( dep, & child_prefix, is_last_child, children, affected, visited) ;
876+ render_tree_node (
877+ dep,
878+ & child_prefix,
879+ is_last_child,
880+ children,
881+ affected,
882+ visited,
883+ ) ;
868884 }
869885 }
870886}
@@ -1023,11 +1039,7 @@ fn cmd_init(root: &std::path::Path, non_interactive: bool) -> Result<()> {
10231039
10241040 if !non_interactive {
10251041 if let Some ( ref eco) = ecosystem_name {
1026- println ! (
1027- " {} Detected ecosystem: {}" ,
1028- "✓" . green( ) ,
1029- eco. cyan( )
1030- ) ;
1042+ println ! ( " {} Detected ecosystem: {}" , "✓" . green( ) , eco. cyan( ) ) ;
10311043 } else {
10321044 println ! (
10331045 " {} No ecosystem auto-detected. Config will use defaults." ,
@@ -1074,9 +1086,8 @@ fn cmd_init(root: &std::path::Path, non_interactive: bool) -> Result<()> {
10741086 . collect :: < Vec < _ > > ( )
10751087 . join ( ", " ) ;
10761088
1077- let mut config_content = String :: from (
1078- "# .affected.toml — configuration for the `affected` CLI\n \n " ,
1079- ) ;
1089+ let mut config_content =
1090+ String :: from ( "# .affected.toml — configuration for the `affected` CLI\n \n " ) ;
10801091
10811092 config_content. push_str ( & format ! ( "ignore = [{}]\n \n " , ignore_str) ) ;
10821093 config_content. push_str ( "[test]\n " ) ;
@@ -1122,10 +1133,9 @@ fn cmd_watch(
11221133 let mut debouncer = new_debouncer ( debounce_dur, tx) ?;
11231134
11241135 // Watch the project root recursively
1125- debouncer. watcher ( ) . watch (
1126- root,
1127- notify:: RecursiveMode :: Recursive ,
1128- ) ?;
1136+ debouncer
1137+ . watcher ( )
1138+ . watch ( root, notify:: RecursiveMode :: Recursive ) ?;
11291139
11301140 // Directories to ignore
11311141 let ignore_dirs: Vec < & str > = vec ! [ ".git" , "target" , "node_modules" , "_build" , ".dart_tool" ] ;
@@ -1147,19 +1157,15 @@ fn cmd_watch(
11471157 return false ;
11481158 }
11491159 let path_str = event. path . to_string_lossy ( ) ;
1150- !ignore_dirs. iter ( ) . any ( |d| path_str. contains ( & format ! ( "/{}/" , d) ) )
1160+ !ignore_dirs
1161+ . iter ( )
1162+ . any ( |d| path_str. contains ( & format ! ( "/{}/" , d) ) )
11511163 } ) ;
11521164
11531165 if relevant {
1154- println ! (
1155- "\n {} Change detected, re-running...\n " ,
1156- "↻" . cyan( ) . bold( )
1157- ) ;
1166+ println ! ( "\n {} Change detected, re-running...\n " , "↻" . cyan( ) . bold( ) ) ;
11581167 let _ = run_watchable ( & subcommand, root, config_path, quiet) ;
1159- println ! (
1160- "\n {} Watching for changes..." ,
1161- "👀" . to_string( ) . dimmed( )
1162- ) ;
1168+ println ! ( "\n {} Watching for changes..." , "👀" . to_string( ) . dimmed( ) ) ;
11631169 }
11641170 }
11651171 Ok ( Err ( error) ) => {
0 commit comments