66from pathlib import Path
77from typing import Dict , List , Union
88
9- from rich .console import Console
9+ from rich import box
10+ from rich .console import Console , Group , RenderableType
11+ from rich .panel import Panel
1012from rich .syntax import Syntax
1113
1214import nf_core .utils
@@ -276,6 +278,7 @@ def print_diff(
276278 else :
277279 log .info (f"Changes in module '{ Path (repo_path , module )} '" )
278280
281+ panel_group : list [RenderableType ] = []
279282 for file , (diff_status , diff ) in diffs .items ():
280283 if diff_status == ModulesDiffer .DiffEnum .UNCHANGED :
281284 # The files are identical
@@ -293,7 +296,18 @@ def print_diff(
293296 # The file has changed
294297 log .info (f"Changes in '{ Path (module , file )} ':" )
295298 # Pretty print the diff using the pygments diff lexer
296- console .print (Syntax ("" .join (diff ), "diff" , theme = "ansi_dark" , padding = 1 ))
299+ syntax = Syntax ("" .join (diff ), "diff" , theme = "ansi_dark" , line_numbers = True )
300+ panel_group .append (Panel (syntax , title = str (file ), title_align = "left" , padding = 0 ))
301+ console .print (
302+ Panel (
303+ Group (* panel_group ),
304+ title = f"[white]{ str (module )} [/white]" ,
305+ title_align = "left" ,
306+ padding = 0 ,
307+ border_style = "blue" ,
308+ box = box .HEAVY ,
309+ )
310+ )
297311
298312 @staticmethod
299313 def per_file_patch (patch_fn : Union [str , Path ]) -> Dict [str , List [str ]]:
0 commit comments